I am using Magento CE

I have successfully added a custom payment method with a simple form with one field: custom fee in the admin area. I am storing the value in the info instance additional_data field. I can see this value being saved in the database. However, I want this value to be added to the Totals block at the same time because I will add a new row called "Custom Fee" in this block.

Unfortunately I don't know how to pass the captured value "custom fee" to my Mage_Sales_Model_Quote_Address_Total_Abstract subclass. The fetch() method is not able to get the custom fee value from the Mage_Sales_Model_Quote_Address object:

public function fetch(Mage_Sales_Model_Quote_Address $address) {

  $info = $address->getQuote()->getPayment()->getInfoInstance();
  // $info is null because custom fee has not been persisted

What is the best approach to pass the custom fee value from the form to fetch() in my Mage_Sales_Model_Quote_Address_Total_Abstract subclass?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.