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

Triggered by Shop_ShippingOption
Author LemonStand eCommerce Inc.

Event handler signature

public array event_onFilterShippingOptions(array $params)
$params array specifies the method parameters.
{return} array returns updated list of shipping options.
Allows to filter the shipping option list before it is displayed on the checkout pages. The event handler should accept a single parameter - the options array. The array contains the following fields:
  • options - a array of shipping options. Each element is the Shop_ShippingOption object.
  • 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.
  • order_items - a list of order items (Shop_OrderItem or Shop_CartItem objects, depending on the caller context).
  • customer_group_id - identifier of the customer group.
The handler should return an updated options array. Note, that for multi-option shipping methods (like USPS) you may need to update the $sub_options property.
Usage example:
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onFilterShippingOptions', $this, 'filter_shipping_options');
}

public function filter_shipping_options($params)
{
  // Remove option with the "post" API key

  $result = array();
  foreach ($params['options'] as $option)
  {
    if ($option->ls_api_code != 'post')
      $result[$option->id] = $option;
  }

  return $result;
}