parent
89d177a48b
commit
c68501f666
|
@ -1807,17 +1807,17 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
|
||||
if ( 'yes' === $managing_stock ) {
|
||||
$backorders = get_post_meta( $variation_id, '_backorders', true );
|
||||
|
||||
if ( isset( $variation['backorders'] ) ) {
|
||||
if ( 'notify' == $variation['backorders'] ) {
|
||||
$backorders = 'notify';
|
||||
} else {
|
||||
$backorders = ( true === $variation['backorders'] ) ? 'yes' : 'no';
|
||||
}
|
||||
} else {
|
||||
$backorders = 'no';
|
||||
}
|
||||
|
||||
update_post_meta( $variation_id, '_backorders', $backorders );
|
||||
update_post_meta( $variation_id, '_backorders', '' === $backorders ? 'no' : $backorders );
|
||||
|
||||
if ( isset( $variation['stock_quantity'] ) ) {
|
||||
wc_update_product_stock( $variation_id, wc_stock_amount( $variation['stock_quantity'] ) );
|
||||
|
|
|
@ -1349,17 +1349,17 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
|
||||
if ( 'yes' === $managing_stock ) {
|
||||
$backorders = get_post_meta( $variation_id, '_backorders', true );
|
||||
|
||||
if ( isset( $variation['backorders'] ) ) {
|
||||
if ( 'notify' == $variation['backorders'] ) {
|
||||
$backorders = 'notify';
|
||||
} else {
|
||||
$backorders = ( true === $variation['backorders'] ) ? 'yes' : 'no';
|
||||
}
|
||||
} else {
|
||||
$backorders = 'no';
|
||||
}
|
||||
|
||||
update_post_meta( $variation_id, '_backorders', $backorders );
|
||||
update_post_meta( $variation_id, '_backorders', '' === $backorders ? 'no' : $backorders );
|
||||
|
||||
if ( isset( $variation['stock_quantity'] ) ) {
|
||||
wc_update_product_stock( $variation_id, wc_stock_amount( $variation['stock_quantity'] ) );
|
||||
|
|
Loading…
Reference in New Issue