magento 獲取當前所在的目錄ID

magento 獲取當前所在的目錄ID:
方法一:
$curLayer = Mage::getSingleton(‘catalog/layer’); 
$curCategory = $curLayer ->getCurrentCategory();
$curCategoryId=  $curCategory  ->getId(); 
方法二:
$curCategoryId = Mage::registry('current_category')->getId();
相關文章
相關標籤/搜索