Created
June 12, 2020 15:35
-
-
Save octipus/ade5c62f014d742e2f8f7002bf9008c5 to your computer and use it in GitHub Desktop.
Shopify Liquid code snipped to calculate and display entitlement for free shipping ---- ideally to be displayed on the cart page - or anywhere :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Shopify Liquid code snipped to calculate and display entitlement for free shipping | |
//ideally to be displayed on the cart page - or anywhere :) | |
{%- assign freeShippingAmount = 60 | times:100 -%} | |
{%- assign cartTotalDiff = freeShippingAmount | minus:cart.total_price -%} | |
{%- if cart.total_price < freeShippingAmount -%} | |
<h4>Almost there! <br> Add {{ cartTotalDiff | money }} more to your cart for free shipping</h4> | |
{%- elsif cart.total_price >= freeShippingAmount -%} | |
<h4> Congratulations! You now have Free Shipping </h4> | |
{%- endif -%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment