Considering the available CMS’s for eCommerce, Magento has still remained as the first pick for store owner whether it is small or large scale. Due to its flexible architecture, it allows us to customize the Magento according to our Business needs by extending the Native code. Magento backend is one of the fully powerful dashboards that enables store owner to manage everything without having knowledge of code. This Backend is made up of various configuration & attributes that determine how an attribute can be used in the frontend, it may be appearance, behavior or any operation. Even some of the backend attributes help store owner setting up customer convenience or guide them by placing notes in frontend.
Several times, it happens that having multiple payment or shipping method may confuse your customer at that time placing useful instructions using backend configuration helps a lot but you can only place textual instruction that means you cannot style text or place link. So at that time, you required to place HTML tags to add a link in the description.
So here is the small piece of code using which you can add HTML tags in backend attributes.
By default, Magento escapeHtml that renders the instructions for the payment methods. For that, we need to create a small extension that will override the getInstructions function.
Firstly, create “registration.php” file inside your extension folder using below code.

App\code\Vendor\Extension\registration.php

After that we need to create one more “Module.xml” file at this path.
App\code\Vendor\Extension\etc\module.xml

Now, we need to create “di.xml” file inside our extension frontend folder.
App\code\Vendor\Extension\etc\frontend\di.xml

In this final step, we need to create “InstructionsConfigProvider.php” at this path.
App\code\Vendor\Extension\Model\Rewrite\InstructionsConfigProvider.php

That’s it you are done! You have successfully enable html tags in backend attributes. So, whenever you add any html tags it will automatically converted to hyperlink or respective format.

Let us know if you are facing an issue while implementing using this code by commenting below.

Happy Coding!

Click to rate this post!
[Total: 5 Average: 5]