WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
How does categories and subcategories are saved in DB? (1 post)

  1. KazikJ93
    Member
    Posted 1 year ago #

    Hi there,

    I have a problem with categories and subcategories.
    I'm creating a script which would create a categories and subcategories, the problem is that I don't fully understand how all this works in Woocommerce DB structure.

    That's what I was able to do:

    in "wp_terms":

    term_id | name              | slug     | term group
    20      | Parent category   | parent   | 0
    21      | Children category | children | 0

    in "wp_term_taxonomy":

    term_taxonomy_id | term_id | taxonomy    | description | parent | count
    1                | 20      | product_cat |             | 0      | 0
    2                | 21      | product_cat |             | 20     | 0

    And that's working, but why the hell this won't:

    in "wp_term_taxonomy":

    term_taxonomy_id | term_id | taxonomy    | description | parent | count
    1                | 20      | product_cat |             | 21     | 0
    2                | 21      | product_cat |             | 0      | 0

    Any leads?

    Big thanks for everyone in advance. :)

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic