2

I am currently trying to modify catalog/product/list/related.phtml, and I found out that it uses Mage_Catalog_Block_Product_List_Related.

I used $this->getItems()->getSize() to check the number of related products involve is correct. I verified that there is 1 related product owned by the current product. However, it says 0 in the result, and it would not display any related product, which does not make sense.

The block seems to work, but it does not display the related products although I verified that there is a related product. What should I do here?

3

There are a couple of reason this might be the case:

  • The related product in question is out of stock, disabled
  • The related product is already in your cart, which disables magento from showing it

The best way to find out what is wrong is debugging Mage_Catalog_Block_Product_List_Related and the getItems function in there.

  • I made sure it is enabled. The funny thing is that I also tried to open it on another browser instance, and it says 1 and works. But when I refresh it on the same browser, it still says 0. Also wondering what specific cache does it come from? – Franz Noel Jul 2 '14 at 19:04
  • Perhaps your session has become corrupted. Try cleaning the var/session directory and try again. – Patrick Steenks Jul 2 '14 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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