moved transient clear

This commit is contained in:
Mike Jolley 2012-03-06 18:13:08 +00:00
parent 513160ff56
commit 6662a1f724
1 changed files with 4 additions and 2 deletions

View File

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