From 32d850a76a53af128fd0d611c35491be41d1e508 Mon Sep 17 00:00:00 2001 From: justinstern Date: Tue, 7 Jan 2014 02:13:31 -0500 Subject: [PATCH] woocommerce_stock_amount rather than intval Using woocommerce_stock_amount filter rather than intval cast --- includes/abstracts/abstract-wc-product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/abstracts/abstract-wc-product.php b/includes/abstracts/abstract-wc-product.php index 696ce630dca..a5d30236e5c 100644 --- a/includes/abstracts/abstract-wc-product.php +++ b/includes/abstracts/abstract-wc-product.php @@ -163,7 +163,7 @@ class WC_Product { if ( $this->managing_stock() ) { // Update stock amount - $this->stock = intval( $amount ); + $this->stock = apply_filters( 'woocommerce_stock_amount', $amount ); // Update meta update_post_meta( $this->id, '_stock', $this->stock ); @@ -924,7 +924,7 @@ class WC_Product { /** * Functions for getting parts of a price, in html, used by get_price_html. - * + * * @return string */ public function get_price_html_from_text() {