查找商店的根类别 [英] Find root category of store
本文介绍了查找商店的根类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Magento 1.6.1版.我需要获取商店的根目录类别.我在Google搜索中没有得到任何好主意/代码.让我知道如何获取商店的根目录类别吗?
I am using Magento ver1.6.1. I need to get the root category of a store. I search in google by didn't get any good idea/code. Let me know how to get the root category of a store?
Mage::app()->getStore()->getRootCategoryId()
上面的代码给出了默认的根类别,但是我需要在商店创建过程中选择的类别ID.
The above code gives the default root category, but I need the category Id which we select during store creation.
推荐答案
您是否尝试过:
Mage::app()->getStore($storeId)->getRootCategoryId();
这篇关于查找商店的根类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文