ajax-cart.js: hideOldProducts sometimes does not work #1
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-thirtybees/blockcart#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Method
ajaxCart.hideOldProductsis responsible for removing products no longer in the cart.Products in DOM are indexed using combination of
id_product,id_combinationandid_addressWhen figuring out what products to keep, only
id_productandid_combinationis compared, see line 316.github.com/thirtybees/blockcart@44322cc5a9/ajax-cart.js (L312-L321)If the id_address is changed between initial block cart render and subsequent ajax refresh call, then this code fails -- the product line is not removed from the DOM, but a new product line is later added by method
ajaxCart.addNewProducts