0

I want to add some text below the Country field on checkout page. See below: enter image description here

I followed this answer: https://magento.stackexchange.com/a/240048/2358 It worked perfectly, but only issue with that is I am not able to add HTML content in code.

I have added this code:

$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
        ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['country_id']['notice'] = 'Should you wish for your purchase to be shipped internationally, please <a href="/contact">contact us</a>'; 

But when it outputs HTML element as plain text.

Do anyone know how to resolve this and display HTML content in notice section for form fields on checkout page in Magento 2?

Please help, thanks!

0

Finally I have figured this by myself, I actually had to override /vendor/magento/module-ui/view/frontend/web/templates/form/fields.html this file to get HTML tags working in notice section.

I have written a detailed blog post about this: https://www.backarapper.com/how-to-add-html-tags-in-notice-section-of-checkout-form-fields-in-magento-2/

Hope this will help someone else, who might be looking for the same solution.

| improve this answer | |

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.