From dd47170c7da8d7b93a6a63161ae2451a73553021 Mon Sep 17 00:00:00 2001 From: James Allan Date: Wed, 17 Jul 2019 12:31:17 +1000 Subject: [PATCH] Deprecate the woocommerce_before_cart_item_quantity_zero action This action was removed in https://github.com/woocommerce/woocommerce/commit/921cc754b916deb5c3c077a9e2468005d6c74a4c. It will need to be deprecated so third-parties are made aware the new alternative. --- includes/class-wc-cart.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index f06e6f57d25..22e3facc311 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -1172,6 +1172,7 @@ class WC_Cart extends WC_Legacy_Cart { */ public function set_quantity( $cart_item_key, $quantity = 1, $refresh_totals = true ) { 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. return $this->remove_cart_item( $cart_item_key ); }