Support » Plugin: WooCommerce » SQL Query to get Categories and Subcategories out of mysql database

  • Using latest version of Woocommerce and i want to write a SQL Query to get Categories and Subcategories out of mysql database.

    I am not sure apart from wp_terms table is there any table that can be joined for the same.

    I just need the SQL Query which will show all categories and Subcategories for example

    CAT 1
    > Sub cat 1
    >> Sub Sub cat 1
    > Sub cat 2
    CAT 2
    > Sub cat 1

    and so on it is possible

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Roy Ho

    (@splashingpixelscom)

    I believe WooCommerce has built in methods to do this but you can also use WP_Query to pull that data out. If you’re not familiar with it, Google it and it will take you to the codex where you will see how that class is used.

Viewing 1 replies (of 1 total)
  • The topic ‘SQL Query to get Categories and Subcategories out of mysql database’ is closed to new replies.