-1
在我的網站中,過濾器顯示價格:Rs 0.00-Rs 1.00。Magento價格過濾器
我需要通過自動獲取最小值來對價格進行排序。
以下是filter.phtml的代碼,請大家幫忙。
if(!function_exists("_displayDropdown")){
function _displayDropdown($atts,$displayitemcount,$new_attributeName){
echo '<select id="layered-select" class="select" name="layered-select" onchange="if (this.selectedIndex > 0) location.href=this[this.selectedIndex].value;">';
echo '<option selected="selected">'.$new_attributeName.'</option>';
foreach ($atts->getItems() as $_item){
echo '<option value="'.$_item->getUrl().'">';
echo $_item->getLabel();
if($displayitemcount){
echo ' ('.$_item->getCount().')';
}
echo '</option>';
}
echo '</select>';
}
}
switch ($attributeName) {
case 'Shoe Size':
case 'Overthreshold':
_displayDropdown($this,$displayitemcount,$new_attributeName);
break;
default:
_displayOrderedlist($this,$displayitemcount);
break;
}
您可以加入一些代碼,你在哪裏有這個問題 –
我在Magento管理面板的後臺更改設置解決這個問題告訴我們。將價格屬性設置爲(Use In Layered Navigation =「yes」。) – Raj