File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ define([
29
29
listens : {
30
30
'${ $.productsProvider }:data' : '_showMessageAssociatedGrid _handleManualGridOpening' ,
31
31
'${ $.productsMassAction }:selected' : '_handleManualGridSelect' ,
32
- '${ $.configurableVariations }:productMatrix' : '_showButtonAddManual _switchProductType'
32
+ '${ $.configurableVariations }:productMatrix' : '_switchProductType' ,
33
+ '${ $.configurableVariations }:isShowAddProductButton' : '_showButtonAddManual'
33
34
}
34
35
} ,
35
36
@@ -64,7 +65,7 @@ define([
64
65
this . productsModal . notification ( ) ;
65
66
} . bind ( this ) ) ;
66
67
this . variationsComponent ( function ( variation ) {
67
- this . _showButtonAddManual ( variation . productMatrix ( ) ) ;
68
+ this . _showButtonAddManual ( variation . attributes ( ) ) ;
68
69
} . bind ( this ) ) ;
69
70
70
71
this . _initGrid = _ . once ( this . _initGrid ) ;
@@ -192,12 +193,12 @@ define([
192
193
193
194
/**
194
195
* Show button add manual
195
- * @param {Array } variations
196
+ * @param {Array } attributes
196
197
* @returns {* }
197
198
* @private
198
199
*/
199
- _showButtonAddManual : function ( variations ) {
200
- return this . button ( variations . length ) ;
200
+ _showButtonAddManual : function ( attributes ) {
201
+ return this . button ( attributes . length ) ;
201
202
} ,
202
203
203
204
_switchProductType : function ( variations ) {
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ define([
34
34
configurationsSerialized : ko . observable ( '' ) ,
35
35
variations : [ ] ,
36
36
productAttributes : [ ] ,
37
+ isShowAddProductButton : false ,
37
38
fullAttributes : [ ] ,
38
39
rowIndexToEdit : false ,
39
40
productAttributesMap : null ,
@@ -73,7 +74,7 @@ define([
73
74
pageSize : ko . getObservable ( this . paging , 'pageSize' )
74
75
} ;
75
76
76
- this . _super ( ) . observe ( 'actions opened attributes productMatrix' ) ;
77
+ this . _super ( ) . observe ( 'actions opened attributes productMatrix isShowAddProductButton ' ) ;
77
78
this . paging . totalRecords = this . variations . length ;
78
79
79
80
_ . each ( pagingObservables , function ( observable ) {
@@ -447,6 +448,7 @@ define([
447
448
} , this ) ;
448
449
this . productMatrix ( [ ] ) ;
449
450
this . productMatrix ( tempMatrix ) ;
451
+ this . isShowAddProductButton ( this . attributes ( ) ) ;
450
452
} ,
451
453
452
454
/**
You can’t perform that action at this time.
0 commit comments