Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am looking for some assistance with a conditional statement I am trying to make work in an email notification. The email is the "New gift card" notification. I have 3 gift cards on sale and would like to show the intended value, instead of the gift card's sale price. I acknowledge I am "breaking the rules" by showing gift cards on sale, but this time of year it helps with holiday promotions.
Below is the original and modified code. I thought this would work, but it's not. gift_card.initial_value is still coming through as the on sale price. Any help is appreciated.
ORIGINAL
<td class="giftcard__balance"> {{ gift_card.initial_value | money_with_currency }} </td>
MODIFIED
<td class="giftcard__balance"> {% if gift_card.initial_value == 80.00 %} {{ 100 | money_with_currency }} {% elsif gift_card.initial_value == 63.75 %} {{ 75 | money_with_currency }} {% elsif gift_card.initial_value == 45.00 %} {{ 50 | money_with_currency }} {% else %} {{ gift_card.initial_value | money_with_currency }} {% endif %} </td>
@pickleball365 can you please share your store url please
@pickleball365 thanks for URL i will check and give you code
Hello @pickleball365 ,
Try this one
<td class="giftcard__balance">
{% assign initial_value_cents = gift_card.initial_value | times: 100 %}
{% if initial_value_cents == 8000 %}
{{ 100 | money_with_currency }}
{% elsif initial_value_cents == 6375 %}
{{ 75 | money_with_currency }}
{% elsif initial_value_cents == 4500 %}
{{ 50 | money_with_currency }}
{% else %}
{{ gift_card.initial_value | money_with_currency }}
{% endif %}
</td>
If problem solved don't forget to Like it and Mark it as Solution!
And if you need help with customization/code part you can contact me for services
You can find the email in the signature below.
Thanks
Hi @Guleria, thank you for posting. Unfortunately, I am getting the same result. The gift card value in the email is still coming through with the sale price.
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024