MOQ on cart total

Hello,

I work together with a webflow web developer who has successfully integrated snipcart on our (webflow) website www.fredsvegan.com.
Snipcart is now in test mode and everything seems to be working fine.

We sell 3 products - 3 vegan mayo sauce varieties.
We want a minimum order quantity of 3 (random) bottles of our mayo sauce.
It is therefore a necessity for us that we have an MOQ on the total order/shopping basket and not on an individual product/sauce variety.

Our Webflow developper can’t find anything in the documentation for MOQ on total order/cart.
How can we achieve this? Can someone help us please?

Hi,
I’ve answered to your email, but for anyone finding this topic on a search for something similar. You can use our customization Customization – Snipcart Documentation to change the logic surrounding the checkout button. You would need to override the cart component and find the checkout button (there is a big comment BUTTON: checkout right before).

The first code snippet below simply changes the disable option to add a minimum quantity to it.
The second snippet changes the logic to disable it like before AND change the state to error with and error message if the cart quantity is lower than wanted (the error state does not disable the button, so I had to also disable)

 <button-primary
    label="actions.checkout"
    icon="continue-arrow"
    :state="checkoutDisabled || cart.items.count < 3 ? 'disabled' : undefined"
    @click="checkout"
></button-primary>
<button-primary
    label="actions.checkout"
    icon="continue-arrow"
    label-error="Three sauces required to checkout"
    :disabled="checkoutDisabled || cart.items.count < 3 ? true : undefined"
    :state="cart.items.count < 3 ? 'error' : undefined"
    @click="checkout"
></button-primary>