【问题标题】:How to get id of last purchase with multiple addresses?如何获取具有多个地址的最后一次购买的 ID?
【发布时间】:2014-06-03 12:21:18
【问题描述】:

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

注意:有几个人说无法通过多重发货重定向付款。

我只想获取当前购买的应用程序的 id 正在 multishipping。

我得到了这个方法,但这并不是我想要的:

$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){

【问题讨论】:

    标签: magento payment-gateway payment


    【解决方案1】:

    解决方案:

    $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 />';    
    } 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-18
      • 2019-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多