I'm trying to append text to WooCommerce product title in the cart if products has a specific tag.
This is what i have. I mis the conditional code.
add_filter( 'woocommerce_cart_item_name', 'add_udstilling_below_cart_item_name', 10, 3);
function add_udstilling_below_cart_item_name( $item_name, $cart_item, $cart_item_key ) {
echo $item_name . ' (test)';
}
I tried something like this:
if ( has_term( 'udstillingsmodel', 'product_tag' ) ) {
}
But i need help getting it to work with products in cart.