It's a pity when a product is out of stock it disable the add-to-cart button en rename it to out-of-stock but I use webform-commerce with a special field: Commerce product skus, in this way the button add-to-cart is shown in the form.
When the product is out of stock this buttons is stil enabled and the name is still add-to-cart.
In the attachement you see a printscreen of the same buttons of one product, the first is in the webform and the last is directly from the product.

CommentFileSizeAuthor
#2 Advanced1.jpg91.23 KBPipB
#2 Advanced2.jpg61.01 KBPipB
#2 Advanced3.jpg99.48 KBPipB
#2 Advanced4.jpg87.67 KBPipB
#2 Advanced5.jpg38.21 KBPipB
addtocart.jpg4.37 KBPipB

Comments

guy_schneerson’s picture

Category: feature » support

You can easily do this by configuring the rule rules_stock_disable_add_to_cart and using the new "Advanced Add to cart form" instead of the "Set the state of the add to cart form"

let me know how you get on

PipB’s picture

StatusFileSize
new38.21 KB
new87.67 KB
new99.48 KB
new61.01 KB
new91.23 KB

Thank you for you're quick answer!!!
But I didn't get it working with the rule "Advanced Configuration Add to cart form".
Using Commerce_webform: there are 2 different add-to-cart-buttons and you're commerce_stock module only reacts on one button and not the button from the commerce webform, I think.
You're button react on the add to cart buttons which belongs directly to the product.

The advanced configration changes only the add-to-cart button from the product, not the add-to-cart button from the webform.
The webform button was originally a Submit-button.
I'll show you the results of the settings in this rule and the settings in the attachements.
De first button is the webform button, the second the real commerce add-to-cart button.

This is a piece of source-code of the page from the two buttons:

<input type="hidden" name="form_id" value="webform_client_form_8" />
<div class="form-actions form-wrapper" id="edit-actions"><input type="submit" id="edit-submit--2" name="op" value="Add to cart" class="form-submit" /></div></div></form><div class="field field-name-field-cursus field-type-commerce-product-reference field-label-hidden"><div class="field-items"><div class="field-item even"><form class="commerce-add-to-cart commerce-cart-add-to-cart-form-3 out-of-stock" action="/bzp/node/8" method="post" id="commerce-cart-add-to-cart-form-3" accept-charset="UTF-8"><div><input type="hidden" name="product_id" value="3" />
<input type="hidden" name="form_build_id" value="form-vj3dszKayU9gOpVoMnr0fMrC5IgYSaB3yO88r-7ALOI" />
<input type="hidden" name="form_token" value="swddwcQXqU6GcrQkSst_gMzfxeovKwti7zH-dY8zwks" />
<input type="hidden" name="form_id" value="commerce_cart_add_to_cart_form_3" />
<div id="edit-line-item-fields" class="form-wrapper"></div><input type="hidden" name="quantity" value="1" />
out-of-stock<a href="/bzp/out-of-stock" id="edit-submit">Out of stock</a>out-of-stock</div></form></div></div></div>  </div>
guy_schneerson’s picture

Hi @PipB
Sorry I didn't read the issue properly I will look into the Commerce_Webform in the new year I suspect it will be an easy update but weill need to look into it.

RKopacz’s picture

Did anybody ever resolve this? I have this exact issue, trying to use commerce webform and commerce stock. I would like to have the add to cart in commerce webform disabled when stock is out. I haven't tested it yet to see if it has been incorporated.

RKopacz’s picture

Issue summary: View changes

little change

bezlash@gmail.com’s picture

Issue summary: View changes

Hey, did anybody get to the bottom of this as I'm in the same boat. Thanks