0
votes

I just spent a few hours trying to get this simple info: How do I get the total ammout of the customer cart with reccuring profile product in it?

The customer just added a recurring profile product to the cart and already decided which shipping method to use. The customer just clicked in "Place order" and every information right to complete the order. The payment method is this module: http://www.magentocommerce.com/magento-connect/custom-payment-methods-1.html I have changed it a little to support recurring profile products.

The code I'm trying to run is at my class that implements Mage_Payment_Model_Recurring_Profile_MethodInterface at submitRecurringProfile().

How do I get the total value (recurring profile and shipping cost) just before creating the order itself?

This code simple returns '0':

$total = Mage::getSingleton('checkout/session')->getQuote()->getTotals();
1
on which file are you? what checkout system do you use? - Claudiu Creanga
@Claudiu just added more details in the question. Thanks - MatheusJardimB

1 Answers

2
votes

When you look at

interface Mage_Payment_Model_Recurring_Profile_MethodInterface

From

app\code\core\Mage\Payment\Model\Recurring\Profile\MethodInterface.php

method has two argument

  1. Mage_Payment_Model_Recurring_Profile $profile
  2. Mage_Payment_Model_Info $paymentInfo

    public function submitRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile, Mage_Payment_Model_Info $paymentInfo)

{

$trialamount=$profile->getTrialBillingAmount(); // to get trial amount

$billamount=$profile->getBillingAmount(); // to get billing amount

$initialamount= $profile->getInitAmount(); // to get initial amount

$ShippingAmount= $profile->getShippingAmount() // to get shipping amount

$totalprice=$profile->getShippingAmount() + $profile->getBillingAmount(); // to get total price

}