Show All For Sale / Special Prices at Magento

If you want to set the “On Sale” item in Magento, you need to set the “Special Price”. Special prices allow you to determine the discount on the product for a certain period of time.

My question is: how do I add a link to my layered navigation to display all of my "On Sale" / "Special Price".

thanks

+4
source share
2 answers

Checkout the following url for this.

http://www.creativemediagroup.net/creative-media-web-services/magento-blog/27-magento-show-only-special-priced-products-in-a-category

Line 31 has a syntax error, therefore

echo '<img src="'.$this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135);.'" width="135" height="135" alt=".$this->htmlEscape($this->getImageLabel($_product, 'small_image')).'" title="'.$this->htmlEscape($this->getImageLabel($_product, 'small_image')).'" /> 

replace the above line with the following

 echo '<img src="'.$this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135).'" width="135" height="135" alt="'.$this->htmlEscape($this->getImageLabel($_product, 'small_image')).'" title="'.$this->htmlEscape($this->getImageLabel($_product, 'small_image')).'" /> 
+1
source

Call this function:

  public function getSpecialProduct(){ $sql = "SELECT cp.*, ea.* FROM catalog_category_product AS cp INNER JOIN catalog_product_entity_decimal AS pei ON pei.entity_id=cp.product_id AND pei.attribute_id =76 AND pei.value >0 NATURAL JOIN eav_attribute AS ea WHERE ea.attribute_code='special_price' group by cp.product_id"; $data = Mage::getSingleton('core/resource') ->getConnection('core_read')->fetchAll($sql); foreach($data as $row) $arr[] = Mage::getModel('catalog/product')->setStoreId($storeId)->load($row['product_id']); return $arr; } 
0
source

Source: https://habr.com/ru/post/1482060/


All Articles