Skip to content

Commit 5e8b5e4

Browse files
committed
MAGETWO-83174: 11868: 'Add Products' button has been duplicated after the customer group was changed. #11949
- Merge Pull Request #11949 from nmalevanec/magento2:11868 - Merged commits: 1. fbbebdc
2 parents 148da00 + fbbebdc commit 5e8b5e4

File tree

1 file changed

+7
-3
lines changed
  • app/code/Magento/Sales/view/adminhtml/web/order/create

1 file changed

+7
-3
lines changed

app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ define([
5555
}
5656
});
5757

58-
var searchButton = new ControlButton(jQuery.mage.__('Add Products')),
58+
var searchButtonId = 'add_products',
59+
searchButton = new ControlButton(jQuery.mage.__('Add Products'), searchButtonId),
5960
searchAreaId = this.getAreaId('search');
6061
searchButton.onClick = function() {
6162
$(searchAreaId).show();
@@ -74,7 +75,7 @@ define([
7475

7576
this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) {
7677
proceed();
77-
if ($(searchAreaId) && !$(searchAreaId).visible()) {
78+
if ($(searchAreaId) && !$(searchAreaId).visible() && !$(searchButtonId)) {
7879
this.addControlButton(searchButton);
7980
}
8081
});
@@ -1394,12 +1395,15 @@ define([
13941395
_label: '',
13951396
_node: null,
13961397

1397-
initialize: function(label){
1398+
initialize: function(label, id){
13981399
this._label = label;
13991400
this._node = new Element('button', {
14001401
'class': 'action-secondary action-add',
14011402
'type': 'button'
14021403
});
1404+
if (typeof id !== 'undefined') {
1405+
this._node.setAttribute('id', id)
1406+
}
14031407
},
14041408

14051409
onClick: function(){

0 commit comments

Comments
 (0)