我無法在產品列表頁面按價格排序產品。價格不適用於Magento產品列表
按名稱排序工作正常。
任何想法的傢伙?
我搜索了一下,並嘗試了一些解決方案,但他們沒有解決我的問題。
我想:系統 - >緩存管理 - >分層導航Indices->現在刷新
也試過此鏈接:http://www.miromedia.co.uk/blog/300/fixing-the-magento-price-sort-issue.htm
的Magento版本:1.3.2.4
我無法在產品列表頁面按價格排序產品。價格不適用於Magento產品列表
按名稱排序工作正常。
任何想法的傢伙?
我搜索了一下,並嘗試了一些解決方案,但他們沒有解決我的問題。
我想:系統 - >緩存管理 - >分層導航Indices->現在刷新
也試過此鏈接:http://www.miromedia.co.uk/blog/300/fixing-the-magento-price-sort-issue.htm
的Magento版本:1.3.2.4
這個版本的Magento似乎存在某種錯誤,產品目錄索引價格在產品保存時不更新。所以你可以做的就是通過如下所述的價格條件。
更新addAttributeToSort
功能Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
類。
註釋掉下面的代碼: -
// if ($attribute == 'price' && $storeId != 0) {
// $websiteId = Mage::app()->getStore()->getWebsiteId();
// $customerGroup = Mage::getSingleton('customer/session')->getCustomerGroupId();
//
// if ($this->isEnabledFlat()) {
// $priceColumn = 'e.display_price_group_' . $customerGroup;
// $this->getSelect()->order("{$priceColumn} {$dir}");
// }
// else {
// $priceAttributeId = $this->getAttribute('price')->getId();
//
// $entityCondition = '_price_order_table.entity_id = e.entity_id';
// $storeCondition = $this->getConnection()->quoteInto(
// '_price_order_table.website_id = ?',
// $websiteId
// );
// $groupCondition = $this->getConnection()->quoteInto(
// '_price_order_table.customer_group_id = ?',
// $customerGroup
// );
// $attributeCondition = $this->getConnection()->quoteInto(
// '_price_order_table.attribute_id = ?',
// $priceAttributeId
// );
//
// $this->getSelect()->joinLeft(
// array('_price_order_table'=>$this->getTable('catalogindex/price')),
// "{$entityCondition} AND {$storeCondition} AND {$groupCondition} AND {$attributeCondition}",
// array()
// );
// $this->getSelect()->order('_price_order_table.value ' . $dir);
//
// /**
// * Distinct we are using for remove duplicates of products which have
// * several rows in price index (like grouped products)
// */
// $this->getSelect()->distinct(true);
// }
//
// return $this;
// }
可以在比註釋掉的核心代碼Magento的其他標準的方式做到這一點。希望這可以幫助。
您需要在Magento admin中正確配置price屬性。
轉到屬性管理,發現價格屬性,並確保你打勾包裝盒上的「排序在前端」
應該爲您解決問題。
和你的magento版本是? – 2011-03-25 08:12:59