includes/api/class-wc-rest-products-controller.php 1 location
|
@@ 1103-1111 (lines=9) @@
|
1100 |
|
} |
1101 |
|
|
1102 |
|
// Stock status. |
1103 |
|
if ( isset( $request['in_stock'] ) ) { |
1104 |
|
$stock_status = true === $request['in_stock'] ? 'instock' : 'outofstock'; |
1105 |
|
} else { |
1106 |
|
$stock_status = get_post_meta( $product->id, '_stock_status', true ); |
1107 |
|
|
1108 |
|
if ( '' === $stock_status ) { |
1109 |
|
$stock_status = 'instock'; |
1110 |
|
} |
1111 |
|
} |
1112 |
|
|
1113 |
|
// Stock data. |
1114 |
|
if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) { |
includes/cli/class-wc-cli-product.php 1 location
|
@@ 1341-1349 (lines=9) @@
|
1338 |
|
} |
1339 |
|
|
1340 |
|
// Stock status |
1341 |
|
if ( isset( $data['in_stock'] ) ) { |
1342 |
|
$stock_status = ( $this->is_true( $data['in_stock'] ) ) ? 'instock' : 'outofstock'; |
1343 |
|
} else { |
1344 |
|
$stock_status = get_post_meta( $product_id, '_stock_status', true ); |
1345 |
|
|
1346 |
|
if ( '' === $stock_status ) { |
1347 |
|
$stock_status = 'instock'; |
1348 |
|
} |
1349 |
|
} |
1350 |
|
|
1351 |
|
// Stock Data |
1352 |
|
if ( 'yes' == get_option( 'woocommerce_manage_stock' ) ) { |