Skip to content

Instantly share code, notes, and snippets.

@tivnet
Created May 29, 2014 03:22
Show Gist options
  • Save tivnet/d9cca4a4f4cfebe143bc to your computer and use it in GitHub Desktop.
Save tivnet/d9cca4a4f4cfebe143bc to your computer and use it in GitHub Desktop.
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
@master-roma
Copy link

Thanx!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment