From f8567680da7d8c49be106fa92d489a863d1ca5bf Mon Sep 17 00:00:00 2001 From: Manos Psychogyiopoulos Date: Mon, 2 Feb 2015 16:01:43 +0200 Subject: [PATCH] added remove/restore cart item hooks --- includes/class-wc-cart.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index dec77c59336..279b358d070 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -948,6 +948,8 @@ class WC_Cart { unset( $this->cart_contents[ $cart_item_key ] ); + do_action( 'woocommerce_cart_item_removed', $cart_item_key, $this ); + $this->calculate_totals(); return true; @@ -969,6 +971,8 @@ class WC_Cart { unset( $this->removed_cart_contents[ $cart_item_key ] ); + do_action( 'woocommerce_cart_item_restored', $cart_item_key, $this ); + $this->calculate_totals(); return true;