Fixed the selected attributes in product variations panel, closes #7115

This commit is contained in:
Claudio Sanches 2015-01-15 16:01:55 -02:00
parent 5612d54058
commit b3d6f6358e
1 changed files with 7 additions and 0 deletions

View File

@ -776,6 +776,13 @@ class WC_Meta_Box_Product_Data {
$variation_data[ $field ] = isset( $variation_meta[ $field ][0] ) ? maybe_unserialize( $variation_meta[ $field ][0] ) : $value;
}
// Add the variation attributes
foreach ( $variation_meta as $key => $value ) {
if ( false !== strpos( $key, 'attribute_' ) ) {
$variation_data[ $key ] = $value;
}
}
// Formatting
$variation_data['_regular_price'] = wc_format_localized_price( $variation_data['_regular_price'] );
$variation_data['_sale_price'] = wc_format_localized_price( $variation_data['_sale_price'] );