3

My question is really the title. But here are the details we have behind the question.

Shopping cart has a configured subscription item in the cart and the cart subtotal is >= $50, gets free shipping Shopping cart has a configured subscription item in the cart and the cart subtotal is >= $150, gets free shipping and 10% off the entire cart contents.

This I have programmed and working, however, I need these same rules applied to that recurring item when the recurrence happens.

The programming is done in the cart controller the first time through but will the cart controller run when this recurrence takes place and it is made into an order? If not how do I get it to work?

0
2

Jamie,

You are touching very silly part of Magento checkout, those are recurring payments. Magento has two types of totals calculation in the system:

  1. Normal Flow

    All the regular total collectors within Magento use getAllNonNominalItems() method in order to retrieve address items. Only during this flow Magento has Discount total, that is responsible for applying a shopping cart price rule.

  2. Recurring Payments Flow

    This flow is driven my separate totals collector model Mage_Sales_Model_Quote_Address_Total_Nominal_Collector, and all its total collectors defined in global/sales/quote/nominal_totals. If you take a look into xml config, you'll see there are only few totals:

    <nominal_totals>
        <recurring_initial_fee>
            <class>sales/quote_address_total_nominal_recurring_initial</class>
            <sort_order>10</sort_order>
        </recurring_initial_fee>
        <recurring_trial_payment>
            <class>sales/quote_address_total_nominal_recurring_trial</class>
            <sort_order>50</sort_order>
        </recurring_trial_payment>
        <nominal_subtotal>
            <class>sales/quote_address_total_nominal_subtotal</class>
            <sort_order>250</sort_order>
        </nominal_subtotal>
        <nominal_shipping>
            <class>sales/quote_address_total_nominal_shipping</class>
            <sort_order>1250</sort_order>
        </nominal_shipping>
    </nominal_totals>
    

So, to keep this one short: No, you cannot apply a shopping cart rule to a recurring item by default in Magento. Of course you can create your own subtotal within nominal ones, but there a lot of unexplored issues you can run into, by trying to make it happen.

Also it is very important to mention, that recurring profile products have separate pricing logic.

1

To Display Total Amount in Nominal Products Follow code listed Below :

In Cart.php Change This Code :

<?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>

to

<?php
    $quote = Mage::getSingleton('checkout/session')->getQuote();
$items = $quote->getAllItems();
//print_r($items);
foreach ($items as $item) {
$price = $item->getRowTotal();
}
echo Mage::helper('checkout')->formatPrice($price);
?>
1
  • <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?> to <?php $quote = Mage::getSingleton('checkout/session')->getQuote(); $items = $quote->getAllItems(); //print_r($items); foreach ($items as $item) { $price = $item->getRowTotal(); } echo Mage::helper('checkout')->formatPrice($price); ?> This Code isw working for me try it... Sandeep Kumar
    – sandeep
    Nov 5 '15 at 16:36

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.