Have problem with my custom module to show custom items to totals. When place order the error show up:

The address total model should be extended from Mage_Sales_Model_Quote_Address_Total_Abstract.

I already try clear magento cache from dashboard, empty var/cache folder, reindexing from dashboad, run compilation proccess, check folder and files permissions and last try reinstall Magento with fresh core files. Also try extension on different install of Magento. And nothing helps.

This is my Quote Adress model:


 class Devpassion_Rowtotal_Model_Quote_Address_Total_Totalpopust extends       Mage_Sales_Model_Quote_Address_Total_Abstract {

public function collect(Mage_Sales_Model_Quote_Address $address)

    $order = $address->getOrder();
    $items = $address->getAllItems();

    $subtotaldisc = 0;
    foreach ($items as $item){
            $subtotaldisc += $item->getRowTotal() + $item->getTaxAmount() + $item->getHiddenTaxAmount() - $item->getDiscountAmount();  

    $result = 10 ;

    // Store it to address, used for fetch method

    return $this;


public function fetch(Mage_Sales_Model_Quote_Address $address)

        // got $result before using it
        $result = $address->getRowtotalResult();
   // End

        if ($result != 0) {
                'code'  => $this->getCode(),
                'title' => 'Cijena sa popustom',
                'value' => $result

    return $this;



And this is my Block class:


 class Devpassion_Rowtotal_Block_Sales_Total_Totalpopust
   extends Mage_Core_Block_Abstract
     public function initTotals()

   $parent = $this->getParentBlock();

   $value = $parent->getSource()->getRowtotalResult();    

   $test = 10 ;

   if ($value > 0)
        $this->getParentBlock()->addTotal(new Varien_Object(array(
        'code'  => 'rowtotal',
        'value' =>  $value,
        'label' => 'Cijena sa popustom blabla',
        'field' => 'totalpopust'




And my config.xml

<?xml version="1.0"?>
                    <before></before><!-- calculate before these total models -->
                    <after></after><!-- calculate after these total models -->


          <totalpdf translate="title">
            <title>Ukupno s popustom</title>



  • I got same error when I used wrong class name Namespace_Modulename_Quote_Address_Total_Myclass instead of Namespace_Modulename_Model_Quote_Address_Total_Myclass – Mukesh Sep 11 '19 at 12:54

As you can see, you extend your Model from the required class.

There are three options:

  1. You made something wrong
  2. Magento checks something different and outputs a wrong error message
  3. This is not the source of the error

Case 1: Obviously you extended the correct class - I think you made everything correct.

Case 2: Let's see where this error is thrown. I find only one occurrence of the error message, here:

if (!$model instanceof Mage_Sales_Model_Quote_Address_Total_Abstract) {
        Mage::helper('sales')->__('The address total model should be extended from Mage_Sales_Model_Quote_Address_Total_Abstract.')

So magento checks, what it should check.

I think it is case 3: You don't have the source of the error. Turn on xdebug (or var_dump()) and check what $model is, when this error occurs.

| improve this answer | |
  • thanks Fabian for advices I resloved error. Now I can see row with label and correct value on cart overview and also on checkout, which is read it from my Qoute address class. But value on Customers order view is still zero. So obviously is something wrong with my Block class? Btw. I can see row with label on order view, which is read it from that Block class. – srdan Aug 18 '13 at 14:37
  • I'm not in it and don't have the time at the moment to dig into it. No idea, sorry. – Fabian Blechschmidt Aug 19 '13 at 7:34

I had the exact same problem.

Thanks to @fabian and his great answer, i dumped the content of $model and saw that it was [module]_Sales_Model_Quote_Address_Total_Nominal which had no sense at all since i was overriding the [module]_Sales_Model_Quote_Address_Total_Shipping.

Then i saw my mistake : the file i created was shipping.php instead of Shipping.php with a capital S.

Hope that'll help :).

| improve this answer | |

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.