[API] Fixed variations backorders

This commit is contained in:
Claudio Sanches 2016-04-28 13:24:20 -03:00
parent fb62b9d511
commit 3fc2c82aaf
3 changed files with 3 additions and 3 deletions

View File

@ -1352,7 +1352,7 @@ class WC_API_Products extends WC_API_Resource {
$backorders = get_post_meta( $variation_id, '_backorders', true ); $backorders = get_post_meta( $variation_id, '_backorders', true );
if ( isset( $variation['backorders'] ) ) { if ( isset( $variation['backorders'] ) ) {
if ( 'notify' == $variation['backorders'] ) { if ( 'notify' === $variation['backorders'] ) {
$backorders = 'notify'; $backorders = 'notify';
} else { } else {
$backorders = ( true === $variation['backorders'] ) ? 'yes' : 'no'; $backorders = ( true === $variation['backorders'] ) ? 'yes' : 'no';

View File

@ -1860,7 +1860,7 @@ class WC_API_Products extends WC_API_Resource {
$backorders = get_post_meta( $variation_id, '_backorders', true ); $backorders = get_post_meta( $variation_id, '_backorders', true );
if ( isset( $variation['backorders'] ) ) { if ( isset( $variation['backorders'] ) ) {
if ( 'notify' == $variation['backorders'] ) { if ( 'notify' === $variation['backorders'] ) {
$backorders = 'notify'; $backorders = 'notify';
} else { } else {
$backorders = ( true === $variation['backorders'] ) ? 'yes' : 'no'; $backorders = ( true === $variation['backorders'] ) ? 'yes' : 'no';

View File

@ -1642,7 +1642,7 @@ class WC_CLI_Product extends WC_CLI_Command {
if ( 'yes' === $managing_stock ) { if ( 'yes' === $managing_stock ) {
if ( isset( $variation['backorders'] ) ) { if ( isset( $variation['backorders'] ) ) {
if ( 'notify' == $variation['backorders'] ) { if ( 'notify' === $variation['backorders'] ) {
$backorders = 'notify'; $backorders = 'notify';
} else { } else {
$backorders = ( $this->is_true( $variation['backorders'] ) ) ? 'yes' : 'no'; $backorders = ( $this->is_true( $variation['backorders'] ) ) ? 'yes' : 'no';