0

Using Magento 1.9.2.2

I want to change Sub Total Label(Just label) everywhere...

I found that it's coming from

app/design/frontend/base/default/template/tax/checkout/subtotal.phtml

From this line

<td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
    <?php echo $this->getTotal()->getTitle() ?>
</td>

I've checked

app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php
app/code/core/Mage/Sales/Block/Order/Totals.php

But not coming from both above files... so from where it can be coming?

  • have you check Mage_Sales_Block_Order_Totals::_initTotals() ; $this->_totals['subtotal'] = new Varien_Object(array( 'code' => 'subtotal', 'value' => $source->getSubtotal(), 'label' => $this->__('Subtotal') )); – Vaibhav Ahalpara Oct 25 '16 at 9:59
  • app/code/core/Mage/Sales/Block/Order/Totals.php – Pawankumar Oct 25 '16 at 9:59
  • Let me check both – Kaushal Suthar Oct 25 '16 at 10:03
  • You can also use Translate inline to change lable. it will be easy way. – Kul Oct 25 '16 at 10:04
  • No it's not coming from app/code/core/Mage/Sales/Block/Order/Totals.php and also from protected function _initTotals() – Kaushal Suthar Oct 25 '16 at 10:05
0

I'm trying to solve very similar question for Mage 1.9.

How exactly did you overridden Mage_Checkout_Block_Cart_Totals? Did you have to change config.xml? In what way?

My Magento refuse to let me override, it simply ignores my changes.

0

I know this point is a little old but i recently had to solve this problem.

The easiest solution for my needs was to rewrite the

Mage_Checkout_Block_Cart_Totals class and override the renderTotals function.

Path of File:

app\code\core\Mage\Checkout\Block\Cart\Totals.php

Override To:

app\code\local\Mage\Checkout\Block\Cart\Totals.php

It ended up looking something like this:

public function renderTotals($area = null, $colspan = 1)
{
    return $this->_replaceLabels(parent::renderTotals($area, $colspan));
}

protected function _replaceLabels($html){
    $labelMap = array();
    $labelMap['Subtotal'] = "Product Total";
    $labelMap['Grand Total'] = "Order Total";
    $labelMap["Shipping & Handling"] = "Shipping";

    foreach($labelMap as $key => $value){
        $html = str_replace($key, $value,$html) ;
    }
    return $html;
}

Hope this helps!

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.