Merge pull request #13981 from woocommerce/fix/13936
[REST API] Fixed attributes while trying to save variations
This commit is contained in:
commit
f3156fb5f4
|
@ -1262,7 +1262,7 @@ class WC_API_Products extends WC_API_Resource {
|
|||
global $wpdb;
|
||||
|
||||
$id = $product->get_id();
|
||||
$attributes = $product->get_variation_attributes();
|
||||
$attributes = $product->get_attributes();
|
||||
|
||||
foreach ( $request['variations'] as $menu_order => $data ) {
|
||||
$variation_id = isset( $data['id'] ) ? absint( $data['id'] ) : 0;
|
||||
|
|
|
@ -1751,8 +1751,7 @@ class WC_API_Products extends WC_API_Resource {
|
|||
global $wpdb;
|
||||
|
||||
$id = $product->get_id();
|
||||
$variations = $request['variations'];
|
||||
$attributes = (array) get_post_meta( $id, '_product_attributes', true );
|
||||
$attributes = $product->get_attributes();
|
||||
|
||||
foreach ( $variations as $menu_order => $data ) {
|
||||
$variation_id = isset( $data['id'] ) ? absint( $data['id'] ) : 0;
|
||||
|
|
Loading…
Reference in New Issue