I have a custom block that I'm using to display a featured category on cms pages. Everything is working fine on my local machine (ver. 1.9.2.2) but when I upload to the server (ver. 1.14.2.1) it's not show any products.
app/design/frontend/themename/default/template/custom/featured-product.phtml
<?php $_categoryId = $this->getCategoryId(); $_sortOrder = $this->getData('sortOrder') ?: "ASC"; $_sortBy = $this->getData('sortBy') ?: "price"; $_maxCount = $this->getData('max') ?: 20; $_blockLabel = $this->getData('label'); $_productCollection = Mage::getModel('catalog/category')->load($_categoryId) ->getProductCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('status', 1) ->addAttributeToFilter('visibility', 4) ->setOrder($_sortBy, $_sortOrder); ?> <?php echo $_categoryId; ?> <!-- processing php/html -->
This is how I'm calling it from the cms page:
{{block type="core/template" category_id="46" label="Audio" template="custom/featured-product.phtml" }}
It's echoing the $_categoryId out correctly, and I've verified that the category has products in it.
I must be missing something really simple! Any ideas what could be wrong?
Hi @NateW
Is your Magento 1.14.2.1 is patched with SUPEE-6788 patch? If yes then you have to white list your custom block. (System >permission>blocks)
Thanks so much for looking at this! I've really been struggling with it.
It must not be because patched because I don't see a 'blocks' section in System->Permission.
Any other ideas why it's not showing up?