Fix WC_Product::set_stock_status() to correctly set status

This commit is contained in:
Max Rice 2013-03-23 14:36:23 -04:00
parent 414315fde0
commit 3ce99ba71e
1 changed files with 1 additions and 1 deletions

View File

@ -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 );