parent
c1b83df5f6
commit
840da4f0c8
|
@ -1076,10 +1076,11 @@ class WC_API_Products extends WC_API_Resource {
|
|||
|
||||
$product->set_date_on_sale_to( $date_to );
|
||||
$product->set_date_on_sale_from( $date_from );
|
||||
|
||||
if ( $product->is_on_sale() ) {
|
||||
$product->set_price( $product->get_sale_price() );
|
||||
$product->set_price( $product->get_sale_price( 'edit' ) );
|
||||
} else {
|
||||
$product->set_price( $product->get_regular_price() );
|
||||
$product->set_price( $product->get_regular_price( 'edit' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1566,10 +1566,11 @@ class WC_API_Products extends WC_API_Resource {
|
|||
|
||||
$product->set_date_on_sale_to( $date_to );
|
||||
$product->set_date_on_sale_from( $date_from );
|
||||
|
||||
if ( $product->is_on_sale() ) {
|
||||
$product->set_price( $product->get_sale_price() );
|
||||
$product->set_price( $product->get_sale_price( 'edit' ) );
|
||||
} else {
|
||||
$product->set_price( $product->get_regular_price() );
|
||||
$product->set_price( $product->get_regular_price( 'edit' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue