I am Creating New Shipping Method In magento and follow below tutorial. http://inchoo.net/magento/custom-shipping-method-in-magento/

But it display Shipping method on Checkout/cart page also.

I want to display my custom shipping method only on Onepage Checkout.

I am using Magento

Anybody Can tell me how can i do that ??


2 Answers 2


1) If you want to hide shipping Method Block from Cart page you can edit checkout.xml layout file, you can find that file in frontend/your_package/your_theme/layout/checkout.xml, then look for the

<checkout_cart_index translate="label">

tag and remove or comment the following line within reference name content

<block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>

2) You can hide specific shipping method on magento cart by editing cart's shipping.phtml. It's located in frontend/your_package/your_theme/template/checkout/cart/shipping.phtml

Find the following lines:

<?php if (($_shippingRateGroups = $this->getEstimateRates())): ?>
<form id="co-shipping-method-form" action="<?php echo $this->getUrl('checkout/cart/estimateUpdatePost') ?>" class="co-shipping-method-form">
    <dl class="sp-methods">
        <?php foreach ($_shippingRateGroups as $code => $_rates): ?>

and add some code after the second foreach to skip shipping method you want

<?php if ($code == 'your_shipping_method_code') continue; ?>

p.s. If files located in base package default theme, make sure to copy that file to your package theme first.

  • 1
    Thanks for Posting such a good Solutions. I tested both of your solutions. Works Really very well.
    – vijay rami
    Commented Sep 9, 2016 at 17:47

You can also hide the shipping method from cart page by using the style sheet.

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.