Created
October 28, 2021 09:54
-
-
Save encoderit-arman/204989e3ed4e67ea78e6f11c3c354441 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) { | |
if ($cart_item['product_id'] == $product_id) { | |
WC()->cart->remove_cart_item($cart_item_key); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment