Set a fixed price when a subscription is created

By default, when Subscribe Pro places a reorder back to Magento for a subscription, the price is calculated at that time based on the current price set in the store, including any special price rules and discounts. As of version, our Subscribe Pro extension now allows a fixed price field to be set for subscriptions, so that new orders will use that price instead of the price set in Magento.

This price will need to be set by adding some custom code to hook onto the sfc_autoship_before_create_subscription_from_quote_item event.




public function onBeforeCreateSubscriptionFromQuoteItem(Varien_Event_Observer $obs)
    // Get data from $observer
    /** @var SFC_Autoship_Model_Subscription $subscription */
    $subscription = $observer->getData('subscription');
    /** @var Mage_Sales_Model_Quote_Item $quoteItem */
    $quoteItem = $observer->getData('quote_item');
    // Set date on subscription
    $subscription->setData('use_fixed_price', 1);
    $subscription->setData('fixed_price', $quoteItem->getPrice());