Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recurring Profile and Bundled Item

I have a subscription service that people pay monthly for, so I’ve setup a “Virtual Product” with a Recurring Profile. At the same time, I want to have it so they can add different one time products. To accomplish this I’ve tried creating a “Bundled Product” with all the different one time products and adding the “Virtual Product” to that “Bundled Product”.

However, when I go to checkout it says “Nominal item can be purchased standalone only. To proceed please remove other items from the quote.” How do I allow people to subscribe to the service and purchase the products at the same time?

Note: I am using Paypal Website Payment Pro as my merchant account.

like image 953
J Lee Avatar asked Jul 23 '10 17:07

J Lee


2 Answers

Here's the comment from Magento code:

/** * Temporary workaround for purchase process: it is too dangerous to purchase more than one nominal item * or a mixture of nominal and non-nominal items, although technically possible. * * The problem is that currently it is implemented as sequential submission of nominal items and order, by one click. * It makes logically impossible to make the process of the purchase failsafe. * Proper solution is to submit items one by one with customer confirmation each time. */

Actually you can remove the code below:

if ($item->isNominal() && $this->hasItems() || $this->hasNominalItems()) {
    Mage::throwException(Mage::helper('sales')->__('Nominal item can be purchased standalone only. To proceed please remove other items from the quote.'));
}

Magento still handles multiple nominal products, however, you use that with your own risk.

like image 142
Tuong Le Avatar answered Nov 16 '22 22:11

Tuong Le


Unfortunately this is a hardcoded restriction in the Mage_Paypal code.

You can see in Mage_Sales_Model_Service_Quote::submitAll() that it executes submitNominalItems() which contains:

    $this->_validate();
    $this->_submitRecurringPaymentProfiles();
    $this->_inactivateQuote();
    $this->_deleteNominalItems(); 

So, it kills the Cart after submitting nominal items. I'm not exactly sure why it does that, but I assume it's due to the way that subscriptions are created at Paypal.

Here is the code that prevents adding items to a cart that contains nominals in Mage_Sales_Model_Quote::addItem():

    if ($item->isNominal() && $this->hasItems() || $this->hasNominalItems()) {
        Mage::throwException(Mage::helper('sales')->__('Nominal item can be purchased standalone only. To proceed please remove other items from the quote.'));
    }

I'm working on using Magento's Recurring Profiles for other payment providers at the moment (its a background task: Magento Recurring Profiles with non-Paypal payment method) and it is possible to checkout both nominal (aka subscription) and real products at the same time, but it does make it quite a bit more complex.

If this is a big deal, it should be possible to refactor the Mage_Paypal code to do this, but it's a complicated task that can't really be answered in a single post.

like image 42
Jonathan Day Avatar answered Nov 16 '22 23:11

Jonathan Day