Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce category list SQL query
--
-- @author Gregory Karpinsky, http://www.tiv.net/
-- @version 14.05.28
--
SELECT
tp.name Cat,
t.name Subcat
FROM
wp_term_taxonomy tt,
wp_terms t,
wp_terms tp
WHERE
tt.taxonomy = 'product_cat'
AND tt.term_id = t.term_id
AND tt.parent = tp.term_id
ORDER BY
Cat,
Subcat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment