All things Shopify and commerce
Hi Community!
I have a question that may be quite simple for the experts.
Basically, I want to make the 'You've just earned a Free Gift!' text appear on the packing slip for orders whose cart value is greater than $350 before any discount. Basically, as long as the cart value (not the final total value) is more than $350, then the text appears on the packing slip.
I've tried to use just one liquid variable such as {{ subtotal_price }} or {{ cart.subtotal.price }} but it didn't seem to work...So I worked around it by using the total price - discounts as per my example.
Is there anything you can advise for me to be able to make the free gift text appear on the packing slip for the orders whose before-discount value is greater than $350?
Any advice will be greatly appreciated.
{% if total_price | minus: discounts_savings >=35000 %} <p style="padding-top: 10px;">You've just earned a FREE Secret Gift! </p> {% endif %}
Hi check with this
Hi Saad13
Thanks for your reply. Unfortunately, it doesn't seem to be working...
So, I've put the below to see if I get any value on the packing slip and there was no returning value.
<p>order subtotal price: {{ order.subtotal_price }}</p>
If you have any other advice, that'll be greatly appreciated. Thanks!
{% if total_price - discounts_savings >= 35000 %} <p style="padding-top: 10px;">You've just earned a FREE Secret Gift! </p> {% endif %} try this make sure that you've properly defined and calculated the total_price and discounts_savings
you can also try this
{% assign discounts_savings = 0 %}
{% for discount_allocation in order.discount_allocations %}
{% assign discounts_savings = discounts_savings | plus: discount_allocation.amount %}
{% endfor %}
{% if order.total_price - discounts_savings >= 35000 %}
<p style="padding-top: 10px;">You've just earned a FREE Secret Gift! </p>
{% endif %}
I've also tried this but "<p style="padding-top: 10px;">You've just earned a FREE Secret Gift! </p>" didn't show at all even for eligible orders. So I assume that the calculations part didn't work unfortunately.
Hi Saad13
When I put {{ total_price | minus: discounts_savings }}, it returns a correct value.
So unless there is one simple liquid variable, the key is how to put that into the if statement...
Any ideas?
{% if total_price | minus: discounts_savings >=35000 %}
Thank you Saad13. But this didn't work 😞
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025