Overview

Packages

  • akismet
  • None
  • PHP
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • plugins
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Signatures
    • Signed
    • Transport
  • wa-apps
    • blog
      • actions
        • backend
        • blog
        • comment
        • cron
        • design
        • frontend
        • page
        • plugin
        • post
      • api
        • v1
      • cli
      • layout
      • model
      • plugin
        • aksimet
        • category
        • emailsubscription
        • favorite
        • gravatar
        • import
        • markdown
        • myposts
        • tag
        • troll
      • settings
    • checklists
      • backend
      • json
    • contacts
      • backend
    • developer
    • dummy
    • guestbook
    • guestbook2
    • photos
      • album
      • api
        • v1
      • backend
      • design
      • dialog
      • frontend
      • page
      • photo
      • plugin
        • comment
        • imageeffects
        • import
        • publicgallery
        • watermark
      • search
      • settings
      • stack
      • tag
      • upload
    • site
      • backend
      • blocks
      • config
      • design
      • domains
      • files
      • frontend
      • helper
      • layout
      • pages
      • routing
      • setting
    • stickies
      • api
        • v1
      • sheet
      • stiky
  • wa-plugin
    • payment
    • shipping
    • sms
  • wa-plugins
    • shipping
      • usps
  • wa-system
    • API
    • Auth
      • Adapters
    • Autoload
    • Cache
      • Adapter
    • Captcha
    • Config
    • Contact
    • controller
    • currency
    • database
    • datetime
    • design
    • event
    • exception
    • files
    • image
    • layout
    • locale
    • log
    • mail
    • page
      • action
      • model
    • payment
    • plugin
    • request
    • response
    • routing
    • shipping
    • sms
    • storage
    • user
    • util
    • validator
    • view
    • webasyst
      • api
      • backend
      • cli
      • config
      • layout
      • login
      • model
      • password
      • payment
      • profile
      • settings
      • shipment
    • widget
    • workflow
  • waPlugins
    • Payment
  • webasyst
    • wa-system
      • helper

Classes

  • australiapostShipping
  • canadapostShipping
  • courierShipping
  • dhlShipping
  • emsruShipping
  • fedexShipping
  • flatrateShipping
  • pickupShipping
  • russianpostShipping
  • upsShipping
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class flatrateShipping

Flat-rate shipping plugin.

waSystemPlugin
Extended by waShipping
Extended by flatrateShipping
Package: wa-plugin\shipping
Located at wa-plugins/shipping/flatrate/lib/flatrateShipping.class.php
Methods summary
public mixed
# calculate( )

Main shipping rate calculation method. Returns array of estimated shipping rates and transit times. or error message to be displayed to customer, or false, if this shipping option must not be available under certain conditions.

Main shipping rate calculation method. Returns array of estimated shipping rates and transit times. or error message to be displayed to customer, or false, if this shipping option must not be available under certain conditions.

Returns

mixed

Example

<pre> //return array of shipping options return array( 'option_id1' => array( 'name' => $this->_w('...'), 'description' => $this->_w('...'), 'est_delivery' => '...', 'currency' => $this->currency, 'rate' => $this->cost, ), ... ); //return error message return 'Для расчета стоимости доставки укажите регион доставки'; //shipping option is unavailable return false;</pre> Useful parent class (waShipping) methods to be used in calculate() method: <pre> // total package price $price = $this->getTotalPrice(); // total package weight $weight = $this->getTotalWeight(); // order items array $items = $this->getItems(); // obtain either full address info array or specified address field value $address = $this->getAddress($field = null);</pre>
public array|string
# allowedCurrency( )

Returns ISO3 code of the currency (or array of ISO3 codes) this plugin supports.

Returns ISO3 code of the currency (or array of ISO3 codes) this plugin supports.

Returns

array|string

See

waShipping::allowedCurrency()
public array|string
# allowedWeightUnit( )

Returns the weight unit (or array of weight units) this plugin supports.

Returns the weight unit (or array of weight units) this plugin supports.

Returns

array|string

See

waShipping::allowedWeightUnit()
public string
# tracking( string $tracking_id = null )

Returns general tracking information (HTML).

Returns general tracking information (HTML).

Parameters

$tracking_id
string
$tracking_id Optional tracking id specified by user.

Returns

string

See

waShipping::tracking()

Example

return _wp('Online shipment tracking: link.');

Overrides

waShipping::tracking()
public array
# getPrintForms( waOrder $order = null )

Returns array of printable forms this plugin offers

Returns array of printable forms this plugin offers

Parameters

$order
waOrder
$order Object containing order data

Returns

array

Example

return <pre>array( 'form_id' => array( 'name' => _wp('Printform name'), 'description' => _wp('Printform description'), ), );</pre>

Overrides

waShipping::getPrintForms()
public string
# displayPrintForm( string $id, waOrder $order, array $params = array() )

Returns HTML code of specified printable form.

Returns HTML code of specified printable form.

Parameters

$id
string
$id Printform id as defined in method getPrintForms()
$order
waOrder
$order Order data object
$params
array
$params Optional parameters to be passed to printform generation template

Returns

string
Printform HTML

Throws

waException

Overrides

waShipping::displayPrintForm()
public array
# allowedAddress( )

Limits the range of customer addresses to allow shipping to.

Limits the range of customer addresses to allow shipping to.

Returns

array
Return array() to allow shipping anywhere

Example

<pre>return array( 'country' => 'usa', # or array('usa', 'can') 'region' => 'NY', # or array('NY', 'PA', 'CT'); # or omit 'region' item if you do not want to limit shipping to certain regions );</pre>

Overrides

waShipping::allowedAddress()
public array|boolean
# requestedAddressFields( )

Returns array of shipping address fields which must be requested during checkout.

Returns array of shipping address fields which must be requested during checkout.

Returns

array|boolean
Return false if plugin does not request any fields during checkout; return array() if all address fields must be requested

See

waShipping::requestedAddressFields()

Example

<pre>return array( #requested field 'zip' => array(), #hidden field with pre-defined value; 'country' => array('hidden' => true, 'value' => 'rus', 'cost' => true), #'cost' parameter means that field is used for calculation of approximate shipping cost during checkout 'region' => array('cost' => true), 'city' => array(), #field is not requested 'street' => false, );</pre>

Overrides

waShipping::requestedAddressFields()
Methods inherited from waShipping
addItem(), addItems(), customFields(), enumerate(), execCallback(), factory(), flush(), getAdapter(), getAddress(), getCountryISO2Code(), getItems(), getPackageProperty(), getRates(), getTotalPrice(), getTotalWeight(), info(), init(), setAddress(), setItems(), settingCountryControl(), settingCountrySelect(), settingCurrencySelect(), settingRegionZoneControl()
Methods inherited from waSystemPlugin
__construct(), __get(), __isset(), _w(), getDescription(), getId(), getName(), getPath(), getProperties(), getSettings(), getSettingsHTML(), getType(), initControls(), registerControl(), saveSettings(), setSettings()
Constants inherited from waShipping
PLUGIN_TYPE
Properties inherited from waShipping
$app_id
Properties inherited from waSystemPlugin
$id, $key, $path, $type
My fork of Webasyst Framework API documentation generated by ApiGen 2.8.0