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:onOrderBeforeUpdate event

Triggered by Shop_Order
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onOrderBeforeUpdate(Shop_Order $order, string $session_key)
$order Shop_Order specifies the order object.
$session_key string specifies the form session key.
Triggered before an existing order record is saved to the database. Event handler example:
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onOrderBeforeUpdate', $this, 'process_order_update');
}

public function process_order_update($order, $session_key)
{
  // Perform some check
  if ($order->total > 10000)
    throw new Phpr_ApplicationException('Order total should not exceed $10,000');

  $items = $order->list_related_records_deferred('items', $session_key);
}