开发者

Magento Accessing sku's by order id on success.phtml

On the success.phtml template, I need to list t开发者_C百科he sku's from the completed order. How can I iterate through the order and retrieve these values?


you should extend Mage_Checkout_Block_Success

and add the method similar to this:

 public function getOrder()
    {
        return Mage::getModel('sales/order')->load($this->getLastOrderId());
    }

and in your success.phtml template:

$order = $this->getOrder(); 
foreach($order->getAllItems() as $item){
//$item is your product object and you can do what you want with this;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜