Skip to main content
added 21 characters in body
Source Link
David Tay
  • 548
  • 2
  • 10

In my catalog/product_list block template (catalog/product/list.phtml), I've this piece of code that should work, but $_productCollection is always false:

<?php $session = Mage::getSingleton('core/session'); $_productCollection = $session->getProductCollection(); if (!$_productCollection){ $_productCollection=$this->getLoadedProductCollection(); $session->setProductCollection($_productCollection); } $_helper = $this->helper('catalog/output'); 

Strings work, just not collection objects it seems. In my IDE I can see the $_SESSION superglobal populating with the collection, but on refresh it just disappears. Maybe it is garbage collected when the request completes? Any one have any idea?

Note, this page is not using a toolbar.

In my catalog/product_list block template (catalog/product/list.phtml), I've this piece of code that should work, but $_productCollection is always false:

<?php $session = Mage::getSingleton('core/session'); $_productCollection = $session->getProductCollection(); if (!$_productCollection){ $_productCollection=$this->getLoadedProductCollection(); $session->setProductCollection($_productCollection); } $_helper = $this->helper('catalog/output'); 

Strings work, just not collection objects it seems. In my IDE I can see the $_SESSION superglobal populating with the collection, but on refresh it just disappears. Maybe it is garbage collected when the request completes? Any one have any idea?

In my catalog/product_list block template (catalog/product/list.phtml), I've this piece of code that should work, but $_productCollection is always false:

<?php $session = Mage::getSingleton('core/session'); $_productCollection = $session->getProductCollection(); if (!$_productCollection){ $_productCollection=$this->getLoadedProductCollection(); $session->setProductCollection($_productCollection); } $_helper = $this->helper('catalog/output'); 

Strings work, just not collection objects it seems. In my IDE I can see the $_SESSION superglobal populating with the collection, but on refresh it just disappears. Maybe it is garbage collected when the request completes? Any one have any idea?

Note, this page is not using a toolbar.

added 21 characters in body
Source Link
David Tay
  • 548
  • 2
  • 10

In my catalog/product_list block template (catalog/product/list.phtml), I've this piece of code that should work, but $_productCollection is always false:

<?php $session = Mage::getSingleton('core/session'); $_productCollection = $session->getProductCollection(); if (!$_productCollection){ $_productCollection=$this->getLoadedProductCollection(); $session->setProductCollection($_productCollection); } $_helper = $this->helper('catalog/output'); 

Strings work, just not collection objects it seems. In my IDE I can see the $_SESSION superglobal populating with the collection, but on refresh it just disappears. Maybe is it beingis garbage collected when the request completes? Any one have any idea?

In my catalog/product_list block template (catalog/product/list.phtml), I've this piece of code that should work, but $_productCollection is always false:

<?php $session = Mage::getSingleton('core/session'); $_productCollection = $session->getProductCollection(); if (!$_productCollection){ $_productCollection=$this->getLoadedProductCollection(); $session->setProductCollection($_productCollection); } $_helper = $this->helper('catalog/output'); 

Strings work, just not collection objects it seems. In my IDE I can see the $_SESSION superglobal populating with the collection, but on refresh it just disappears. Maybe is it being garbage collected? Any one have any idea?

In my catalog/product_list block template (catalog/product/list.phtml), I've this piece of code that should work, but $_productCollection is always false:

<?php $session = Mage::getSingleton('core/session'); $_productCollection = $session->getProductCollection(); if (!$_productCollection){ $_productCollection=$this->getLoadedProductCollection(); $session->setProductCollection($_productCollection); } $_helper = $this->helper('catalog/output'); 

Strings work, just not collection objects it seems. In my IDE I can see the $_SESSION superglobal populating with the collection, but on refresh it just disappears. Maybe it is garbage collected when the request completes? Any one have any idea?

Source Link
David Tay
  • 548
  • 2
  • 10
Loading