0

How to done a error message under shipping method in magento 2

like this..

enter image description here

1

In Back-end, there is one option available to show error message. You just need to enable this setting there "Show Method if Not Applicable".

enter image description here

enter image description here

You do not need to add any custom code. Just follow "Bank Transfer" or any other default Magento Shipping method modules and you can add that functionality for your custom shipping methods as well.

You need to check this file

vendor/magento/module-checkout/view/frontend/web/template/shipping-address/shipping-method-item.html

There is Magento showing that error message.

Hope this will help you!

  • Let me know if it helps. Thanks. :) – Kishan Savaliya Dec 5 '19 at 4:51
  • Sir, i want to know is any other way to show a dynamic custom message(except config message) under shipping method. i want to show my custom module message prnt.sc/q6ew95 – divya sekar Dec 5 '19 at 5:05
  • You can check this file for reference vendor/magento/module-offline-shipping/Model/Carrier/Freeshipping.php and find setErrorMessage in that file so you will get idea how you can add custom error message there. Let me know if you need any help then.. – Kishan Savaliya Dec 5 '19 at 5:41
  • You got any solution here ? – Kishan Savaliya Dec 5 '19 at 9:52
  • 1
    i want to get a message from backend prnt.sc/q6ew95 – divya sekar Dec 5 '19 at 10:19

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.