I have a CMS page that I am going to display products on with the following updated XML code:
<reference name="content">
<block type="catalog/product_list" name="product_list" template="catalog/product/wholesale-list.phtml">
<action method="setCategoryId"><category_id>191</category_id></action>
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
</reference>
I have tried getting the ID I set in the layout, but no such luck. I have tried:
$_category = Mage::registry(‘current_category’);
$currentCategoryId= $_category->getId();
and
$layer = Mage::getSingleton(‘catalog/layer’);
$_category = $layer->getCurrentCategory();
$currentCategoryId= $_category->getId();
But neither of these methods work. Does anyone know how I can get the ID?
Haven’t tried this, but maybe something like:
This way you are directly getting the variable that you have set on the Block object in the XML.
Cheers,
JD