Fix WC_Product::set_stock_status() to correctly set status
This commit is contained in:
parent
414315fde0
commit
3ce99ba71e
|
@ -231,7 +231,7 @@ class WC_Product {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function set_stock_status( $status ) {
|
function set_stock_status( $status ) {
|
||||||
$status = 'outofstock' ? 'outofstock' : 'instock';
|
$status = ( 'outofstock' === $status ) ? 'outofstock' : 'instock';
|
||||||
|
|
||||||
if ( $this->stock_status != $status ) {
|
if ( $this->stock_status != $status ) {
|
||||||
update_post_meta( $this->id, '_stock_status', $status );
|
update_post_meta( $this->id, '_stock_status', $status );
|
||||||
|
|
Loading…
Reference in New Issue