File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
app/code/Magento/ConfigurableProduct/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,12 @@ define([
7
7
8
8
var selectors = {
9
9
formSelector : '#product_addtocart_form' ,
10
- productIdSelector : '#product_addtocart_form [name="product"]'
10
+ productIdSelector : '#product_addtocart_form [name="product"]' ,
11
+ itemIdSelector :'#product_addtocart_form [name="item"]'
11
12
} ,
12
13
cartData = customerData . get ( 'cart' ) ,
13
14
productId = $ ( selectors . productIdSelector ) . val ( ) ,
15
+ itemId = $ ( selectors . itemIdSelector ) . val ( ) ,
14
16
15
17
/**
16
18
* set productOptions according to cart data from customer-data
@@ -24,8 +26,10 @@ define([
24
26
if ( ! ( data && data . items && data . items . length && productId ) ) {
25
27
return false ;
26
28
}
27
- changedProductOptions = _ . find ( data . items , function ( item ) {
28
- return item [ 'product_id' ] === productId ;
29
+ changedProductOptions = data . items . find ( function ( item ) {
30
+ if ( item [ 'item_id' ] == itemId ) {
31
+ return item [ 'product_id' ] === productId ;
32
+ }
29
33
} ) ;
30
34
changedProductOptions = changedProductOptions && changedProductOptions . options &&
31
35
changedProductOptions . options . reduce ( function ( obj , val ) {
You can’t perform that action at this time.
0 commit comments