Tweak wc_get_product_variation_attributes to ignore non variation attributes
This commit is contained in:
parent
d7d609d85a
commit
83d2f64e9e
|
@ -640,10 +640,12 @@ function wc_get_product_variation_attributes( $variation_id ) {
|
|||
|
||||
// Compare to parent variable product attributes and ensure they match
|
||||
foreach ( $parent_attributes as $attribute_name => $options ) {
|
||||
$attribute = 'attribute_' . sanitize_title( $attribute_name );
|
||||
$found_parent_attributes[] = $attribute;
|
||||
if ( ! empty( $options['is_variation'] ) && ! array_key_exists( $attribute, $variation_attributes ) ) {
|
||||
$variation_attributes[ $attribute ] = ''; // Add it - 'any' will be asumed
|
||||
if ( ! empty( $options['is_variation'] ) ) {
|
||||
$attribute = 'attribute_' . sanitize_title( $attribute_name );
|
||||
$found_parent_attributes[] = $attribute;
|
||||
if ( ! array_key_exists( $attribute, $variation_attributes ) ) {
|
||||
$variation_attributes[ $attribute ] = ''; // Add it - 'any' will be asumed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue