includes/abstracts/abstract-wc-product.php 1 location
|
@@ 312-316 (lines=5) @@
|
| 309 |
|
public function reduce_stock( $amount = 1 ) { |
| 310 |
|
$new_stock = $this->set_stock( $amount, 'subtract' ); |
| 311 |
|
|
| 312 |
|
if ( 'yes' === get_option( 'woocommerce_notify_no_stock' ) && get_option( 'woocommerce_notify_no_stock_amount' ) >= $new_stock ) { |
| 313 |
|
do_action( 'woocommerce_no_stock', $this ); |
| 314 |
|
} elseif ( 'yes' === get_option( 'woocommerce_notify_low_stock' ) && get_option( 'woocommerce_notify_low_stock_amount' ) >= $new_stock ) { |
| 315 |
|
do_action( 'woocommerce_low_stock', $this ); |
| 316 |
|
} |
| 317 |
|
|
| 318 |
|
return $new_stock; |
| 319 |
|
} |
includes/class-wc-product-variation.php 1 location
|
@@ 509-513 (lines=5) @@
|
| 506 |
|
if ( true === $this->managing_stock() ) { |
| 507 |
|
$new_stock = $this->set_stock( $amount, 'subtract' ); |
| 508 |
|
|
| 509 |
|
if ( 'yes' === get_option( 'woocommerce_notify_no_stock' ) && get_option( 'woocommerce_notify_no_stock_amount' ) >= $new_stock ) { |
| 510 |
|
do_action( 'woocommerce_no_stock', $this ); |
| 511 |
|
} elseif ( 'yes' === get_option( 'woocommerce_notify_low_stock' ) && get_option( 'woocommerce_notify_low_stock_amount' ) >= $new_stock ) { |
| 512 |
|
do_action( 'woocommerce_low_stock', $this ); |
| 513 |
|
} |
| 514 |
|
|
| 515 |
|
return $new_stock; |
| 516 |
|
} else { |