WordPress.org

Forums

WooCommerce - excelling eCommerce
[resolved] Display product name in order email (2 posts)

  1. jeremdu21
    Member
    Posted 1 year ago #

    Hello

    In order to customize the new-order and Customer completed order emails, I try to display the product name in the php file. Unfortunately, I have not found the function on the specific page.

    Moreover, I don't want to use this function :
    <?php echo $order->email_order_items_table( true, false, true ); ?>
    because the result is displayed in a table. The purpose is to show the name of the product directly in the text.

    Thank you for your help and sorry if my english is bad, I'm french ;)
    JL

    https://wordpress.org/plugins/woocommerce/

  2. Coen Jacobs
    Member
    Posted 1 year ago #

    You can get the items (it's not just one item field in the order, it can be more than one) using the get_items method on the order object. This will give you an array of all items in that order. You can also pass a parameter that will specify the type of items you want to get (since fees, coupons and other custom lines are also saved as items, but you might want just products).

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic