0
我試着從目錄獲取當前類別/產品/ view.phtml抓取當前類別在Magento
<?php
$_helper = $this->helper('catalog/output');
$item = $this->getProduct();
$curCat = Mage::registry('current_category');
if($curCat && $curCat->getId() == Mage::helper('function')->NEWS_CAT_ID) {
// do stuff
}
?>
這種方法的主要問題是;我得到parrent category_ID(2)而不是孩子category_ID(10)。我如何解決這個問題?
我懂了,謝謝! – SinisterGlitch