maximus 69
maximus 69

Reputation: 1458

Magento - query to get active categories in current store

I would like to issue to a SQL query to retrieve the active categories from 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

Upvotes: 0

Views: 5064

Answers (1)

Joe Mastey
Joe Mastey

Reputation: 27119

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;

Upvotes: 1

Related Questions