How do you make Magento CE include virtual products in the related product list?
-
12-12-2019 - |
Question
I am trying to create a relation between a bundled product and a virtual product. So I thought: "Let's just add the virtual product as related product."
However it was not showing in the related product list. After some trial and error (i.e. adding all products as related and see which were omitted) I found that it was only omitting virtual products from the related product list.
My question is:
Is this normal Magento (CE 1.9.0.1) behaviour? (I am editing an already active Magento installation) If so, why are virtual products omitted by default? How do I include them in the related products list?
Solution
From what I can tell by looking at Mage_Catalog_Block_Product_List_Related
the behavior you described is not the default one. If you look at the _prepareData()
you will see that in order for the product to appear the following conditions must be met:
- Product must be assigned to current website
- Product must not be in cart
- Product must be visible in catalog