Is there a way to implement an extra input field for the quantity? Perhaps have it default to 1 if the field is left blank.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2934553-3-add-quantity-support.patch | 6.24 KB | nicolasgraph |
Is there a way to implement an extra input field for the quantity? Perhaps have it default to 1 if the field is left blank.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2934553-3-add-quantity-support.patch | 6.24 KB | nicolasgraph |
Comments
Comment #2
drugan commentedThis feature is on the plan to be added the 8.x-1.x version first and then backported to the 7.x-1.x. Will be done as soon as I have time for this work. Anyway, would be glad to review a patch to any of the versions, if someone will contribute it.
Comment #3
nicolasgraphHere you are!
Thanks in advance for your review.
Comment #4
nicolasgraphComment #5
nicolasgraphComment #7
drugan commentedI've made some changes to your patch because the whole issue is a bit more complex than it might be seen.
First, the type of the field is changed to the #textfield as the #number quantity field must have appropriate #step and possibly #min and #max and #default_value properties set on the respective order item type quantity field widget settings. In our case it is impossible to know at his point these settings just because we don't know which variation will come with the autocomplete field. So that's why we need #textfield without any properties hardcoded into it. Remember there is some modules, like the https://www.drupal.org/project/commerce_xquantity which provide more settings to the quantity field.
Please, test the changes and if everything is okay then I'll make a new beta4 release.
Comment #9
drugan commentedOkay, a couple of final touches and now to the beta4 version.
Thank you all, guys!