Making a text appear on packing slip using a pre-discount cart/order value

Topic summary

A user wants to display “You’ve just earned a FREE Secret Gift!” text on packing slips when the pre-discount cart value exceeds $350.

Problem: Standard Liquid variables like {{ subtotal_price }} or {{ cart.subtotal_price }} aren’t working in the packing slip template.

Attempted Solutions:

  • Using {% if order.subtotal_price > 35000 %} - returned no value
  • Calculating {% if total_price - discounts_savings >= 35000 %} - didn’t work
  • Manually calculating discount savings by looping through order.discount_allocations - still unsuccessful

Current Status:

  • The calculation {{ total_price | minus: discounts_savings }} returns correct values when displayed
  • However, incorporating this into an {% if %} statement to conditionally show the text isn’t functioning
  • The text either doesn’t appear at all or shows for all orders regardless of value

Key Challenge: Finding the correct Liquid variable or syntax to evaluate pre-discount order value within a conditional statement on the packing slip template. The issue appears to be with the conditional logic rather than the calculation itself.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

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 %}
1 Like

Hi check with this

{% if order.subtotal_price > 350 %}

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.

order subtotal price: {{ order.subtotal_price }}

If you have any other advice, that’ll be greatly appreciated. Thanks!

{% if total_price - discounts_savings >= 35000 %}

You’ve just earned a FREE Secret Gift!

{% 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 %}

You've just earned a FREE Secret Gift!

{% endif %}

Thank you Saad13. But this didn’t work :disappointed_face:

I’ve also tried this but “

You’ve just earned a FREE Secret Gift!

” 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 %}