Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elisei/278a4382ffc77c853105c4cf63b9a959 to your computer and use it in GitHub Desktop.
Save elisei/278a4382ffc77c853105c4cf63b9a959 to your computer and use it in GitHub Desktop.
<?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