I have a problem when I create products, I'm not sure since which version because I haven't added new products since a couple of months but the thing is that for new products the event "Check if a product add to cart form should be enabled (is in stock)" is not called and the button is by default disabled even if I change the configuration to disable and enable the product. I discover that in the rules log. But for all the old products there is no problem.

Could someone give me a clue of how can I fix this, if I'm missing something or any ideas.

I'm attaching two screenshots to see the difference.

Thanks.

CommentFileSizeAuthor
new_product.png206.7 KBpompetardo
old_product.png163.95 KBpompetardo

Comments

rszrama’s picture

Component: ----------------------- » Contributed modules
Category: bug » support
Status: Active » Closed (won't fix)

I'd check with the Stock module, as this is not a core Drupal Commerce feature. There may already be open issues or updates to correct this behavior, so be sure to search the queue at http://drupal.org/project/issues/commerce_stock before posting.

pompetardo’s picture

Ok, I wasn't sure in which module was that functionality, thanks.

pompetardo’s picture

Status: Closed (won't fix) » Active

I made some test and determined that the problem is in fact in the commerce module or at least something changed that affects the stock module. I tested it with a backup where everything worked, it had commerce 7.x-1.3 and commerce-stock 7.x-2.0-alpha2.

First I upgraded commerce-stock to 7.x-2.0-alpha3 and averything worked fine but when I upgraded commerce to 7.x-1.4 the issue appeared.

I read the release notes and maybe the minor API change has not been taked into account in the stock module. I also saw there are 3 changes related to the "add to cart" form that may affect:

#1759494 by rszrama, andyg5000: change the AJAX refresh code for profile copying to use an alterable commands array similar to the Add to Cart form.
#1343192 by rszrama: unset product_select element input when building the Add to Cart form if we detect that an attribute form element has been changed resulting in a potentially new set of #options for the product_select element.
#1029002 by kotnik, rszrama: allow single product Add to Cart forms to optionally show attribute field widgets via a new Add to Cart form display formatter setting.

I'm posting this also in the stock module queue. I reopened the issue here because I'm not sure how to find the API changes to fix the stock module.

pompetardo’s picture

Title: Event not fired for new products » New products disabled by default and can't be enabled

Apparently the problem is not in the stock module because the new product are disabled by default. When I try to edit them, it shows as it is enabled. I tried disabling and enabling but nothing changes.

rszrama’s picture

Status: Active » Closed (cannot reproduce)

I know of nothing that should cause a new product to default to being disabled on the Add to Cart form. My best guess is still an incompatibility with some contributed module, but I don't have anything new to add. I haven't seen any other reports of similar behavior in the past 6 months.