Allow filter variation stock quantity, closes #11340
This commit is contained in:
parent
81690c4dee
commit
6ffd059680
|
@ -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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue