检查特定类别是否处于活动状态

检查特定类别是否处于活动状态

本文介绍了Magento-检查特定类别是否处于活动状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以检查某个特定类别是否处于活动状态?我有一个硬编码的导航,我想根据特定类别的活动状态显示或隐藏链接.也许是这样的:

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.

推荐答案

我希望这会回答您的问题:)

I hope this will answer your question :)

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

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

这篇关于Magento-检查特定类别是否处于活动状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 00:08