如何在magento中获取上次运行的交易ID [英] How to get last running transaction Id in magento

查看:49
本文介绍了如何在magento中获取上次运行的交易ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取上一个正在运行的交易ID? (例如:10000001) 我尝试了很多方法,但都没有成功.

How can I get the last running transaction Id ? (eg: 10000001) I've tried numerous ways, with no success.

推荐答案

当我再次在家看问题时,我突然被开悟了.为什么不从销售/订单集合中获取最后的订单增量ID?

I was suddenly enlightened when I looked at the problem again at home. Why not get the last order increment id from the sales/order collection?

$orders = Mage::getModel('sales/order')->getCollection()
        ->setOrder('increment_id','DESC')
        ->setPageSize(1)
        ->setCurPage(1);

echo $orders->getFirstItem()->getIncrementId();

经过测试并在Magento 1.3.2.3上运行

Tested and working on Magento 1.3.2.3

这篇关于如何在magento中获取上次运行的交易ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆