I've installed the simple stock the first time, chosed on products for stock management. I can see the stock field in the view fields area but all this does not change the add to cart to out of stock if set to "0".

Is there something more to know to get it working?

Comments

mmtt’s picture

Issue summary: View changes
saurabh.dhariwal’s picture

Hi mmtt,

On Commerce Stock module they mentioned "Key Features of V2"
- A rule and action for enabling and disabling the add to cart form.
- A rule and action for validating stock for the add to cart button action.

Additionally, Please check rules from following path

admin/commerce/config/stock/validation

Under find "Check if a product add to cart form should be enabled (is in stock)" Rule with Event and check its Enabled or not?

Thanks,
Saurabh Dhariwal

matthensley’s picture

I had a similar issue, but then realized I hadn't enabled the "Commerce Simple Stock Rules" module, which provides those default rules.

stred’s picture

+1 to enable "Commerce Simple Stock Rules" module. This should be added to section "Installation and setup" from the module page...

lukasss’s picture

#4 I support!

guy_schneerson’s picture

Status: Active » Fixed

Thanks all.
It was correct in the readme.txt but out of date on the module page so I just updated it to say:

Enable the Commerce Stock API, Commerce Simple Stock, and Commerce Simple Stock Rules modules.

I think this resolves this issue but if not do reopen.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Nikolino’s picture

Even after enabling Commerce Stock API, Commerce Simple Stock, and Commerce Simple Stock Rules modules I have 2 problems...

1. "out-of-stock" class is applied to the form rather than input (it's a problem that I can work around)
2. the input is disabled but the value remain "Add to Cart"

guy_schneerson’s picture

Hi Nikolino
that's strange as that doesn't sound like the behavior of the stock module.
I would make sure no custom rules are enabled, you are using the latest version and then go and check the rules in admin/commerce/config/stock/validation. Its the rule under "Cart state" called "Stock: disable add to cart" that should be kicking in.
This rule can have one of two versions installed, depending if you have i18n for localization installed.

Nikolino’s picture

I have version 2.3
In admin/commerce/config/stock/validation there are 3 rules "Stock: disable add to cart", "Stock: validate add to cart" and "Stock: validate checkout" and are all enabled. I also have the i18n module installed.