This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:onBeforeRemoveFromCart event

Triggered by Shop_Cart
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onBeforeRemoveFromCart(string $cart_name, string $key)
$cart_name string specifies the cart name.
$key string specifies the cart item key.
Triggered before an item is removed from the shopping cart. Inside the event handler you can trigger an exception to prevent removing the item. Usage example:
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onBeforeRemoveFromCart', $this, 'before_remove');
}

public function before_remove($cart_name, $key)
{
  $item = Shop_Cart::find_item($key, $cart_name);
  if ($item)
    traceLog('Before remove '.$item->product->name);
}