LemonStand Documentation

shop:onAfterRemoveFromCart event

The shop:onAfterRemoveFromCart event event is triggered after a product has been removed from the shopping cart. The event handler function should accept 2 parameters - the cart name and the cart item key. You can use the cart item key for finding an item in the shopping cart. 

Event handler example:

public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onAfterRemoveFromCart', $this, 'after_remove');
}
 
public function after_remove($cart_name, $key)
{
  $item = Shop_Cart::find_item($key, $cart_name);
  if ($item)
    traceLog('Removed '.$item->product->name);
}

Next: shop:onBeforeSetCartQuantity event
Previous: shop:onBeforeRemoveFromCart event
Return to Handling LemonStand events