Best Approach to Enforcing Case Pack Quantities for Inventory

Topic summary

A wholesale candle company needs to restrict customer purchases to specific case pack quantities (multiples of 6, ranging from 6 to 102+) and prevent orders of leftover inventory that don’t meet these intervals.

Initial Question:

  • Whether to use Product IDs, SKUs, or product type as the basis for enforcement
  • Seeking recommendations from others who’ve implemented similar restrictions

Proposed Solutions:

  • Cart and Checkout API: Validate quantities at cart level by checking pack quantities, stock levels, and cart contents before allowing checkout. Requires Shopify Plus or a public app (not supported for private apps on lower plans)
  • Liquid + JavaScript: Display validation messages directly on the cart page
  • Shopify Functions: Custom app development to block checkout when case pack rules aren’t met

Current Status:
The discussion remains open with one developer offering to build a custom solution using Shopify Functions. The original poster accepted the offer, and they’ve moved to direct messages to implement the logic. No final solution has been shared publicly yet.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

Hey everyone,

We’re trying to prevent customers from purchasing leftover inventory that isn’t in case pack quantities using Shopify Plus and Script Editor. Would it be best to pull Product IDs or SKUs for this?

(Case intervals are 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 96, 102+)

  • If case pack quantities are mostly tied to product type, would that be a better approach?
  • Has anyone implemented a similar restriction, and if so, what worked best for you?

Would love to hear your insights—thanks in advance!

Here is our wholesale website: https://wholesale.pfcandleco.com/.

Hello,
You can accomplish this by utilizing the Cart and Checkout API, allowing you to enforce purchase restrictions directly on the cart page.

This approach is applicable for all the shopify plans but you will need a public app or Shopify plus plan as Cart and Checkout API are not supported for other shopify plan if its a private app.

Using cart validation you can check the quantities of product in pack,actual quantity in stock, quantity in cart and then apply logic to hold checkout.

Also you can use liquid code and JS in cart page to identify this issue and display message.

Do you have any solutions for writing up script on script editors?

@PFCANDLECO we’re currently developing an app that uses Shopify functions to help brands block the checkout from progressing if certain rules aren’t met.

I’d love to assist in setting this logic up on your store to ensure that only valid case intervals are purchased by the user at any point in time.

Let me know if we can get in touch for the same.

@PFCANDLECO hope you were able to come to a solution here. I’m sure the solution might not be something you can share readily.

But if you could - it could help others in the community greatly and also close the thread out :slightly_smiling_face:

Thank you for your time.

Yes, that would be great!

Sent a DM to help @PFCANDLECO .

Look forward to it.