Forked from tegansnyder/GetLastRecurringOrderID.php
Created
January 20, 2017 20:29
-
-
Save elisei/278a4382ffc77c853105c4cf63b9a959 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$last_recurring_profile_id = $_SESSION['checkout']['last_recurring_profile_ids'][0]; | |
$customer_id = Mage::getSingleton('customer/session')->getCustomerId(); | |
$order = Mage::getResourceModel('sales/order_collection') | |
->addFieldToFilter('customer_id', $customer_id) | |
->addRecurringProfilesFilter($last_recurring_profile_id) | |
->setOrder('entity_id', 'desc') | |
->getFirstItem(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment