From fbbebdc55413f7266c55085d8f989f128535378a Mon Sep 17 00:00:00 2001 From: magento-engcom-team Date: Thu, 2 Nov 2017 11:53:40 +0200 Subject: [PATCH] 11868: "Add Products" button has been duplicated after the customer group was changed. --- .../Sales/view/adminhtml/web/order/create/scripts.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index 8e25584627d3b..02529cee5c0ff 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -55,7 +55,8 @@ define([ } }); - var searchButton = new ControlButton(jQuery.mage.__('Add Products')), + var searchButtonId = 'add_products', + searchButton = new ControlButton(jQuery.mage.__('Add Products'), searchButtonId), searchAreaId = this.getAreaId('search'); searchButton.onClick = function() { $(searchAreaId).show(); @@ -74,7 +75,7 @@ define([ this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) { proceed(); - if ($(searchAreaId) && !$(searchAreaId).visible()) { + if ($(searchAreaId) && !$(searchAreaId).visible() && !$(searchButtonId)) { this.addControlButton(searchButton); } }); @@ -1394,12 +1395,15 @@ define([ _label: '', _node: null, - initialize: function(label){ + initialize: function(label, id){ this._label = label; this._node = new Element('button', { 'class': 'action-secondary action-add', 'type': 'button' }); + if (typeof id !== 'undefined') { + this._node.setAttribute('id', id) + } }, onClick: function(){