Created
May 29, 2014 03:22
-
-
Save tivnet/d9cca4a4f4cfebe143bc to your computer and use it in GitHub Desktop.
WooCommerce category list SQL query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- @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
Thanx!!!