Solved

Abandoned Cart Emails Don't Include Price with GST (Tax) (Magento 2)


Badge +4

Hello,

I’ve noticed that in the table block in my Abandoned Cart emails do not include the price with GST for each row item.

 

This is what my table looks like:

Abandoned Cart Table Block
Abandoned Cart Table Block - Preview

{{ item.SimpleName|upper }}

Qty: {{ item.Qty|floatformat:0 }}

Total: ${{ item.RowTotal|floatformat:2 }}

 

Any idea how I can get the incl. GST price for each row item?

icon

Best answer by David To 5 July 2022, 17:24

View original

4 replies

Userlevel 7
Badge +60

Hello @AndrewK,

If you haven’t already, I would suggest checking out @elisegaines’s awesome answer to a similar topic in the Community post below:

In essence, you’ll want to review your Started Checkout and see if it’s passing any additional prices such as one that does include the GST/tax amount. 

If your Started Checkout event was not passing an additional price inclusive of the tax, another workaround would be using variables filters for math to calculate and display the product cost with the tax amount. This solution works great if you have a standard tax tax rate or if you’re passing an additional variable that is just the tax amount. I touched upon this a bit in the Community post below:

I hope this helps!

David

Badge +4

Hey @David To, thanks for your reply mate!

 

To my suprise, I couldn’t find that the Started Checkout event was passing the price incl. tax.

 

Just to confirm, the way I checked was I did a CMD+F/CTRL+F to see if there was the price including tax in the preview section.

In this case I was searching for $275 which was not there.

Flow Email Preview - Started Checkout Event

 

Ideally it’d be nice if the data came directly from Magento, however since it wasn’t there, I added the variable filter “|multiply:1.1” to manually add the GST which works fine!

 

The variable now reads: Total: ${{ item.RowTotal|multiply:1.1|floatformat:2 }}

 

*One concern I have is that occasionally the rounding isn’t always accurate.

 

Eg. the price of the product here should be incl. $139.00 incl. tax

After applying the variable filter shown above, it calculates the price as $139.01.

Incorrect Rounding After Using Variable Filter to Add GST

 

Would you have any advice for this?

 

Much appreciated.

 

Cheers,
Andrew

Badge +4

*Update, I was able to find the price including GST here:

Item Price incl. GST

 

However, when I use this string to get the price, it only displays the price of the first item across all the products in the event.

“95” - is the string “{{ event.Items.0.Product.Price }}”

I’m not sure what to change with the string here

Userlevel 7
Badge +60

Hey @AndrewK,

Glad to hear you were able to find a data point that was passing your product price inclusive of the GST!

Since the price is reflecting the first product in the array, it sounds like you may not have reformat the variable correctly when you placed it into the dynamic table block. I would suggest taking a look at the following Help Center article to learn more about building dynamic table blocks. This would include instructions on how to reformat the variables you use within the table block. Essentially the reformatted variable you use will need to be aligned with how you’ve set up the row collection.

 

Another great resource would be @Anna McCarthy’s Community post which I’ve linked below where she offers a walkthrough on how to build a dynamic table block. Although the video is centered on using the new editor, the methodologies and theories she explains would still translate to the classic editor.

David

Reply