Skip to content

Commit 5ae2109

Browse files
⏫ Forwardport of #11949 to 2.3-develop branch
Applied pull request patch https://github.com/magento/magento2/pull/11949.patch (created by @nmalevanec) based on commit(s): 1. fbbebdc Fixed GitHub Issues in 2.3-develop branch: - #11868: "Add Products" button has been duplicated after the customer group was changed (reported by @OleksiyOleksiyovych)
1 parent 8e77e2f commit 5ae2109

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
});
@@ -1383,12 +1384,15 @@ define([
13831384
_label: '',
13841385
_node: null,
13851386

1386-
initialize: function(label){
1387+
initialize: function(label, id){
13871388
this._label = label;
13881389
this._node = new Element('button', {
13891390
'class': 'action-secondary action-add',
13901391
'type': 'button'
13911392
});
1393+
if (typeof id !== 'undefined') {
1394+
this._node.setAttribute('id', id)
1395+
}
13921396
},
13931397

13941398
onClick: function(){

0 commit comments

Comments
 (0)