Merge pull request #24178 from james-allan/deprecate_before_quantity_zero_action
Deprecate the `woocommerce_before_cart_item_quantity_zero` action
This commit is contained in:
commit
ba517650a1
|
@ -1172,6 +1172,7 @@ class WC_Cart extends WC_Legacy_Cart {
|
||||||
*/
|
*/
|
||||||
public function set_quantity( $cart_item_key, $quantity = 1, $refresh_totals = true ) {
|
public function set_quantity( $cart_item_key, $quantity = 1, $refresh_totals = true ) {
|
||||||
if ( 0 === $quantity || $quantity < 0 ) {
|
if ( 0 === $quantity || $quantity < 0 ) {
|
||||||
|
wc_do_deprecated_action( 'woocommerce_before_cart_item_quantity_zero', array( $cart_item_key, $this ), '3.7.0', 'woocommerce_remove_cart_item' );
|
||||||
// If we're setting qty to 0 we're removing the item from the cart.
|
// If we're setting qty to 0 we're removing the item from the cart.
|
||||||
return $this->remove_cart_item( $cart_item_key );
|
return $this->remove_cart_item( $cart_item_key );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue