When you remove a product from the cart, VM has a trigger: vDispatcher::trigger('plgVmOnRemoveFromCart',array($this,$prod_id));
I use this to remove binded products like when there is a phone and a case in the cart and you remove the phone, the plugin removes the case as well.
The cart management does work, but there is a bit of issue with the display.
For testing add this to a vmcustom plugin:
Code:
function plgVmOnRemoveFromCart( &$cart, $prod_id )
{
unset($cart->product[$prod_id+1]);
unset($cart->cartProductsData[$prod_id+1]);
}
Add two products to the cart, and remove the first one.
The expected behavior: it should show an empty cart, because VM removed the first product and the plugin removed the second one.
Actual behavior:
vmuikitx removes the first product, but the second one is still there. The cart module already shows 0 products. When I refresh the checkout page, it's empty.