I want to show custom message under shipping method section.

when address changes message also change/remove.

enter image description here

for example: When custom select Columbia addess I want to show custom notice/message

again when select india address message will be removed.

Can Any one please guide me which js and html I Need to work.

Note:: You can guide on vendor files changes I will manage override.

2 Answers 2


The template you are looking for:


The file with JS you are looking for:


Take a look at getCountryName(address().countryId) in the template. I guess you can use this to determine which country is set for selected address by customer.

Hope this helps!


You can initialize component from checkout_index_index.xml or script from calling in the phtml

<script type="text/x-magento-init">
            "*": {
                "VL_Checkout/js/customComponent": {
                    "ajaxUrl" : "<?= $block->getAjaxUrl(); ?>"

you can now create a customComponent.js as below

    function($, ko, Component, checkoutData ,quote , messageList) {
        'use strict';

        return Component.extend({
            initialize: function() {
                self = this;
                quote.shippingAddress.subscribe(function (value) {
                    // add you logic and compair the address.
                            messageList.addErrorMessage({ message: "you custom Message" });

Now you can subscribe to the address changes and add your own code there for providing user message you can use the messageList and provide your message.

Your Answer

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

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