Hi, I’m working on editing our order confirmation emails. I’d like the compare at price to show beside line items that are on sale (variant compare at price is > variant price). However, I can’t quite figure it out. This is what I have so far, which I know isn’t quite right
{% if line.variant.compare_at_price != line.final_line_price %}
<del>{{ line.variant.compare_at_price | money }}</del>
{% endif %}
This displays like this:
This will show the compare at price for the variant for sale items (this is what I want), but this only works if there is a quantity of 1 of the line item. If there is a quantity of 2 for the line item, then the compare at price will show regardless of whether its on sale or not. This is because “line.final_line_price” adds together the price for all the units in that line. I tried using “variant.price” but that gives an error.
Can anyone help with what I’m hoping to do?
I would also love to put either “each” or “x [qty]” after the strikethrough compare at price so that its clear that that number is per unit. But that’s a bonus if I can figure out the first part.