• Hello,
    I have added some agreement text below the Customer Order notification email but I need to insert the product name and price into the text so I am modifying the customer-processing-order.php file. However I cannot find a way to add the purchased product name(s).
    email-order-items.php generates and inserts the data into a table but I cannot not get the information into the text in the email.

    // Product name
    				echo apply_filters( 'woocommerce_order_item_name', $item['name'], $item, false );

    Adding the code above wont print the product name in the agreement text I have added.
    Can someone give me a hint?

    https://www.ads-software.com/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    I’m not sure what you mean here – email-order-items.php already lists products + product names. It loops over all cart items.

    Thread Starter ceviz ms

    (@minasmiroglu)

    Mike, thank you for you reply!

    I my case there is no problem with the email-order-items.php. The file creates a table with product name, price etc.
    I am adding a static agreement text below the table however in this text there are some sentences that needs to be dynamic.
    For example,

    Purchase Agrrement
    You have purchased XXX $ of products from our site and these products are listed below;

    • product 1
    • product 2

    Lorem ipsum…

    I need to add a function / hook in my text which can display the information in the table.

    I hope I made it clear now:) Sorry for my poor explination.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    You would need to look at the passed in $order object. This has methods to loop over items etc and get totals.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding product name and price in agreement text’ is closed to new replies.