Hi,

I think it makes sense to disable both the submit button and the quantity textfield (if present) when out of stock.

Comments

andyf’s picture

Status: Active » Needs review
StatusFileSize
new721 bytes

Thanks!

andyf’s picture

Btw, a few lines up (l103) it overwrites $form['submit']['#attributes'] rather than just adding an extra class.

guy_schneerson’s picture

this 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

andyf’s picture

@guy_schneerson thanks! Does that mean with v2 you can control the add to cart form with Rules?

guy_schneerson’s picture

@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 ".

andyf’s picture

Great! 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!

guy_schneerson’s picture

Status: Needs review » Closed (works as designed)

No new features will be introduced to version 1, Version 2 is the recommended version for this functionality