Magento 1 Event: Before Subscription Reorder Place
Event Code: subscribepro_autoship_before_subscription_reorder_place
Overview
The subscribepro_autoship_before_subscription_reorder_place
event is dispatched just before the Subscribe Pro extension creates a re-order for an existing subscription. This allows the chance to modify the quote / cart before the re-order is created.
Parameters
Name | Type | Description |
---|---|---|
quote_id | int | The quote_id parameter holds the unique ID of the quote record in the Magento database. |
quote | Mage_Sales_Model_Quote | The quote parameter holds a reference to the Magento quote data structure. The quote already has products, customer information, shipping information and payment information attached to it. |
Example
config.xml
<config>
<global>
<events>
<subscribepro_autoship_before_subscription_reorder_place>
<observers>
<my_module_subscribepro_autoship_before_subscription_reorder_place>
<class>my_module/observer</class>
<method>onBeforeSubscriptionReorderPlace</method>
</my_module_subscribepro_autoship_before_subscription_reorder_place>
</observers>
</subscribepro_autoship_before_subscription_reorder_place>
</events>
</global>
</config>
Observer.php
public function onBeforeSubscriptionReorderPlace(Varien_Event_Observer $observer)
{
// Get data from $observer
$quoteId = $observer->getData('quote_id');
/** @var Mage_Sales_Model_Quote $quote */
$quote = $observer->getData('quote');
// Change stuff about quote
// Change shipping method
$quote->getShippingAddress()->setShippingMethod('freeshipping_freeshipping');
}