Solved

Format Quantity in Event Variables

  • 15 September 2021
  • 1 reply
  • 7 views

Badge

How do I remove the “.0” in product quantities? 

The value from the e-commerce platform only shows “1”

 

icon

Best answer by Taylor Tarpley 15 September 2021, 18:51

View original

1 reply

Userlevel 3
Badge +4

Hi @jdbrngr

 

Welcome to the Community! We’re so glad you’re here!

 

Does your question pertain to previewing a customer’s event data in an email? If so, this is because the information displayed is a List Data Entry. It is very common to misunderstand the 0 in List Data as the quantity of the product. These List Entries in the event data are numbered starting at 0, not 1, indicating it is the first item in an array of items. The number does not equal the quantity of products in the event. For instance, if {{ event.extra.line_items.0.product.name }} is the variable entry for an image, the 0 indicates that it is the first item in the array (and not that there is no product images).

 

For more information explaining this, I recommend reading this section of Event Variables In Emails.

 

Thanks for sharing your question in the Community as I’m sure it will inform many others! 

 

Best,

Taylor 

Reply