Merge pull request #19504 from woocommerce/fix/19485-backorder-import

Product import backorders default to no
This commit is contained in:
Mike Jolley 2018-03-28 11:00:09 +01:00 committed by GitHub
commit 5547c57c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -491,7 +491,7 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
*/ */
public function parse_backorders_field( $value ) { public function parse_backorders_field( $value ) {
if ( empty( $value ) ) { if ( empty( $value ) ) {
return ''; return 'no';
} }
$value = $this->parse_bool_field( $value ); $value = $this->parse_bool_field( $value );
@ -502,7 +502,7 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
return $value ? 'yes' : 'no'; return $value ? 'yes' : 'no';
} }
return ''; return 'no';
} }
/** /**

View File

@ -306,7 +306,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
'tax_class' => 'standard', 'tax_class' => 'standard',
'stock_status' => 'instock', 'stock_status' => 'instock',
'stock_quantity' => '', 'stock_quantity' => '',
'backorders' => '', 'backorders' => 'no',
'sold_individually' => '', 'sold_individually' => '',
'weight' => '', 'weight' => '',
'length' => '', 'length' => '',
@ -358,7 +358,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
'tax_class' => 'standard', 'tax_class' => 'standard',
'stock_status' => 'instock', 'stock_status' => 'instock',
'stock_quantity' => '', 'stock_quantity' => '',
'backorders' => '', 'backorders' => 'no',
'sold_individually' => '', 'sold_individually' => '',
'weight' => '', 'weight' => '',
'length' => '', 'length' => '',
@ -394,7 +394,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
'tax_class' => '', 'tax_class' => '',
'stock_status' => 'outofstock', 'stock_status' => 'outofstock',
'stock_quantity' => '', 'stock_quantity' => '',
'backorders' => '', 'backorders' => 'no',
'sold_individually' => '', 'sold_individually' => '',
'weight' => '', 'weight' => '',
'length' => '', 'length' => '',
@ -446,7 +446,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
'tax_class' => 'standard', 'tax_class' => 'standard',
'stock_status' => 'instock', 'stock_status' => 'instock',
'stock_quantity' => 6, 'stock_quantity' => 6,
'backorders' => '', 'backorders' => 'no',
'sold_individually' => '', 'sold_individually' => '',
'weight' => 1.0, 'weight' => 1.0,
'length' => 2.0, 'length' => 2.0,
@ -536,7 +536,7 @@ class WC_Tests_Product_CSV_Importer extends WC_Unit_Test_Case {
'tax_class' => '', 'tax_class' => '',
'stock_status' => 'instock', 'stock_status' => 'instock',
'stock_quantity' => '', 'stock_quantity' => '',
'backorders' => '', 'backorders' => 'no',
'sold_individually' => '', 'sold_individually' => '',
'weight' => '', 'weight' => '',
'length' => '', 'length' => '',