В вашем приложении / design / frontend / {your-interface} / {your-theme} /template/catalog/navigation/left.phtml добавьте следующий код для последних продуктов:
<?php
$_productCollection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setVisibility(array(2,3,4))
->setOrder('created_at', 'desc')
->setPage(1, 5);
?>
<h2>Latest Products</h2>
<ul>
<?php foreach($_productCollection as $_product) : ?>
<li><a href="<?php echo $_product->getProductUrl(); ?>"><?php echo $_product->getName(); ?></a></li>
<?php endforeach; ?>
</ul>
продукты с самым высоким рейтингом немного сложнее.Используйте следующий код:
<?php
$_productCollection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setVisibility(array(2,3,4));
$_productCollection->joinField('rating_summary', 'review/review_aggregate', 'rating_summary', 'entity_pk_value=entity_id', array('entity_type' => 1, 'store_id' => Mage::app()->getStore()->getId()), 'left');
$_productCollection->setOrder('rating_summary', 'desc');
$_productCollection->setPage(1, 5);
?>
<h2>Latest Products</h2>
<ul>
<?php foreach($_productCollection as $_product) : ?>
<li><a href="<?php echo $_product->getProductUrl(); ?>"><?php echo $_product->getName(); ?></a></li>
<?php endforeach; ?>
</ul>
Не уверен, что вы имели в виду под лучшими продуктами, но если бестселлеры, вот код для этого:
<?php
$_productCollection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setVisibility(array(2,3,4));
$select = $_productCollection->getSelect();
$sqlSelectColumns = $select->getPart('columns');
$sqlSelectColumns[] = array(
'',
new Zend_Db_Expr('(
SELECT SUM(order_item.qty_invoiced - order_item.qty_refunded)
FROM ' . Mage::getSingleton('core/resource')->getTableName('sales/order_item') . ' AS order_item
WHERE order_item.product_id = e.entity_id)
'),
'ordered_qty'
);
$select->setPart('columns', $sqlSelectColumns);
$_productCollection->setOrder('ordered_qty', 'desc');
$_productCollection->setPage(1, 5);
?>
<h2>Top Selling Products</h2>
<ul>
<?php foreach($_productCollection as $_product) : ?>
<li><a href="<?php echo $_product->getProductUrl(); ?>"><?php echo $_product->getName(); ?></a></li>
<?php endforeach; ?>
</ul>