I am trying to run a javascript function after product is removed from the cart, but not working... I am using the function below
function action_woocommerce_remove_cart_item( $cart_item_key, $instance ) {
?>
<script>
$(document).ready(function(e) {
alert('removed');
$('#cart_ifram').attr('src','<?php echo home_url(); ?>/cart/');
});
</script>
<?php
};
add_action( 'woocommerce_cart_item_removed', 'action_woocommerce_remove_cart_item', 10, 2 );
I have also tried woocommerce_cart_item_removed hook but it didn't worked for me. Also woocommerce updated cart hook works when an item is added to cart but not in my case... Thanks for help...