I try to fetch the product name of the order in woocommerce, now I can fetch the shipping method by using :
add_action( 'woocommerce_email_after_order_table', 'wdm_add_shipping_method_to_order_email', 10, 2 );
function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {
echo '<p><h4>Shipping:</h4> ' . $order->get_shipping_method() . '</p>';
}
I tried to use:
$order->get_name() or $order->get_id()
But it shows internal server error. please help.
How to fetch the name or the ID of the product in order email notifications?
My Answer:
Shipping Method: ' . $order->get_shipping_method();_}_But I am not sure how to fetch the product name or id. Can you please help me with this?
Rate this post
3 of 5 based on 4098 votesComments