Created
June 17, 2019 20:25
-
-
Save plugin-republic/7cddfabd342f0d148b237825189f78d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add custom cart item data to emails | |
*/ | |
function plugin_republic_order_item_name( $product_name, $item ) { | |
if( isset( $item['pr_field'] ) ) { | |
$product_name .= sprintf( | |
'<ul><li>%s: %s</li></ul>', | |
__( 'Your name', 'plugin_republic' ), | |
esc_html( $item['pr_field'] ) | |
); | |
} | |
return $product_name; | |
} | |
add_filter( 'woocommerce_order_item_name', 'plugin_republic_order_item_name', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment