From cbb89fa4b968466edc8875fbad1cf7e8ec13ddac Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 12 Aug 2015 18:02:13 +0100 Subject: [PATCH] wc_get_product_variation_attributes should only get parent attributes which are for variations. Closes #8796 --- includes/wc-product-functions.php | 2 +- readme.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/wc-product-functions.php b/includes/wc-product-functions.php index f2e356b592e..3175e7b5ea2 100644 --- a/includes/wc-product-functions.php +++ b/includes/wc-product-functions.php @@ -632,7 +632,7 @@ function wc_get_product_variation_attributes( $variation_id ) { foreach ( $parent_attributes as $attribute_name => $options ) { $attribute = 'attribute_' . sanitize_title( $attribute_name ); $found_parent_attributes[] = $attribute; - if ( ! array_key_exists( $attribute, $variation_attributes ) ) { + if ( $options['is_variation'] && ! array_key_exists( $attribute, $variation_attributes ) ) { $variation_attributes[ $attribute ] = ''; // Add it - 'any' will be asumed } } diff --git a/readme.txt b/readme.txt index d1db9f6d8c5..71f1eee3eca 100644 --- a/readme.txt +++ b/readme.txt @@ -165,6 +165,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Fix - Ajax variations: stripslashes to fix attributes with quotes. * Fix - No longer returns to the first variation list page when deleting one variation. * Fix - Refund subjects when order contains downloadable product. +* Fix - wc_get_product_variation_attributes should only get parent attributes which are for variations. * Tweak - Disable display_errors during ajax requests to prevent malformed JSON. * Tweak - When merging shipping taxes with a shipping rate taxes, ensure shipping rate taxes is not malformed.