1

By default on listing page,

I want to show products whose offer is 15%.

$productCollection->addFieldToFilter(array('attribute'=>'offer','eq'=>'15'));  

app\design\frontend\default\test\template\catalog\product\list.phtml

$_productCollection = $this->getLoadedProductCollection()->addAttributeToFilter('offers', '15')->Clear()->addAttributeToSort('position', 'asc');

This I have done hardcode.

6
  • do you want to show all products with 15 % off in one listing page ? Oct 3 '16 at 10:23
  • @Baby - app\design\frontend\default\test\template\catalog\product\list.phtml
    – jassi
    Oct 3 '16 at 10:42
  • no, thats fine, do you want to show all products with 15 % off in one listing page ? Oct 3 '16 at 10:44
  • @Baby - Yes I want to show all products with 15%. There will be dropdown on menu bar. On onchange condition will be change.
    – jassi
    Oct 3 '16 at 10:45
  • 1
    @BabyinMagento Thank you so much. It helped me a lot. :) I have referred your this one link - magento.stackexchange.com/questions/48469/…
    – jassi
    Oct 3 '16 at 11:54

Browse other questions tagged or ask your own question.