moved transient clear
This commit is contained in:
parent
513160ff56
commit
6662a1f724
|
@ -209,9 +209,10 @@ class WC_Product {
|
|||
// Out of stock attribute
|
||||
if ($this->managing_stock() && !$this->backorders_allowed() && $this->get_total_stock()<=0) :
|
||||
update_post_meta($this->id, '_stock_status', 'outofstock');
|
||||
$woocommerce->clear_product_transients( $this->id ); // Clear transient
|
||||
endif;
|
||||
|
||||
$woocommerce->clear_product_transients( $this->id ); // Clear transient
|
||||
|
||||
return $this->stock;
|
||||
endif;
|
||||
}
|
||||
|
@ -232,9 +233,10 @@ class WC_Product {
|
|||
// Out of stock attribute
|
||||
if ($this->managing_stock() && ($this->backorders_allowed() || $this->get_total_stock()>0)) :
|
||||
update_post_meta($this->id, '_stock_status', 'instock');
|
||||
$woocommerce->clear_product_transients( $this->id ); // Clear transient
|
||||
endif;
|
||||
|
||||
$woocommerce->clear_product_transients( $this->id ); // Clear transient
|
||||
|
||||
return $this->stock;
|
||||
endif;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue