I am using Magento

I need customization like, Shipping cost should not show in the Cart page, but shown in the Checkout page.

Is possible to make like Shipping cost should be calculated only in checkout page, not in the Cart page even user logged in.

2 Answers 2


You can use the following code somewhere when cart loads:


Hope this helps!

  • Thanks for your reply @sukumar. I have added thid code in template/checkout/cart.phtml. But It is not working. May 22, 2018 at 9:20
  • Try to reload the page again. You need to call that code before page renders. May 22, 2018 at 9:22
  • Shall i call in the checkout/cart action? May 22, 2018 at 9:25
  • I used this solution, magento.stackexchange.com/questions/203474/…. It worked in checkout_cart_save_before event. May 22, 2018 at 9:32
  • Great!. You can use both code for unset shipping method. May 22, 2018 at 9:35

I Created a event with observer. Here is the Code:


Observer function setFreeShipping Code:

public function setFreeShipping($observer) {
    $event = $observer->getEvent();
    $cart = $event->getCart();
    $shippingaddress = $cart->getQuote()->getShippingAddress();

Reference and credits: link

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.