Skip to content

Commit 1a78c67

Browse files
author
olysenko
committed
Merge remote-tracking branch 'origin/MAGETWO-95428' into chaika_october2
2 parents 1548cc2 + c010653 commit 1a78c67

File tree

1 file changed

+11
-4
lines changed
  • app/code/Magento/Catalog/view/frontend/web/js/product

1 file changed

+11
-4
lines changed

app/code/Magento/Catalog/view/frontend/web/js/product/provider.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55

66
define([
77
'underscore',
8+
'jquery',
89
'mageUtils',
910
'uiElement',
1011
'Magento_Catalog/js/product/storage/storage-service',
11-
'Magento_Customer/js/customer-data'
12-
], function (_, utils, Element, storage, customerData) {
12+
'Magento_Customer/js/customer-data',
13+
'Magento_Catalog/js/product/view/product-ids-resolver'
14+
], function (_, $, utils, Element, storage, customerData, productResolver) {
1315
'use strict';
1416

1517
return Element.extend({
@@ -135,11 +137,16 @@ define([
135137
*/
136138
filterIds: function (ids) {
137139
var _ids = {},
138-
currentTime = new Date().getTime() / 1000;
140+
currentTime = new Date().getTime() / 1000,
141+
currentProductIds = productResolver($('#product_addtocart_form'));
139142

140143
_.each(ids, function (id) {
141-
if (currentTime - id['added_at'] < ~~this.idsStorage.lifetime) {
144+
if (
145+
currentTime - id['added_at'] < ~~this.idsStorage.lifetime &&
146+
!_.contains(currentProductIds, id['product_id'])
147+
) {
142148
_ids[id['product_id']] = id;
149+
143150
}
144151
}, this);
145152

0 commit comments

Comments
 (0)