I'm looking to hook into the 'woocommerce_cart_item_name' filter in woocommerce and would like to display the product ID after the name. I'm working with this so far...
add_filter( 'woocommerce_cart_item_name', 'justatest' );
function justatest( $productname ) {
echo $productname;
// ideally echo name and product id here instead
}
This returns the name with a link around it but I want to add the actual ID of the product after the item name.
How can I add the product ID after the cart item name in Woocommerce cart page?
I know I'd need to not return first since that will pull me out of the function, but I'm curious how I'd go about doing this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…