2

I see that the totals on PDF invoices, and on credit memo are pulled from one same abstract.php

Can I somehow make different totals on credit memo than on invoice? is there a way to make a copy of abstract.php only for credit memos?

I need to display some negative valuues in front of totals on my credit memo, so thats why I need this.

1

Although I don't know exactly which classes you are referring to Abstract.php is likely not called directly but extended from a different class. If that's the case I suggest you rewrite the class that is extending Abstract and overwrite the method that is in abstract.

So let's say you have the abstract class

class Mage_Sales_Model_Abstract
{
   public function getTotals()
   {
      [...]
      here the totals come from
      [...]
   }
}

and the credit class

class Mage_Sales_Model_Creditmemo extends Mage_Sales_Model_Abstract
{
   [...]
   the credit memo methods
   [...]           
}

You will need to rewrite the Mage_Sales_Model_Creditmemo class with your own extension. It would look something like this

class [Namespace]_[Module]_Model_Creditmemo extends Mage_Sales_Model_Creditmemo
{
   public function getTotals()
   {
      [...]
      Here is your edited totals function
      [...]
   }
}

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.