Magento从上一个订单ID获取订单增量ID
<?php
$order = Mage::getModel('sales/order')
->load(Mage::getSingleton('sales/order')->getLastOrderId());
$getLastOrderIncrementId = $order->getIncrementId();
如果以上代码不起作用,请尝试以下操作:
<?php
$order = Mage::getModel('sales/order')
->load(Mage::getSingleton('checkout/session')
->getLastRealOrderId());
$getLastOrderIncrementId = $order->getIncrementId();