I want to hide shipping method when user is not logged in in checkout page.

After selecting the city shipping methods to be shown in checkout page.

So, Is there any solution for this I have try this code :

if (!customer.isLoggedIn()) {

But its not working as i want. when I put this code in my shipping.js file near about line no 123-124 inside initialize function it hides whole form includes registration form and shipping method, So I need to hide only the shipping method



You can also hide shipping method with shipping.html

Override shipping.html in your module


Now Add <!-- ko if: (isCustomerLoggedIn) --> before shipping method <li> tag and end <!-- /ko --> after </li> to check customer is loggedIn or not.


<!-- ko if: (isCustomerLoggedIn) -->
<li id="opc-shipping_method"
data-bind="fadeVisible: visible(), blockLoader: isLoading"

<!-- Shipping Methode Html -->

<!-- /ko -->`

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.