Hello I wish to remove shipping tax from the quote programmatically under specific condition.So please give me idea how to remove it.

  • Are you asking how to prevent the 'Shipping & Tax' from displaying? Or, are you trying to modify the final price? May 18, 2015 at 17:36
  • To modify the final price May 19, 2015 at 4:25

2 Answers 2


If you wish to simply remove the 'Estimate Shipping and Tax' block dynamically, then you can do so from


Find the line of code which looks like

<?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>

and replace it with something like

<?php if (!$this->getIsVirtual() && $conditionIsTrue):
    echo $this->getChildHtml('shipping');
endif; ?>
  • I mean to change the shipping amount on checkout May 19, 2015 at 4:25

Hi i have made custom module & use below event to remove the shipping rate from grand total

    <sales_quote_address_collect_totals_after > 
             <observers >
                  <kinex_order >
                       <class > < kinex_order > <class> / observer>
                       <method > setShippingCost </method>
                   </kinex_order >

         </sales_quote_address_collect_totals_after >
public function setShippingCost(Varien_Event_Observer $observer){

     //echo $address->removeAllShippingRates();
        // exit;

      $samount=  $address->getShippingAmount();
     $gt= $address->getGrandTotal();



  • This removes shipping cost from everything, with no conditional logic as per the OP's question. May 18, 2015 at 18:54
  • Using template file only block the shipping at frontend level but in quote object shipping will be added
    – Sourav
    May 19, 2015 at 3:35
  • What If I want to change the amount? May 19, 2015 at 4:24

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.