2

For testing purpose, we have modified the core file post-code.js which is in the path /vendor/Magento/module-ui/view/base/web/js/form/element and see it's working fine. So we have decided to override the file post-code.js.

For overriding, we have followed the below steps:

  1. Created and copied the files on

app/design/frontend/[VendorName]/[theme]/module-ui/web/js/form/element

  1. Run the below commands

    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy -f
    

But it's not working as expected.

Could anyone please tell me how to override the "post-code.js"?

asked Apr 23, 2019 at 13:04
0

2 Answers 2

1

Try this,

You must rename your module-ui to Magento_Ui

Copy the file from below path

vendor/magento/module-ui/view/base/web/js/form/element/post-code.js

to

app/design/frontend/{Vendor}/{theme-name}/Magento_Ui/web/js/form/element/post-code.js

then run the below commands.

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

Hope this helps.

answered Apr 23, 2019 at 13:16
2
  • Thanks. Could you please explain why we need to change the module name from module-ui to Magento_Ui? Commented Apr 24, 2019 at 12:15
  • It is your module name will reside in registration.php inside module-ui module, that should be placed there Commented Apr 24, 2019 at 13:16
1

Rename module name

 module-ui

to

 Magento_Ui
answered Apr 23, 2019 at 13:41
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.