Hello
I need to make sure that wholesale customers buy in multiples of 4 as there are 4 products per box. So for example they need to buy 4 or more of the item quantity but it must be in multiples of 4 in the checkout so at the checkout:
4 is a correct quantity
8 is a correct quantity
12 is a correct quantity... etc
but
3 = is not correct
7 = is not correct
14 = is not correct... etc
So far I've managed to develop the cart so the quantity has to be above 3
{% if item.product.tags contains 'box' and item.quantity <= 3 %}
And is a wholesale item (item.product.tags contains 'box')
So if they have less than 4 products they get the comment
<p>You will need to order 4 products per box for this item (multiples of 4)"{{ item.product.title }}"</p>
AND the checkout button is not available
But not sure how to proceed to force the customer to buy in lots of 4 when it's more than 1 box (4 items they are buying). So if they choose 6 items they still need a comment above and no checkout button. I presume that if the output can be divided by 4 and is a whole number then it must be correct but not sure how to go about this.
I would love some help with this and hope it's a simple solution.
Thanks
Trevor
Full code shown below:
{% assign show_checkout = true %}
{% for item in cart.items %}
{% if item.product.tags contains 'box' and item.quantity <= 3 %}
{% assign show_checkout = false %}
<p>You will need to order 4 products per box for this item (multiples of 4)"{{ item.product.title }}"</p>
{% endif %}
{% endfor %}
{% if show_checkout %}
<input type="submit" id="checkout" class="btn" name="checkout" value="Checkout" />
<!-- show checkout button -->
{% endif %}