Skip to main content

Hey everyone

I am trying to add the product size to each item ordered in the order confirmation email

I’ve added this code {{ event.extra.Items.0.Variant.Attributes.0.Value|default:'' }} but the problem is that when someone orders more than 1 product, it shows the same size in all the products on the order confirmation email

I'm using Woocommerce

Happy to get help here

 

Hi @Karina!

This is because the order items are stacked in an array, and the ‘0’ after ‘Items’ in the event variable you are using refers to the first product in the order (the numbering paradigm starts at 0, 1, etc.):

 

{{ event.extra.Items.0.Variant.Attributes.0.Value|default:'' }}

 

Therefore, since you’re essentially just copying and pasting this event variable, the same size value is being called in each repetition. 

 

To fix this, you can follow the steps in this Help Center article to create a repeating block.

 

Essentially, you will have to create a dynamic block and navigate to Display Options > Content Repeat > Create Repeat Rules. Then, create an item alias (explained in the Help Center article) like this:

 


Now, you will be able to include {{Item.Variant.Attributes.0.Value|default:''}} in your product block, and when the block repeats it will include the correct size for that item.

 

I hope this helps, and thanks for using the Community!

- Brian


Reply