【发布时间】:2011-07-27 06:58:49
【问题描述】:
我有一个 CMS 页面,我将使用以下更新的 XML 代码在该页面上显示产品:
<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>
我已经尝试获取我在布局中设置的 ID,但没有这样的运气。我试过了:
$_category = Mage::registry(‘current_category’);
$currentCategoryId= $_category->getId();
和
$layer = Mage::getSingleton(‘catalog/layer’);
$_category = $layer->getCurrentCategory();
$currentCategoryId= $_category->getId();
但是这些方法都不起作用。有谁知道我如何获得身份证?
【问题讨论】:
标签: php xml variables layout magento