Magento - query to get active categories in current store
I would like to issue to a SQL query to retrieve the active categories f开发者_如何学Pythonrom my magento store. I am currently issuing the following query, but its returning the non active categories as well:-
SELECT entity_id, name, url_path FROM catalog_category_flat_store_1 WHERE level >=3 ORDER BY catalog_category_flat_store_1.parent_id ASC, catalog_category_flat_store_1.position ASC
I may be missing something here, but have you tried limiting by is_active
in your query?
select entity_id, name, url_path
from catalog_category_flat_store_1
where level >= 3 and
is_active = 1
order by parent_id asc, position asc;
精彩评论