I need to access the current product collection in teh main page template (in this case 2-columns-left) in order to check whether a certain product exists, and if it does, display a banner advert.

I have tried:

$products = Mage::getModel('catalog/product')->getCollection();

but this loads all products, not just the ones loaded into the product list template.

Is there a way I can access only those products listed in the product view template from the parent template (2-columns-left)?

  • Are you trying to find the product collection in list.phtml? Commented Feb 20, 2015 at 11:22
  • No, in 2-columns-left - in terms of the layout the banner appears above the list.phtml in the page
    – matt
    Commented Feb 20, 2015 at 11:24

2 Answers 2


You can do:


Regards, Diego.


Mat, you can use the following code,

$currentCategory = Mage::registry('current_category');
   $products = Mage::getModel('catalog/product')

Hope this helps. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.