How can I limit the quantity of each item in a cart?

Topic summary

Goal: For a Shopify store selling one-of-a-kind paintings, limit each product to a quantity of 1 in the cart, since stock set to 1 still allows multiple units at checkout.

Suggested solutions:

  • Use an app:
    • Order Limits (MinMaxify): Set a maximum quantity per product and possibly per product groups; may also restrict which products can be purchased.
    • Purchase Limit (MageComp): Purpose-built for quantity caps.
    • DC Order Limits: Create a rule, set Maximum Quantity to 1, and apply by Product Variant so each unique painting is limited to one. A screenshot and a video demo were provided.

Custom approach:

  • No built-in theme setting was identified. Implement code to: (1) on each Add-to-Cart click, check if the product already exists in the cart; if yes, block and show a message; (2) hide the quantity selector on product and cart pages.

Other tip:

  • Try setting Inventory policy to “Deny orders,” though details weren’t provided.

Status: No confirmation from the original poster; solution remains open. Attachments (screenshot, video demo) illustrate the app-based setup.

Summarized with AI on December 26. AI used: gpt-5.

Hello @ddenby ,

You need to apply a custom solution for it. I don’t think there is a default option available in your theme to manage it.
If you can code you can get idea from here:

  1. On every click of atc check whether this product is in cart or not, If yes display a message to customer else add product to cart.
  2. Hide the quantity selector from the product and cart page.

Thanks