Cracking the Code: Enforcing Multiples of 6 Per Vendor in Shopify Basic Carts

Hey everyone! As a Shopify expert and community analyst, I love diving into the unique challenges store owners face. Recently, a really interesting discussion popped up that I think many of you running marketplaces or selling items with specific packaging rules will relate to. It was all about enforcing "multiples of 6" for mixed wine cases, specifically per vendor, on a Shopify Basic plan. Talk about a tricky situation!

Our friend JustGrapes kicked off the discussion, running a wine marketplace and needing to prevent shipping errors. The core problem? Customers needed to buy in multiples of 6 (e.g., 6, 12, 18 bottles) for mixed items, but this rule had to apply per vendor. So, if a customer had 3 bottles from Winemaker A and 3 from Winemaker B, they couldn't check out until they had 6 from each. Plus, pre-mixed cases (already sold as fixed sets of 6 or 12) needed to be excluded from this rule. And all this on a Basic plan, which means no Shopify Functions for robust checkout validation. Phew!

The Multiples Challenge: Per Vendor on Shopify Basic

This isn't just a wine store problem; it's a common hurdle for anyone selling items that come in specific pack sizes. The "per vendor" aspect is what makes it particularly complex, especially on a Shopify Basic plan. Without Shopify Plus and its powerful Checkout Functions, truly blocking an order at the checkout based on complex cart logic is a significant challenge. JustGrapes rightly pointed out that most apps handle multiples of the same product or total cart minimums, but rarely the "multiples per vendor for mixed items" scenario.

Community Insight 1: Product Page Quantity Control with Custom Templates

Maximus3, a helpful community member, offered a solid approach for enforcing multiples right on the product page. While this doesn't solve the "per vendor, mixed cart" challenge directly, it's a fantastic first step for enforcing multiples for individual products, and it can be adapted to exclude those pre-mixed cases JustGrapes mentioned.

The idea is to customize the quantity selector on specific product pages. Here's how you can implement it:

Step-by-Step: Modifying Your Product Quantity Selector

  1. Duplicate Your Product Template: In your Shopify Admin > Online Store > Themes, click "Actions" > "Edit Code". Under "Templates", create a new product template, naming it something like custom-wine-product.
  2. Find Your Quantity Selector: Search your theme files (e.g., product-form.liquid, main-product.liquid, or snippets) for the quantity input field. Look for .
  3. Duplicate the Quantity Form Snippet: If your quantity selector is in a snippet (like product-form.liquid), duplicate it. Create a new snippet, e.g., custom-product-form, and copy the original content into it.
  4. Modify Quantity Attributes: In your new custom-product-form.liquid, find the quantity input and add or change its min and step attributes to enforce multiples of 6:
    
    
    Test with step="6" first, then add min="6".
  5. Conditionally Render the Custom Form: In your main product section file (e.g., main-product.liquid or your new custom-wine-product.liquid template), find where the product form is rendered (e.g., {% render 'product-form' %}). Replace it with:
    {% if product.template_suffix == 'custom-wine-product' %}
      {% render 'custom-product-form' %}
    {% else %}
      {% render 'product-form' %}
    {% endif %}
    
    This ensures your custom quantity rules only apply to products assigned to the custom-wine-product template.
  6. Assign Products: For products needing this rule, go to their product page in Shopify Admin and select "product.custom-wine-product" under "Theme template". Products like your pre-mixed cases can simply use the default template, effectively excluding them from this rule.

This gives immediate feedback on the product page. Maximus3 also suggested displaying the quantity as "cases" in the cart, which is a nice touch for UX. You can achieve this in your cart item loop with:

{% assign cases = item.quantity | divided_by: 6 %}
{{ cases }} case{% if cases > 1 %}s{% endif %}

The Cart-Level Conundrum: Enforcing Per-Vendor Rules

While the product page modification is powerful, it doesn't fully solve JustGrapes' "multiples of 6 per vendor across mixed items in the cart" problem. That's a cart-level validation. As JustGrapes noted, apps might handle total cart minimums, but dynamic "step" rules *per vendor* across mixed items on a Basic plan are tricky. The community consensus for non-Plus stores often leans towards a JavaScript/Liquid snippet on the cart.liquid page to hide the "Checkout" button. Remember, this is client-side, so it's not foolproof, but it's the strongest client-side enforcement you can do without upgrading.

Implementing Client-Side Cart Validation (JS/Liquid)

This custom code approach involves:

  1. Gather Cart Data: Use Liquid in cart.liquid to collect necessary data (item quantity, item vendor, product tags/collections for exclusion) and pass it to JavaScript, perhaps as a JSON object.
  2. Process with JavaScript: The JS iterates through this data, groups items by vendor, and sums their quantities.
  3. Validate Multiples: For each vendor, check if their total quantity is a multiple of 6. Crucially, exclude quantities from pre-mixed cases (identified by tags/collections) from this calculation.
  4. Control Checkout: If all valid, show the checkout button. Otherwise, hide it and display a clear, helpful message to the customer explaining what needs to be adjusted in their cart.

This JavaScript would live within your cart.liquid template. It's not overly complicated, but it does take some time to implement correctly, as Maximus3 pointed out. If you need help with the JavaScript logic, community experts or a Shopify developer can definitely guide you. :star_struck:

So, while Shopify Basic doesn't offer the robust backend validation of Shopify Plus, combining product page quantity controls with a client-side cart validation script is your best bet for managing complex rules like "multiples of 6 per vendor" for mixed wine cases. It requires a bit of custom code, but these community insights show it's a manageable path to prevent those shipping errors and keep your operations smooth. Keep those discussions going – that's how we all learn and grow!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases