what are you doing for it? i wrote this string in the end of file (wp-content/plugins/woocommerce/woocommerce.php):
add_filter('woocommerce_before_cart_item_quantity_zero', 'wordpress_before_cart_item_quantity_zero', 10, 1);
function wordpress_before_cart_item_quantity_zero($item) {
global $wpdb;
global $woocommerce;
$cart = $woocommerce->cart;
foreach ( $cart->get_cart() as $cart_item_key => $cart_item ) {
$id_product = $cart_item['product_id'];
$wpdb->prepare("DELETE FROM wp_block_product WHERE product_id = %d", $id_product);
$preparing_query = $wpdb->query($preparing_query);
}
var_dump($wpdb);
exit;
}
but when i delete item from the cart it's not working!
i was try do so:
add_action('woocommerce_before_cart_item_quantity_zero', 'wordpress_before_cart_item_quantity_zero');
but it's not working too