Deprecate the woocommerce_before_cart_item_quantity_zero action

This action was removed in 921cc754b9.
It will need to be deprecated so third-parties are made aware the new alternative.
This commit is contained in:
James Allan 2019-07-17 12:31:17 +10:00
parent d034131781
commit dd47170c7d
1 changed files with 1 additions and 0 deletions

View File

@ -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 );
}