I'm looking for a way (without pricey apps!) to set a minimum checkout rule which only applies to certain products.
So, with a number of products, you can only buy 1 unit, that's fine.
But with some products (my discounted wholesale products) you must buy 6 units to be able to place the order.
Is this possible? I'm happy to do the coding if someone has an idea of where to start with it!
Many thanks in advance
It depends how strictly you want to force the user to buy those 6 items before proceeding.
I can think of two easy ways that can be bypassed with some understanding of Shopify.
### Liquid only solution
Create a section with all the wholesale products ( or make a separate template for them where you can add a property filed for reference ) and check if any of them are present in the `cart.items` for loop and if the cart items are less than 6. If they are present and less than 6 hide the checkout button and the customer wont be able to proceed.
### JS solution
Perform the same thing but with JS and hide the button.
### Bypassing this functionality
Once the items are in the cart you can simple write
and you will be still redirected to the checkout page.
If you are on a Plus account you may be able to do some hacky stuff to prevent the user from moving to the next checkout step, but once again it depends on how strictly you want to limit the user.
Hyde here from Shopify. That's a very good question!
You're likely already aware of the MinMaxify app, which is a popular option for people who want to avoid writing code.
The only alternative would require coding. There have been a few accepted coding suggestions from Shopify Experts before, as in this case. If you don't feel comfortable coding yourself you could hire an expert.
Shopify Experts are a team of third-party developers who can make custom changes to your store on a contracted basis. As with all Expert contracts, requirements and prices are agreed upon before any work commences, so you can always check in with a few different Experts to ensure you're getting what you want for a competitive price.
All the best, Hyde.
|an hour ago|