plugins - Woocomerce add info after order email prouct item

admin2025-06-05  11

I'm trying to add some labels after woocommrce order email items.

Example: We can do that on cart by using this filter.

add_filter( 'woocommerce_cart_item_name', array( $this, 'wc_esd_show_date_cart_page' ), 10, 2 );

This calls the wc_esd_show_date_cart_page() function and show its data after the item name.

I want to do the same for order email items, anyone know there have some filter for it, or another way to do this.

I'm trying to add some labels after woocommrce order email items.

Example: We can do that on cart by using this filter.

add_filter( 'woocommerce_cart_item_name', array( $this, 'wc_esd_show_date_cart_page' ), 10, 2 );

This calls the wc_esd_show_date_cart_page() function and show its data after the item name.

I want to do the same for order email items, anyone know there have some filter for it, or another way to do this.

Share Improve this question edited Dec 19, 2018 at 17:21 rudtek 6,4035 gold badges30 silver badges52 bronze badges asked Dec 19, 2018 at 17:07 Suneth KalharaSuneth Kalhara 1031 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

you can do this with a differnent woocommerce hook:

woocommerce_order_item_meta_end ($item_id, $item, $order, $plain_text)

use it similarly to the cart filter above.

For a visual representation if you want the additional information somewhere else see this link:

https://businessbloomer/woocommerce-visual-hook-guide-emails/

You can also always go right to the source and see all the hooks/filters/actions in woocommerce: https://docs.woocommerce/wc-apidocs/hook-docs.html

as an example:

add_action( 'woocommerce_order_item_meta_end', 'rt_order_item_meta_end', 10, 4 );
function rt_order_item_meta_end( $item_id, $item, $order, $plain_text ){
    echo '<p>cool item detail</p>';
}
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749084077a316223.html

最新回复(0)