How can I remove products from cart via php? Or prevent the adding of products via PHP? I tried returning false in the cart.php but it's not working, the product is still being added.
Okay I found the following:
unset($cart->cartProductsData[$k]);
$cart->setCartIntoSession();
$cart->prepareCartData();
i have coded this into the main cart file, but that is a core chagne which isn't a good practice. So now I need to use a plugin and probably use one of the hooks, but i', not sure which one yet so i need to keep reseraching to find the answer, if anyone knows, I'll be advised!