Merge pull request #13466 from woocommerce/fix-13405-2

Update variable names to correct ones
This commit is contained in:
Claudio Sanches 2017-03-04 10:05:26 -03:00 committed by GitHub
commit d07a75059f
2 changed files with 5 additions and 5 deletions

View File

@ -1382,10 +1382,10 @@ class WC_API_Products extends WC_API_Resource {
}
// Update taxonomies.
if ( isset( $variation['attributes'] ) ) {
if ( isset( $data['attributes'] ) ) {
$_attributes = array();
foreach ( $variation['attributes'] as $attribute_key => $attribute ) {
foreach ( $data['attributes'] as $attribute_key => $attribute ) {
if ( ! isset( $attribute['name'] ) ) {
continue;
}

View File

@ -1749,7 +1749,7 @@ class WC_API_Products extends WC_API_Resource {
$variations = $request['variations'];
$attributes = (array) maybe_unserialize( get_post_meta( $id, '_product_attributes', true ) );
foreach ( $variations as $menu_order => $variation ) {
foreach ( $variations as $menu_order => $data ) {
$variation_id = isset( $data['id'] ) ? absint( $data['id'] ) : 0;
$variation = new WC_Product_Variation( $variation_id );
@ -1881,10 +1881,10 @@ class WC_API_Products extends WC_API_Resource {
}
// Update taxonomies.
if ( isset( $variation['attributes'] ) ) {
if ( isset( $data['attributes'] ) ) {
$_attributes = array();
foreach ( $variation['attributes'] as $attribute_key => $attribute ) {
foreach ( $data['attributes'] as $attribute_key => $attribute ) {
if ( ! isset( $attribute['name'] ) ) {
continue;
}