0
我想按購物車順序顯示商品。但我無法找到設置報價項目集合的代碼。Magento:如何在購物車中按照添加順序顯示商品
我的購物車phtml文件我使用的是 $ allItems = $ session-> getQuote() - > getAllItems();
獲取所有項目。
我如何分揀物品?
我想按購物車順序顯示商品。但我無法找到設置報價項目集合的代碼。Magento:如何在購物車中按照添加順序顯示商品
我的購物車phtml文件我使用的是 $ allItems = $ session-> getQuote() - > getAllItems();
獲取所有項目。
我如何分揀物品?
我發現 把setOrder('updated_at','desc')
在app /代碼/核心/法師/銷售/型號/ Quote.php 文件getItemsCollection功能排序的集合解決方案。
public function getItemsCollection($useCache = true)
{
if (is_null($this->_items)) {
$this->_items = Mage::getModel('sales/quote_item')->getCollection()**->setOrder('updated_at','desc');**
$this->_items->setQuote($this);
}
return $this->_items;
}