Magento 如何使用多个地址获取上次购买的id?

Magento 如何使用多个地址获取上次购买的id?,magento,payment-gateway,payment,Magento,Payment Gateway,Payment,我有一个付款方式,需要重定向到页面,就像贝宝一样,我可以在成功页面上添加一个代码块,但需要知道刚刚完成的petido是不是用我的付款方式支付的,所以我可以重定向 注意:一些人说,不可能通过多配送重新定向付款 我只想获取当前购买的多芯片应用程序的id 我是这样想的,但这不是我想要的: $fromDate = date('Y-m-d') . ' 0:0:0'; $toDate = date('Y-m-d H:i:s'); $orderCollection = Mage::getModel('sale

我有一个付款方式,需要重定向到页面,就像贝宝一样,我可以在成功页面上添加一个代码块,但需要知道刚刚完成的petido是不是用我的付款方式支付的,所以我可以重定向

注意:一些人说,不可能通过多配送重新定向付款

我只想获取当前购买的多芯片应用程序的id

我是这样想的,但这不是我想要的:

$fromDate = date('Y-m-d') . ' 0:0:0';
$toDate = date('Y-m-d H:i:s');
$orderCollection = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('customer_id', array('eq' => array(Mage::getSingleton('customer/session')->getCustomer()->getId())));
$orderCollection = $orderCollection->addAttributeToFilter('created_at', array('from'=>$fromDate, 'to'=>$toDate));
foreach($orderCollection as $order_row){
解决方案:

$last_quote_id = Mage::getSingleton('checkout/session')->getLastQuoteId();
$orderCollection = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('customer_id', array('eq' => array(Mage::getSingleton('customer/session')->getCustomer()->getId())));
$orderCollection = $orderCollection->addFilter('quote_id', $last_quote_id);
foreach($orderCollection as $order_row){
    if($order_row->getPayment()->getMethodInstance()->getTitle() == 'PagSeguro'){ $pagseguro = 1; }
    echo $order_row->getId() . ' - ' . $order_row->getPayment()->getMethodInstance()->getTitle() . '<br />';    
} 
$last\u quote\u id=Mage::getSingleton('checkout/session')->getLastQuoteId();
$orderCollection=Mage::getModel('sales/order')->getCollection()
->addFieldToFilter('customer_id',array('eq'=>array(Mage::getSingleton('customer/session')->getCustomer()->getId());
$orderCollection=$orderCollection->addFilter('quote\u id',$last\u quote\u id);
foreach($orderCollection作为$order\u行){
如果($order_row->getPayment()->getMethodInstance()->getTitle()=='PagSeguro'){$PagSeguro=1;}
echo$order\u row->getId().-'.$order\u row->getPayment()->getMethodInstance()->getTitle()。
; }