Translate Your Online Store
Add multiple languages to your online store to sell in different markets and let customers shop in their preferred language.
Sometimes you want to restrict sales to a minimum quantity of products per order. You need to check quantity of item per products.
{% assign qty_valid = true %}
{% for product in order.products %}
{% if product.qty < 5 %}
{% assign qty_valid = false %}
{% endif %}
{% endfor %}
Now, the variable returns true or false if all products in the cart have 5 or more items.
You can then use this varriable to perform logic operations, like hiding a button via CSS.
{% unless qty_valid %}
<style type="text/css">
#button-id{display:none;}
</style>
{% endunless %}
What about restricting orders bellow a certain price amount?
You can perform a check on the {{ order.total }} or any of the other variables:
{{ order.subtotal }}
{{ order.shipping }}
{{ order.tax }}
{{ order.discount }}
Start your free 7-day trial. No credit card required.