PHP Magento Tips

Hide Tax From Grand Total in Customer Shopping Cart in Magento

Rate this posting:
{[['']]}

If you want to hide tax from checkout/cart page, try the following:

First copy app/design/frontend/base/default/template/checkout/cart/totals.phtml to app/design/frontend/yourtheme/default/template/checkout/cart/totals.phtml

If you want to hide tax from checkout/cart page, try the following:

Find the below line:

<?php echo $this->renderTotals(); ?>


and replace with this:

<?php
      $rendertot = $this->renderTotals();
      $rendertot_tr = explode('</tr>', $rendertot);
          
      foreach($rendertot_tr as $trkey => $trval) {
         if( strpos($trval, __('Tax')) ) {
             unset($rendertot_tr[$trkey]);
         }
      }
      $rendertot_tr = implode('</tr>', $rendertot_tr);
      echo $rendertot_tr;
?>

Here, first we explode table row (tr). which gives us array and then find if "Tax" is in array then it will unset its value. after that we again implode and return our desired string.
Tag : Magento
1 Comments On "Hide Tax From Grand Total in Customer Shopping Cart in Magento"

Thanks a lot it works like a charm

Back To Top