Skip to content

Instantly share code, notes, and snippets.

@tegansnyder
Last active January 20, 2017 20:29
Show Gist options
  • Save tegansnyder/4454566 to your computer and use it in GitHub Desktop.
Save tegansnyder/4454566 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