Restrict customers from buying products in multiple collections?

Hi,

I have a client that has some requirements along the lines of:

  • if a product in the cart is in collection “A”, they can only purchase other products in collection “A”
  • if a product in the cart is in collection “B”, they can only purchase other products in collection “B”
  • If a product is in any other collection, they can not add a product from collections “A” or “B”

Are there any apps that will enable this, or perhaps editing cart.prototype.addItemFromForm?

Thanks!

Hello @obsidianreq

Can you check this Shopify app in case it helps with your requirements.

https://apps.shopify.com/buy-x-restrict-y?

As I understand, you want only products from one collection to be in the cart.

Let’s say I’ve some products from collection A then I couldn’t add other products from collection B to my cart.

To achieve this I recommend using our miniOrange Lock-On application which will effectively resolve your concern. We can intercept add-to-cart events and specify custom validations with which we can decide whether to add a product to the cart or not.

Kindly, reach out to us from the application so that we can assist you better and brief you about the solution.

Thanks.