LemonStand Documentation

Shop_ShippingOption

The Shop_ShippingOption class represents a shipping option, which you can create on the Shop/Shipping Options page. You can access an instance of the Shop_ShippingOption class through the $shipping_method field of the Shop_Order class, when you develop the Order Details page. Also, a collection of objects of that class is available on the Shipping Method step of the Checkout process.

Parent class: Db_ActiveRecord

Class fields

  • $name – the shipping option name
  • $description – the shipping option description in plain text format. Please use the h function when you output a shipping option description to escape HTML-sensitive characters.
  • $taxable – determines whether tax is applicable for the shipping option
  • $quote – a shipping quote. This field make sense and has value only during the Checkout process.
  • $is_free - indicates whether the shipping option is free
  • $multi_option - indicates whether the option has sub-options. Some shipping methods can have multiple options, for example UPS Standard and UPS Express.
  • $sub_options - a list of sub-options of a multi-option shipping method. An array-type variable. Each element of the array is an object with the following fields: $name, $quote, $is_free and $id.
  • $ls_api_code - LemonStand API code. You can manage a value of this field on the Shop/Shipping Options/Edit Shipping Option page.
  • $error_hint - contains an error message returned by the shipping service provider. By default LemonStand does not return shipping options with errors. You can enable this feature on the System/Settings/Shipping Configuration page, on the Parameters tab. If this field is not empty, its content should be displayed instead of the option price and radio button.

Class methods

  • static find_by_api_code($code) - finds a shipping option by the API code. This method allows you to find specific shipping options. You can assign the LemonStand API Code to any shipping option in the shipping option configuration form.

See also:

Next: site_url
Previous: Shop_ProductReview
Return to Reference