Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
mmtt CreditAttribution: mmtt commentedComment #2
saurabh.dhariwal CreditAttribution: saurabh.dhariwal at AddWeb Solution Pvt. Ltd. commentedHi 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
Comment #3
matthensley CreditAttribution: matthensley commentedI had a similar issue, but then realized I hadn't enabled the "Commerce Simple Stock Rules" module, which provides those default rules.
Comment #4
stred CreditAttribution: stred commented+1 to enable "Commerce Simple Stock Rules" module. This should be added to section "Installation and setup" from the module page...
Comment #5
lukasss CreditAttribution: lukasss commented#4 I support!
Comment #6
guy_schneerson CreditAttribution: guy_schneerson commentedThanks all.
It was correct in the readme.txt but out of date on the module page so I just updated it to say:
I think this resolves this issue but if not do reopen.
Comment #8
Nikolino CreditAttribution: Nikolino commentedEven 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"
Comment #9
guy_schneerson CreditAttribution: guy_schneerson commentedHi 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.
Comment #10
Nikolino CreditAttribution: Nikolino commentedI 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.