WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Digital Raindrops
    Member
    Posted 1 year ago #

    Hi,
    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,
    	array(
    		'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!

    David

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

  2. Digital Raindrops
    Member
    Posted 1 year ago #

    Hi,
    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:
    http://www.youtube.com/watch?v=z7WqgjP-IiU&feature=youtu.be

    Regards

    David

  3. GregyPooh
    Member
    Posted 7 months 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

About this Topic