<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>
Extension
Magento:: free gift product module
app/code/community/Techievolve/Freeproduct/etc/config.xml app/code/community/Techievolve/Freeproduct/Exception/InvalidQuantity.php app/code/community/Techievolve/Freeproduct/Exception/ProductNotFound.php app/code/community/Techievolve/Freeproduct/Exception/ProductNotSalable.php app/code/community/Techievolve/Freeproduct/Helper/Data.php app/code/community/Techievolve/Freeproduct/Model/Consts.php app/code/community/Techievolve/Freeproduct/Model/Observer.php app/code/community/Techievolve/Freeproduct/sql/freeproduct_setup/mysql4-install-0.1.0.php app/etc/modules/Techievolve_Freeproduct.xml app/design/frontend/smartwave/porto/layout/freeproduct.xml app/design/frontend/smartwave/porto/template/freeproduct/checkout/cart/item/default.phtml
0 Comments