Hi,
I think it makes sense to disable both the submit button and the quantity textfield (if present) when out of stock.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | commerce_stock-disable_quantity-1814034-1.patch | 721 bytes | andyf |
Hi,
I think it makes sense to disable both the submit button and the quantity textfield (if present) when out of stock.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | commerce_stock-disable_quantity-1814034-1.patch | 721 bytes | andyf |
Comments
Comment #1
andyf commentedThanks!
Comment #2
andyf commentedBtw, a few lines up (l103) it overwrites
$form['submit']['#attributes']rather than just adding an extra class.Comment #3
guy_schneerson commentedthis is now easily achieved on version 2 using the stock rules configuration.
@AndyF I will look into adding your patch and review your code comment fro version 1, thanks for your help
Comment #4
andyf commented@guy_schneerson thanks! Does that mean with v2 you can control the add to cart form with Rules?
Comment #5
guy_schneerson commented@AndyF, yes you can control most things using the advance cart configuration rules action including an option to "Hide the Quantity field if it is visible ".
Comment #6
andyf commentedGreat! I have a number of line item types in my latest shop, and I dislike the idea of creating a custom product display just so that I can configure the add to cart form to add a different kind of line item type (currently I'm using hook_field_display_alter() instead). Hopefully I'll be able to use Rules for this in future!
Comment #7
guy_schneerson commentedNo new features will be introduced to version 1, Version 2 is the recommended version for this functionality