\ShippingCalculator
Shipping calculator is a basic helper class that can be used to query the shipping table.
At the moment we only output shipping areas based on weight/cost/
items and location. Buit this can now be expanded more easily if
needed.
- Author: ilateral (info@ilateral.co.uk)
Synopsis
class ShippingCalculator
extends Object
{
- // members
- private $country_code;
- private $zipcode;
- private Float $cost = 0.0;
- private Float $weight = 0;
- private Float $items = 0;
- private Float $include_wildcards = true;
- // methods
- public void setCountryCode()
- public void getCountryCode()
- public void setZipCode()
- public void getZipCode()
- public void setCost()
- public void getCost()
- public void setWeight()
- public void getWeight()
- public void setItems()
- public void getItems()
- public void setWildcards()
- public void getWildcards()
- public void __construct()
- protected string locale()
- public ArrayList getPostageAreas()
Hierarchy
Extends
- Object
Members
private
- $cost
—
Float
The total cost we will be checking the cart against - $country_code
—
string
2 character country code - $include_wildcards
—
Float
The total numbers of items to check against - $items
—
Float
The total numbers of items to check against - $weight
—
Float
The total weight to check against - $zipcode
—
string
Zip/postal code for the search
Methods
protected
- locale() — Get the locale of the Member, or if we're not logged in or don't have a locale, use the default one
public
- __construct() — Simple constructor that sets the country code and zip. If no country is set, this class attempts to autodetect.
- getCost()
- getCountryCode()
- getItems()
- getPostageAreas() — Find relevent postage rates, based on supplied: - Country - Zip/postal code - Weight - Cost - Number of Items
- getWeight()
- getWildcards()
- getZipCode()
- setCost()
- setCountryCode()
- setItems()
- setWeight()
- setWildcards()
- setZipCode()