Magentoサイトで作業しています(Magento ver。1.5.1.0) - 答える際に注意してください。私はMagentoを初めて使用しています。 ベストセラーでソートするオプションを取得しようとしていますが、ローカルファイルを追加してコアファイルをオーバーライドして、次のように処理しました。Magentoベストセラーが動作しない - 修復または回避策を探す
httpdocs/app/code/local/Mage/Catalog/Block/Product /一覧/ Toolbar.php:
public function getAvailableOrders()
{
//return $this->_availableOrder;
//Custom Order list Edit
$this->_availableOrder = array(
'qty_ordered' => $this->__('Best Sellers'),
'entity_id' => $this->__('Latest arrivals'),
'name' => $this->__('Name'),
'price' => $this->__('Price')
);
//Custom Available Order -Edit finish
return $this->_availableOrder;
}
とをhttpdocs /アプリ/設計/フロントエンド/デフォルト/ localsite /テンプレート/カタログ/製品/リスト/ toolbar.phmtl:
<fieldset class="sort-by">
<label><?php echo $this->__('Sort by') ?></label>
<select onchange="setLocation(this.value)">
<option value="<?php echo $this->getOrderUrl('entity_id', 'desc') ?>"<?php if($this->isOrderCurrent('entity_id') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>
Newest Products
</option>
<option value="<?php echo $this->getOrderUrl('qty_ordered', 'desc') ?>"<?php if($this->isOrderCurrent('qty_ordered') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>
Best Sellers
</option>
<option value="<?php echo $this->getOrderUrl('price', 'asc') ?>"<?php if($this->isOrderCurrent('price') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>>
Lowest Price
</option>
<option value="<?php echo $this->getOrderUrl('price', 'desc') ?>"<?php if($this->isOrderCurrent('price') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>
Highest Price
</option>
<option value="<?php echo $this->getOrderUrl('name', 'asc') ?>"<?php if($this->isOrderCurrent('name') && $this->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>>
Name A-Z
</option>
<option value="<?php echo $this->getOrderUrl('name', 'desc') ?>"<?php if($this->isOrderCurrent('name') && $this->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>
Name Z-A
</option>
</select>
</fieldset>
これはある意味で働きます私は今ベストセラーと同じ方法で並べ替えるベストセラーソートオプションを持っていますダッシュボードで残念ながら、ダッシュボードのベストセラーセクションと結果として私の並べ替えリストは完全に間違っています。
誰もが同じ結果を達成するために並べ替えることができる別の属性を知っている人はいませんか? - ダッシュボード>レポート>製品>注文された商品に行くと、ソートのオプションでこれを再現することができます。
利用可能なソートオプションのリストはありますか?
** * ** * ** * ** * ** * ***UPDATE* ** * ** * ** * ** * ** * ***
私は今、ベストセラーに掲載されている製品がすべて古い製品であることに気付きました。最近追加された製品は、ベストセラーリストには含まれていません。これらの同じ製品は、ダッシュボードでZにソートするか、上記のソートオプションを使用して新しい製品AからZ、それに古い製品AからZが続くように並べても、別々にリストされます。
ヒント、アドバイス、お手伝いをします。
@Josh Caswellこの問題に興味をお持ちいただきありがとうございます。返信が遅いのでご迷惑をおかけして申し訳ありません。あなたのご意見に応じて質問を更新しました。うまくいけば、この新しい情報が役立ちます。 – WebweaverD