Allow filter variation stock quantity, closes #11340

This commit is contained in:
Claudio Sanches 2016-07-03 20:40:59 -03:00
parent 81690c4dee
commit 6ffd059680
1 changed files with 1 additions and 1 deletions

View File

@ -396,7 +396,7 @@ class WC_Product_Variation extends WC_Product {
* @return int * @return int
*/ */
public function get_stock_quantity() { public function get_stock_quantity() {
return true === $this->managing_stock() ? wc_stock_amount( $this->stock ) : $this->parent->get_stock_quantity(); return apply_filters( 'woocommerce_variation_get_stock_quantity', true === $this->managing_stock() ? wc_stock_amount( $this->stock ) : $this->parent->get_stock_quantity(), $this );
} }
/** /**