WordPress.org

Forums

WooCommerce - excelling eCommerce
SQL Query to get Categories and Subcategories out of mysql database (2 posts)

  1. thetechie
    Member
    Posted 2 years ago #

    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/

  2. Roy Ho
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic