WooCommerce - excelling eCommerce
Attribute Top Level List to Array? (3 posts)

  1. Digital Raindrops
    Posted 2 years ago #

    I am working on a free plugin to export WooCommerce data for an off-line Ipad sales application.

    I am new to the WooCommerce Codex, I know that the terms are stored with a key of pa_color and the post meta attributes for the attribute 'color' are stored with a key value attribute_pa_color

    The attribute term 'color' is not stored in the core terms tables but in a table called wp_woocommerce_attribute_taxonomies

    How in code can I get an array with the attribute_name and attribute_label from this table?

    Once I have these the normal term code calls will work.

    If I can return the values into an array variable $attribs then I can get the values (pa_color).

    foreach ( $attribs as $attrib ) {
      $terms = get_terms( 'pa_' .$attrib->attribute_name,
    		'parent'    => 0,
    		'hide_empty' => 1
      //Do stuff here

    I have tried this code but it does not return anything!

    global $wpdb,$table_prefix;
    $post_sql = "select * from $wpdb->woocommerce_attribute_taxonomies";
    $attribs = $wpdb->get_results($post_sql);

    Please Help!



  2. Digital Raindrops
    Posted 2 years ago #

    Can anyone answer my Question or point me in the right direction?

    I am quite far into creating the plugin, but I do need a solution to return the top level attributes to an array!

    Here is the plugin in action, it will allow you to sell off-line:



  3. GregyPooh
    Posted 1 year ago #

    Hey David,

    Did you find the solution?

    If so, fill me in!

    And did you finish your app?

    Thanks David!

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