Magento 2: How to Change shipping message?
You need to override shipping.html in your theme from vendor/magento/module-checkout/view/frontend/web/template/shipping.html
.
With Custom Theme:
Copy vendor shipping.html file to your custom theme at app/design/frontend/Vendor/theme/Magento_Checkout/web/template/shipping.html
Note: Make sure you first delete static shipping.html from pub/static
from pub/static/frontend/Vendor/theme/en_US/Magento_Checkout/template/shipping.html
Now change text at last no-quotes-block
div to your custom message
<div class="no-quotes-block"><!-- ko i18n: 'Default Shipping Message Changed......'--><!-- /ko --></div>
Now flush cache and try.
OR With Custom Module:
Copy vendor shipping.html file to your custom module at app/code/Vendor/Module/view/frontend/web/template/shipping.html
Now add requirejs-config.js at app/code/Vendor/Theme/view/frontend/requirejs-config.js
var config = {
map: {
'*': {
'Magento_Checkout/template/shipping.html':
'Vendor_Module/template/shipping.html'
}
}
};
Note: Make sure you first delete static shipping.html from pub/static
from pub/static/frontend/vendor/module/en_US/Magento_Checkout/template/shipping.html
Now flush cache and try.
OUTPUT:
As far as I can see this sentence appears in two places:
vendor/magento/module-checkout/view/frontend/web/template/shipping.html
and
vendor/magento/module-checkout/view/frontend/web/template/cart/shipping-rates.html
Said that and depending on what you want to achieve you could:
Overwrite those files in your theme
By placing your own content in
app/design/frontend/{vendor}/{theme}/Magento_Checkout/web/template/cart/shipping.html
and
app/design/frontend/{vendor}/{theme}/Magento_Checkout/web/template/cart/shipping-rates.html
Overwrite those files in your extension
Create a requirejs-config.js in your extension
app/code/Namespace/Mudule/view/frontend/requirejs-config.js
and place the following content
var config = {
map: {
'*': {
'Magento_Checkout/template/cart/shipping-rates.html':
'Namespace_Module/template/cart/shipping-rates.html'
}
}
};