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;
}