Wix Stores: minimum items per order and sell-out caps for product drops (what works today)
Two questions keep coming up from Wix Stores sellers on Reddit, the Wix forum and under YouTube tutorials: "Customers must order at least 6 items, any mix of products." (Or the opposite: no more than 6 items per order.
Two questions keep coming up from Wix Stores sellers on Reddit, the Wix forum and under YouTube tutorials:
- "Customers must order at least 6 items, any mix of products." (Or the opposite: no more than 6 items per order.)
- "I open the shop once a month with about 60 to 70 items. When that many are sold in total, everything should be sold out."
This post covers what Wix offers built in for both, step by step, where each option stops, and the code route if you're comfortable with Velo.
Full disclosure: I build Wix apps, and one of them does both of these. It's in a short section at the end. The built-in options come first, because for some stores they are enough.
Problem 1: a minimum (or maximum) number of items across the whole cart
Built-in option: the free Checkout Requirements app
Wix has a free app from Wix itself called Checkout Requirements. Wix's feature request page for min/max quantities now says "We've released this feature!" and points to it. Setup, from the setup guide:
- In the editor, click Add Apps, search for Wix Checkout Requirements and click Add to Site.
- In the site dashboard, open Checkout Requirements and click Add Requirement.
- Give it a name (shoppers don't see it).
- Pick a type: Minimum quantity of products, Maximum quantity of products or Minimum order subtotal.
- Enter the number or amount.
- For quantity types, choose Specific products or All products.
- Choose whether checkout stays open with a warning, or is disabled with an error message.
- Write the message shoppers will see.
The cart shows the message when a requirement isn't met, and checkout shows it again if the shopper gets there anyway (for example through Buy Now, or because you chose "warning only").
For "at least 6 of this mug" or "max 1 of this vase", or "orders must be at least $50", this is all you need. Start here.
Where it stops
The scope options are the catch. Wix's guide says:
- All products: "The requirement applies separately to each product." So "minimum 6, all products" means 6 of each product in the cart, not 6 items in total. That's not the "any 6 items" rule.
- Specific products: "Only specific product(s) count towards the minimum or maximum." The guide doesn't spell out whether several selected products are added up together. If they are, selecting every product would get you close to a whole-cart rule, but you'd have to remember to add each new product to the requirement. I haven't verified this, so test it on your live site with a mixed cart before relying on it.
Also not covered by the guide: variants, categories, or different rules for wholesale and retail customers.
Built-in workaround: sell packs as single products
If the real rule is "wine comes in sixes", make a product called "6-pack" with the price of six. It's simple and it can't be broken at checkout. It doesn't work for "any 6 items, mix and match", because the shopper has to be able to choose the mix.
Code route: the eCommerce validations service plugin
If you use Velo, the validations service plugin is the right tool. Wix's own tutorial example is close to this exact case: a wholesale store where the cart must hold at least 300 items in total.
In short:
- Enable coding (Velo Dev Mode in Wix Editor, or Start Coding in Wix Studio).
- Under Service Plugins, add an eCommerce Validation plugin and give it a name.
- In the config file, return
{ validateInCart: true }. By default the plugin only checks checkout, not the cart. - In
getValidationViolations(), add up the line item quantities and return a violation when the total is too low or too high. - Publish the site.
The core of it:
import * as ecomValidations from "interfaces-ecommerce-v1-validations-provider";
export const getValidationViolations = async (options) => {
const total = options.validationInfo.lineItems
.reduce((sum, item) => sum + item.quantity, 0);
if (total >= 6) return { violations: [] };
const severity = options.sourceInfo.source === ecomValidations.Source.CART
? ecomValidations.Severity.WARNING
: ecomValidations.Severity.ERROR;
return { violations: [{
severity,
target: { other: { name: ecomValidations.NameInOther.OTHER_DEFAULT } },
description: "Orders need at least 6 items.",
}] };
};
In Wix's tutorial, errors show at the top and bottom of checkout and the button is disabled until they're fixed.
One thing I've seen go wrong in a Reddit thread: code that only runs on the cart page (a button click handler, for example) doesn't stop anyone. Shoppers can reach checkout without it. The check has to live in the validations plugin, which Wix calls for both cart and checkout.
Problem 2: one sell-out number shared across a product drop
Built-in option: stock per product or variant
Wix Stores inventory is tracked per product, or per variant once you turn on Manage pricing and inventory for variants (inventory guide). With Track Inventory on, the count goes down with each sale and the item shows as out of stock at 0.
So for a drop of 60 to 70 items you can:
- Decide in advance how many of each product (or each size and colour) you'll sell.
- Enter those counts before you open. For many variants, exporting the products to CSV, editing the counts and importing again can be faster than opening each product.
- When everything hits 0, the drop is over.
Where it stops
There is no shared number. If you set 10 per product across 7 products, you might sell out of the popular ones at 10 while the rest sit there, and you can't move the unsold quantity across without editing stock by hand mid-drop. If you set each product to 70 "to be safe", you can sell 70 of each. Inventory just doesn't have a "group total".
Opening and closing the drop at a set time is the other half. As far as I can tell there's no built-in "sale ends at 8 pm" switch for Stores products, so most sellers hide the products or set stock to 0 by hand when the drop ends. If you know a native way, please tell me in the comments.
Code route
This one is harder than problem 1, because you need state: how many have been sold so far across the group. Roughly:
- Keep a running total in a CMS collection, updated from an order event (for example when an order is paid or created), and subtract cancelled orders.
- In the validations plugin, read that total and block checkout when the cart would push it past your cap.
- Decide what happens when two people check out the last items at the same moment. The validations plugin checks the cart, not a reservation, so very close to the cap you can still oversell by a few unless you handle it.
It's doable, but it's no longer a 20-line snippet, and you own it each month.
The app I built for both
Full disclosure: I built Order Minimums & Limits for these rules. You set rules in the site dashboard, and when the cart breaks one the shopper sees your message in cart and checkout and can't order until it's fixed.
What it covers:
- Minimum or maximum number of items, or a minimum spend, for the whole order or for chosen products, counted together or per product or variant. So "at least 6 items, any mix" is one rule.
- Packs: sell items only in multiples, like wine in sixes.
- Ordering hours, such as weekdays 9 to 5. Outside them shoppers see when you open again.
- Limited runs for drops: stop selling after a set number sold in total, and open or close sales at set times.
- Rules for categories or collections, and rules for shoppers with a contact label (like Wholesale) or for everyone else.
- Restaurants: daily dish caps, orders a set number of hours ahead, and a limit on dishes per order (needs Wix Restaurants Orders (New)).
- Your own message per rule, or a default in English, German or Spanish. If anything fails on the app's side, the rule is skipped so the sale can go ahead.
Free vs Pro, so you know up front:
- Free: unlimited whole-order and product rules (quantity, pack and spend limits) plus ordering hours. That covers problem 1.
- Pro ($5.99/month, or $4.99/month billed yearly, 14-day free trial): categories and collections, contact labels, limited runs, sale start and end dates, and restaurant dish limits. The shared sell-out cap for drops (problem 2) is a Pro feature.
It needs Wix Stores, and nothing shows on your live site except the messages in cart and checkout.
- Order Minimums & Limits on the Wix App Market: go.kayabyte.dev/limits
- A longer setup guide with example rules: Order Minimums & Limits guide
If you've solved the "shared cap for a drop" problem a different way on Wix, I'd like to hear how in the comments.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.