Magento - Check if specific category is active

喜夏-厌秋 提交于 2021-02-19 03:39:10

问题


Is there any way of checking if one specific category is active? I have a hard coded navigation and I want to show or hide a link depending on the active status of a specific category. Perhaps something like this:

// Check to see if the Sale category is active...
$specificCatID = '90';    
if(isCategoryActive($specificCatID)){
    // Specific category is active, do something
}

I have searched high and low, and have yet to get close to being able to solve this. Any help, much appreciated.


回答1:


I hope this will answer your question :)

$specificCatID = '90';
$category = Mage::getModel('catalog/category')->load($specificCatID);

if ($category->getIsActive()) {
}


来源:https://stackoverflow.com/questions/18274379/magento-check-if-specific-category-is-active

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!