0

I have to make the PO number as non required field using custom module and not in the theme level as we are running our website as a hybrid model. When I refer for solution, I am getting to make the po number as non required field in theme level. Example: How to make purchase order number optional in checkout page magento 2.3

I knew we can override the template using custom module but its not working. Can anyone please tell me the steps to make the PO optional that would be really helpful.

1 Answer 1

1

You can use requirejs-config.js for overwrite or extend native logic

Overwrite:

let config = {
    map: {
        "*": {
            "Magento_OfflinePayments/payment/purchaseorder-form.html" : "Acme_StackExchange/payment/purchaseorder-form.html"
        }
    }
};

Extend parent JS with mixin and overwrite template in mixin

let config = {
    "config": {
        "mixins": {
            "Magento_OfflinePayments/js/view/payment/method-renderer/purchaseorder-method": {
                "Acme_StackExchange/js/view/payment/method-renderer/purchaseorder-method-mixin": true
            }
        }
    }
};
1
  • Thanks for the suggestion. I will try and get back you
    – Siv
    Jun 17 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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