1

I was wondering if Craft supported having multiple stocks for one product. Something that Magento for example would call stock source.

I'm looking at having one set of stock associated to trade customers, and one for regular customers.

I could potentially look at them being different products and have different stock for it, but that would mean all the products would be duplicated, which is not great.

Thanks for your time

1

Commerce doesn't support multiple stock sources out of the box but you might be able to work around it, depending on your requirements.

To expand on your thoughts...

Variants

How are your products set up? Commerce doesn't add a product directly to a user's cart, it's actually Purchasable—with Variants being one of the purchasables in Commerce.

If your products don't have a lot of variations that you'd use a Variants for, one way to pull off what you're trying to do is just filter variants based on the user that's logged in—creating multiple groups could be one way.

That way, you could take advantage of Craft's native stock-handling features directly.

Depending on how many products are in the store, you might also choose to use something like a CSV import/export and not touch the Commerce backend directly.

Multiple stock level fields

Another slightly cleaner way to pull this off would be turn off Commerce's native stock handling (set it to unlimited) and roll your own validation with your own inventory fields.

From a code standpoint, that's a more intensive way to go but it does put you more in charge of how you handle inventory. Commerce provides multiple events to let you handle the stock validation and it might be a good way to go depending on your rules (eg you might want to reallocate inventory from a trade customer to handle a regular customer in some cases or vice versa).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.