I want to remove shipping method from the cart page and checkout page.
I am trying to remove the shipping method from checkout page but seems it's loading from the Knockout.js file.
How can i remove the shipping method from the checkout page or hide it and show my custom message "For shipping Call ME" instead of shipping method.
Also, my store is multi language so message should display in multi language.
Best Answer
Follow below steps:
1) Override
checkout_index_index.xml
in your module and define your own component in shipping step2) Create
custom-shipping.js
app/code/Vendor/CheckoutStep/view/frontend/js/view/custom-shipping.js
and define your own shipping template3) Copy shipping.html
From
To
Remove html code inside form(id="co-shipping-method-form") except actions-toolbar as it use for continue button. So your shipping.html file will be
4) Shipping method block removed from the checkout step with the above 3 steps. Now, We must need to assign one specific shipping method because Magento must need to assign one specific shipping method.
Now use mixin for 'Magento_Checkout/js/model/checkout-data-resolver.js' to override
resolveShippingRates
function.Assign shipping method by passing
ratesData[0]
inselectShippingMethodAction()
So overridden
resolveShippingRates
function should look like this:we can auto assign shipping method like
ratesData[0]
,ratesData[1]
,ratesData[2]
as per our requirement