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

Triggered by Shop_ShippingOption
Author LemonStand eCommerce Inc.

Event handler signature

public array event_onUpdateShippingQuote(Shop_ShippingOption $shipping_option, array $params)
$shipping_option Shop_ShippingOption specifies the shipping option object.
$params array specifies the method parameters.
{return} array returns updated shipping quote.
Allows to update a shipping quote calculated by a regular shipping method. The event handler should accept 2 parameters - the Shop_ShippingOption object and an array of shipping parameters. The event handler should return updated shipping quote. The $params array contains the following elements:
  • quote - the original shipping quote.
  • option_id - for multi-option shipping methods only (like USPS) - service-specific identifier of the shipping option.
  • option_name - for multi-option shipping methods only (like USPS) - service-specific name of the shipping option.
  • shipping_option - the Shop_ShippingOption object which returned the original quote.
  • handling_fee - the handling fee, defined in the shipping method.
  • country_id - shipping country identifier.
  • state_id - shipping state identifier.
  • zip - shipping ZIP/Postal code.
  • city - shipping city.
  • total_price - total price of all order items.
  • total_volume - total volume of all order items.
  • total_weight - total weight of all order items.
  • total_item_num - total number of order items.
  • cart_items - a list of shopping cart items. An array of Shop_CartItem or Shop_OrderItem objects, depending on the caller context. When processing existing orders, LemonStand can automatically convert order items to cart items. In this case the reference to the original order item is stored in the $order_item field of the cart item object.
Event handler example:
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onUpdateShippingQuote', $this, 'update_shipping_quote');
}

public function update_shipping_quote($shipping_option, $params)
{
  return $params['quote']*2;
}