<h2 class="subtitle">Top <span>Sellers</span></h2>

<?php $visibility = array(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG); $_productCollection = Mage::getResourceModel('reports/product_collection') ->addAttributeToSelect('*')
	->addOrderedQty()
	->addAttributeToFilter('visibility', $visibility)
	->setOrder('ordered_qty', 'desc');
?>

<ul id="topSeller" class="owl-carousel owl-theme products-grid products-grid--max-5-col">
<?php foreach($_productCollection as $product) { $model = Mage::getModel('catalog/product'); $product_id = $product->getId();
	        $product = $model->load($product_id);
	        //echo $product->getPrice()."";
	        //echo $product->getName()."";
	        $_image=Mage::getModel('catalog/product')->load($product_id);
	        //echo Mage::helper('catalog/image')->init($_image, 'image')."";
	       ?>

<li class="item last"> 
	       		<a href="<?php echo $product->getProductUrl() ?>" title="<?php echo $product->getName(); ?>" class="product-image"> 
	       			<img src="<?php echo Mage::helper('catalog/image')->init($_image, 'image'); ?>" alt="<?php echo $product->getName(); ?>"> 
	       		</a>

<h3 class="product-name">
              		<a href="<?php echo $product->getProductUrl() ?>" title="<?php echo $product->getName(); ?>"><?php echo $product->getName(); ?></a>
              	</h3>


<div class="price-box"> 
              		<span class="regular-price" id="product-price-<?php echo $product->getId(); ?>-new">
              		<span class="price">Price:$ <strong><?php echo $product->getPrice(); ?></strong></span> </span> 
              	</div>


<div class="actions">
	                <button type="button" title="Add to Cart" class="button btn-cart" onclick="setLocation('<?php echo Mage::helper('checkout/cart')->getAddUrl($product,$additional = array()); ?>')"><span><span>Add to Cart</span></span></button>

<ul class="add-to-links">

<li><a href="<?php echo $product->getProductUrl() ?>" class="details">Details</a></li>

	                </ul>

	            </div>

            </li>

	<?php } ?>
	</ul>

Categories: Extension

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *