0

enter image description hereI am using Magento Enterprise 2.1.9 version. On Create Order Page (admin) if I change customer group, buttons "Add Products By SKU" and "Add Products" are getting duplicate. This is a existing bug in Magento. Can anyone please help me how to rectify this.

1 Answer 1

0

I found the bug, there is an error in magento2.1.9 js file. they are using label property instead of _label .

File path

vendor\module-sales\web\order\create\scripts.js

Replace this code

        this.summarizePrice = true;
        jQuery.async('#order-items', (function(){
            this.dataArea = new OrderFormArea('data', $(this.getAreaId('data')), this);
            this.itemsArea = Object.extend(new OrderFormArea('items', $(this.getAreaId('items')), this), {
                addControlButton: function(button){
                    var controlButtonArea = $(this.node).select('.actions')[0];
                    if (typeof controlButtonArea != 'undefined') {
                        var buttons = controlButtonArea.childElements();         
                        for (var i = 0; i < buttons.length; i++) {  
                            if (buttons[i].innerHTML.include(button.label)) {
                                return ;
                            }
                        }
                        button.insertIn(controlButtonArea, 'top');
                    }
                }
            });

By this code:

        this.summarizePrice = true;
        jQuery.async('#order-items', (function(){
            this.dataArea = new OrderFormArea('data', $(this.getAreaId('data')), this);
            this.itemsArea = Object.extend(new OrderFormArea('items', $(this.getAreaId('items')), this), {
                addControlButton: function(button){
                    var controlButtonArea = $(this.node).select('.actions')[0];
                    if (typeof controlButtonArea != 'undefined') {
                        var buttons = controlButtonArea.childElements();         
                        for (var i = 0; i < buttons.length; i++) {  
                            if (buttons[i].innerHTML.include(button._label)) {
                                return ;
                            }
                        }
                        button.insertIn(controlButtonArea, 'top');
                    }
                }
            });
1
  • I want to rename the existing Add Product button. any idea ???
    – Ghulam.M
    Commented Feb 22, 2021 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.