Update variable names to correct ones

This commit is contained in:
Claudiu Lodromanean 2017-03-03 14:40:31 -08:00
parent 22edf2590d
commit e4db7f1d76
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. // Update taxonomies.
if ( isset( $variation['attributes'] ) ) { if ( isset( $data['attributes'] ) ) {
$_attributes = array(); $_attributes = array();
foreach ( $variation['attributes'] as $attribute_key => $attribute ) { foreach ( $data['attributes'] as $attribute_key => $attribute ) {
if ( ! isset( $attribute['name'] ) ) { if ( ! isset( $attribute['name'] ) ) {
continue; continue;
} }

View File

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