change woocommerce_order_item_name only on emails sent to admin
-
Hey dear,
I am using this function to change the product name but only need it for order emails sent to admin:
// Add filter to modify order item names
add_filter(‘woocommerce_order_item_name’, ‘custom_order_item_name’, 10, 3);function custom_order_item_name($item_name, $item, $is_visible) {
$product_id = $item->get_product_id();if (has_term(146, 'product_cat', $product_id)){
$item_name .= '<div class="adminnote"><strong>KLEINE FLASCHE</strong></div>'; // Append text
}
return $item_name;}
I have tried hundreds of versions and hooks (not in the above code) to include this filter only in the admin new order email and not in any other emails and can’t make it work.
Can you please assist.
Kind regards,
PenelopeThe page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.