This is a follow up to #2878155: When I press return to update the quantity of a line item it shouldn't be deleted.
Since I posted a follow up patch after the issue was closed, it probably was not easy to see.
To repeat my comment there:
---
Not sure if we should call this an edge case, but the selector in the jQuery code will only work if you actually use the view provided by commerce core with little customization. This means one has to duplicate this code to be able to fix the same issue when the selectors are different.
In my opinion we should add a class to the actual input instead, and use this as the selector. This way, the code would work regardless of how you customize the cart form. Well except if you actively remove this class, but that seems way less likely than someone doing some customization that ends up changing wrapper selectors.
Here is a patch with that approach. If you want a followup instead, please let me know :)
Comment | File | Size | Author |
---|---|---|---|
#4 | 3087356-4.patch | 1.17 KB | TwiiK |
| |||
2878155-19.patch | 1.2 KB | eiriksm | |
Comments
Comment #2
shamalainen CreditAttribution: shamalainen commentedThis patch seems to be working like a charm for this issue. Thank you!
Comment #3
eiriksmThen feel free to mark the issue as reviewed and tested by the community? :)
Comment #4
TwiiK CreditAttribution: TwiiK at Ny Media AS commentedThis patch didn't apply anymore so I updated it.
Comment #5
jsacksick CreditAttribution: jsacksick at Centarro commentedCommitted!
Comment #7
jsacksick CreditAttribution: jsacksick at Centarro commented