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 :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eiriksm created an issue. See original summary.

shamalainen’s picture

This patch seems to be working like a charm for this issue. Thank you!

eiriksm’s picture

Then feel free to mark the issue as reviewed and tested by the community? :)

TwiiK’s picture

This patch didn't apply anymore so I updated it.

jsacksick’s picture

Status: Needs review » Fixed

Committed!

  • jsacksick committed aeed3a2 on 8.x-2.x authored by eiriksm
    Issue #3087356 by eiriksm, TwiiK: If the quantity input in the cart is...
jsacksick’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.