Skip to content

Commit

Permalink
[Quick Order List] Ensure variant id is converted to an integer (Shop…
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiamatulis authored and Nathan Scheele committed Jul 1, 2024
1 parent 4cc0781 commit 1c7844d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions assets/quick-order-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,11 @@ if (!customElements.get('quick-order-list')) {
this.cartUpdateUnsubscriber = subscribe(PUB_SUB_EVENTS.cartUpdate, (event) => {
const variantIds = [];
this.querySelectorAll('.variant-item').forEach((item) => {
variantIds.push(item.dataset.variantId);
variantIds.push(parseInt(item.dataset.variantId));
});

if (
event.source === this.quickOrderListId ||
(event.cartData.items && variantIds.some((element) => !event.cartData.items.includes(element)))
!event.cartData.items?.some((element) => variantIds.includes(element.variant_id))
) {
return;
}
Expand Down

0 comments on commit 1c7844d

Please sign in to comment.