Attribute Top Level List to Array?
-
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
The topic ‘Attribute Top Level List to Array?’ is closed to new replies.