Workflow: Dependent Product Options + Stock


is it possible to implement a workflow that combines product options with differentiated stocks per product. Example:

Let’s say we are having a T-Shirt that you can purchase in S, M, L or XL. When the customer selects the option size M we have to indicate somehow that the T-Shirt in size M is sold out but S, L and XL are still available. As far as I can see there’s only one stock field for a product which can’t be related to the different product options.

Any ideas how to accomplish this? This is a crucial feature for us…

Thanks in advance!

Hi! As you’ve found, SimpleCart’s product options don’t currently allow that. We’ve got an open feature request for that (#31) which is planned for 2.4 at the moment (which may change).

Hey Mark,

Seeing as you’ve just announced “Commerce”, how likely is it that SimpleCart will continue to see further development?

Is Commerce an extension of SimpleCart, a replacement for SimpleCart or something else altogether?

Looking forward to seeing what you’ve came up with! A comprehensive e-commerce solution has long been missing in the MODx environment!


Hey Jared,

Commerce is a completely different e-commerce solution. It’s not SimpleCart v3, or modmore-custom-billing-engine v2; it’s completely new. We’ve been working on that since before we took over SimpleCart (Bert knew this too), so I wouldn’t call it a replacement per se - more of an alternative.

We’ll continue working on SimpleCart for a while alongside Commerce, at least one year after Commerce 1.0 is released. After that year we’ll evaluate how things are going with both projects and decide on what to do next. If SimpleCart is still actively used by people for new shops, that could mean we keep it around as a Premium Extra, but if people have moved to Commerce we might decide to turn it into an open source extra or put an end of life date on it.

Early 2016 there should be a SimpleCart 2.4 which brings a bit more flexibility in certain areas, and there should be another gateway for SimpleCart out by then as well.

One interesting aspect of Commerce is that it can make use of SimpleCart (or minishop, standard resources or custom tables) for managing the front-end product catalog through an adapter. We’ll have that option available for SimpleCart at least, so there’s going to be some overlap that should benefit both projects there.

Thanks for the explanation Mark! Really excited to see what is to come with Commerce. It almost sounds like Commerce is going back to SimpleCart’s roots prior to the CRC etc which I loved! Still haven’t used the CRC with Simplecart because I prefer the customization abilities of the standard resource.

For @imig : I would probably use a custom TV (perhaps MIGX?) instead of the SimpleCart Options TV to accomplish this since you would have more flexibility and custom fields are passed to the order anyhow. Then just create a finish order hook to actually modify the stock level in the TV for completed orders.

Thanks @jaredloman ! That makes sense. I will give it a try!

Hi! I’m starting a new shop right now and we will sell… t-shirt, has it been added the option to manage stock combined with options?
Otherwise I’ll go on with migx solution :slight_smile:


how to handle different prices using the migx solution?

Example options:
OPT1: color 01, size 01, other blabla…, stock 100, price 10
OPT2: color 02, size 02, other blabla…, stock 70, price 30

To handle different prices, it seems necessary to use a simplecartoption TV.
So, in order to insert different values ​​for each option I could put them split between pipes in the simplecartoption TV value.

Example: color:valueColor|size:valueSize|…|stock:valueStock

And then use a custom output filter to show them individually.

I see no other solution at the moment.

That does indeed sound like the only viable approach at the moment. Neither SimpleCart nor Commerce support matrix-type product options with individual stock/prices.

You could add multiple product options TV to a single resource, but you also wouldn’t get the specific stock of “color 1 in size 1”.

I’ve got some ideas to accomplish this in Commerce, but that’s a long-long term kinda project.

Hi Mark,

Thank you for your confirmation.

The way I handled this was to create a product options tab that loads/creates child Products. This way each option is handled like an individual product.

That sounds interesting @matdave - could you perhaps elaborate on how you set that up? Using something like Collections or MIGXDB to add that interface?

Nice solution @matdave. My variants can be multiple and different from each product.

Can I use Collections ?? :open_mouth: :sweat_smile:

Nope, just a little extra JS to make a new tab and then have a MODX.grid. My getList processor just calls the modResource children, and I have a quick-create window. I have it set up so that the pagetitle gets populated by the Product Title - Variant Title, and the variant title you see here is just the menutitle. It’s pretty handy.

Has this made any progress at all? Or has this feature been abandoned?

I wouldn’t personally use the word abandoned, but it is unlikely this will be implemented into the core SimpleCart package any time soon. There’s a can of worms that opens up when you consider people may use multiple option TVs, as then you need to figure out which one to use as leading. I’m also not sure how this would work in the checkout, but I haven’t looked into it specifically yet.

It’s not an impossible request, especially when setting clear expectations for what is and what isn’t supported, and I can see there’s still demand for it, but my time is limited so I don’t want to create any unjust hope for it to arrive soon with most of my time going to Commerce these days.

If @matdave were willing to share his code, that could be useful for the people here I’m sure.

As for Commerce, the way Commerce deals with this use case is that each unique variation (e.g. “Red t-shirt in size S”) is a unique product record, with its own pricing, stock, weight, etc. That has the downside that if you have lots of dependent variations, it gets exponentially more work to manage, but it is more realistic in the sense that for most types of products you do in fact have a separate stack in your warehouse.

Products in Commerce are also extendable, so while Commerce doesn’t currently have the concept of product attributes, adding that into Commerce will be much simpler than it would be in SimpleCart.