SilverCommerce\Postage\Forms\PostageForm
Generate a form that lists available postage options and then saves them to the provided object
Synopsis
class PostageForm
extends Form
{
- // constants
- const DEFAULT_NAME = "PostageForm";
- // members
- protected $country;
- protected $region;
- protected $value;
- protected $weight;
- protected $items;
- protected DataObject $object;
- protected boolean $back_on_no_options = true;
- // methods
- public boolean getBackOnNoOptions()
- public PostageForm setBackOnNoOptions()
- protected bool isValidObject()
- public void __construct()
- protected string getDefaultLocale()
- protected Parcel getParcel()
- protected ArrayList getPossiblePostage()
- public void doSetPostage()
- public DataObject getObject()
- public PostageForm setObject()
Hierarchy
Extends
- SilverStripe\Forms\Form
Constants
Name | Value |
---|---|
DEFAULT_NAME | "PostageForm" |
Members
protected
- $back_on_no_options
—
boolean
Should this form redirect back if no postage options are available? - $country
—
string
The current country as a 2 character string - $items
—
int
Total number of items to calculate postage against - $object
—
SilverStripe\ORM\DataObject
The current object to apply postage to - $region
—
string
The current region, in ISO-3166-2 format - $value
—
float
Total value to calculate postage against - $weight
—
float
Total weight to calculate postage against
Methods
protected
- getDefaultLocale() — Return the default locale of the site (as a 2 character code)
- getParcel() — Create a parcel from the current data
- getPossiblePostage() — Get postage that is available based on the country and region submitted
- isValidObject() — Is the provided object suitable for use (does it exist and does it implement PostageExtension)
public
- __construct() — Construct this form
- doSetPostage() — Method that deals with get postage details and setting the postage
- getBackOnNoOptions() — Get should this form redirect back if no postage options are available?
- getObject() — Get the current object to apply postage to
- setBackOnNoOptions() — Set should this form redirect back if no postage options are available?
- setObject() — Set the current object to apply postage to