$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>plugins - Woocomerce add info after order email prouct item|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

plugins - Woocomerce add info after order email prouct item

matteradmin10PV0评论

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>';
}
Post a comment

comment list (0)

  1. No comments so far