2026 Executive BenchmarkMid-Market Enterprise Modernization: How leaders across unify Commerce, Odoo ERP & AI in 90 days.
MAGENTO COMMERCE

Magento – Hot_Sale_New Labels

$collection = Mage::getResourceModel('reports/product_collection') ->addOrderedQty() ->addAttributeToSelect('*') ->addAttributeToSelect(array('name', 'price', 'small_image')) ->set...

Akshar Group Technologies
Dec 25, 2020
1 min read
Verified Source
php
<?php
getStore()->getId();
$collection = Mage::getResourceModel('reports/product_collection')
->addOrderedQty()
->addAttributeToSelect('*')
->addAttributeToSelect(array('name', 'price', 'small_image'))
->setStoreId($storeId)
->addStoreFilter($storeId)
->setOrder('ordered_qty', 'desc'); // most best sellers on top
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
//filter only active products
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
//filter only visible in catalog products
$bestseller = array();
foreach ($collection as $_product){
$bestseller[] = $_product->getSku();
}
/* Best Seller */
?>
load($_product->getID())->getNewsFromDate();
$newToDate = Mage::getModel('catalog/product')->load($_product->getID())->getNewsToDate();
$now = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);

if(($newFromDate $now || $newToDate == '')){
$newProduct = "
>
getSkinUrl('images/new_pro_img.png') ." ' />
"; } ?> getPrice() > $_product->getFinalPrice()){ $onsaleProduct = "

getSkinUrl('images/onsale_pro_img.png') ." ' />
"; } ?> getSku(),$bestseller)){ ?>

<img decoding="async" class="lazyload hot" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-orig-src="getSkinUrl('images/hot_pro_img.png'); ?>" alt="">
?>
Share this playbook
LET'S BUILD WHAT'S NEXT

What's Holding Your Business Back?

Tell us where you want to go, what's getting in the way, and we'll help you figure out the technology to get there.

No sales pitch. Confidential strategic advisory.