SilverCart\Model\Shipment\ShippingMethod
These are the shipping methods the shop offers.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class ShippingMethod
extends DataObject
{
- // members
- private static bool $include_saturdays_in_delivery_time = true;
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $many_many = ;
- private static array $belongs_many_many = ;
- private static array $casting = ;
- private static string $table_name = 'SilvercartShippingMethod';
- private static bool $api_access = true;
- private static string $default_sort = "priority ASC";
- private static bool $insert_translation_cms_fields = true;
- private static string $insert_translation_cms_fields_before = 'CarrierID';
- protected Address $shippingAddress = NULL;
- protected Country $shippingCountry = NULL;
- protected array $shippingFees = ;
- // methods
- public array searchableFields()
- public array fieldLabels()
- public array summaryFields()
- public string singular_name()
- public string plural_name()
- public array excludeFromScaffolding()
- public FieldList getCMSFields()
- public bool getShowOnShippingFeesPage()
- public $this setShippingFeeByID()
- public $this setShippingFee()
- public ShippingFee getShippingFee()
- public ShippingFee detectShippingFee()
- public string getDescription()
- public string getDescriptionForShippingFeesPage()
- public string getTitle()
- public string getTitleWithCarrierAndFee()
- public false|string getTitleWithCarrier()
- public string getDeliveryTime()
- public string getDeliveryTimeMinDate()
- public string getDeliveryTimeMaxDate()
- public static string get_delivery_time()
- public static string get_delivery_time_for()
- protected static boolean isInCheckoutContextWithPrepayment()
- protected static boolean isInCheckoutContextWithReleaseDate()
- public string AttributedCustomerGroups()
- public string AttributedZones()
- public string AttributedZoneIDs()
- public string AttributedPaymentMethods()
- public CheckboxField activatedStatus()
- public boolean hasFeeWithPostPricing()
- public static ArrayList getAllowedShippingMethods()
- public static ArrayList getAllowedShippingMethodsForOverview()
- public static DataList getAllowedShippingMethodsBase()
- public static ArrayList getAllowedShippingFeesFor()
- public static ShippingFee getAllowedShippingFeeFor()
- public static ArrayList filterShippingMethods()
- public Address getShippingAddress()
- public void setShippingAddress()
- public Country getShippingCountry()
- public void setShippingCountry()
- // Inherited methods from ExtensibleDataObject
- protected void beforeRequireDefaultRecords()
- protected void beforeUpdateCMSActions()
- protected void beforeUpdateFieldLabels()
- protected void beforeUpdateProvidePermissions()
- public array defaultFieldLabels()
- public static void reset_field_labels()
- protected array scaffoldFieldLabels()
Hierarchy
Members
private
- $api_access
—
SilverCart\Model\Shipment\bool
Grant API access on this item. - $belongs_many_many
—
array
Belongs-many-many relationships. - $casting
—
array
Virtual database columns. - $db
—
array
Attributes. - $default_sort
—
string
Default sort field and direction - $has_many
—
array
Has-many relationship. - $has_one
—
array
Has-one relationships. - $include_saturdays_in_delivery_time
—
SilverCart\Model\Shipment\bool
Configuration property to determine whether to include Saturdays into the amount of days for the delivery time by default. - $insert_translation_cms_fields
—
SilverCart\Model\Shipment\bool
Determines to insert the translation CMS fields by TranslatableDataObjectExtension. - $insert_translation_cms_fields_before
—
string
Determines to insert the translation CMS fields before this field. - $many_many
—
array
Many-many relationships. - $table_name
—
string
DB table name
protected
- $defaultFieldLabels
—
array
Default field labels. - $shippingAddress
—
SilverCart\Model\Customer\Address
Shipping address - $shippingCountry
—
SilverCart\Model\Customer\Country
Shipping country - $shippingFees
—
array
Shipping fees by weight
Methods
protected
- isInCheckoutContextWithPrepayment() — Returns whether the current application context is in checkout with prepayment as payment method.
- isInCheckoutContextWithReleaseDate() — Returns whether the current application context is in checkout while having a product with a release date in shopping cart.
public
- AttributedCustomerGroups() — Returns the attributed customer groups as string (limited to 150 chars).
- AttributedPaymentMethods() — Returns the attributed payment methods as string (limited to 150 chars).
- AttributedZoneIDs() — Returns the attributed zones as string (limited to 150 chars).
- AttributedZones() — Returns the attributed zones as string (limited to 150 chars).
- activatedStatus() — Returns the activation status as HTML-Checkbox-Tag.
- detectShippingFee() — determins the right shipping fee for a shipping method depending on the cart's weight and the country of the customers shipping address
- excludeFromScaffolding() — Returns an array of field/relation names (db, has_one, has_many, many_many, belongs_many_many) to exclude from form scaffolding in backend.
- fieldLabels() — Sets the field labels.
- filterShippingMethods() — Filters the given shipping methods by default permission criteria
- getAllowedShippingFeeFor() — Returns the first allowed shipping fee in the given products, countries and customer groups context.
- getAllowedShippingFeesFor() — Returns all allowed shipping fees in the given products, countries and customer groups context.
- getAllowedShippingMethods() — Returns allowed shipping methods. Those are active
- getAllowedShippingMethodsBase() — Returns allowed shipping methods. Those are active
- getAllowedShippingMethodsForOverview() — Returns allowed shipping methods. Those are active
- getCMSFields() — customizes the backends fields, mainly for ModelAdmin
- getDeliveryTime() — Returns the delivery time as string.
- getDeliveryTimeMaxDate() — Returns the delivery time max as a date string.
- getDeliveryTimeMinDate() — Returns the delivery time min as a date string.
- getDescription() — getter for the shipping methods title
- getDescriptionForShippingFeesPage() — getter for the shipping methods DescriptionForShippingFeesPage
- getShippingAddress() — Returns the shipping address
- getShippingCountry() — Returns the shipping country
- getShippingFee() — Returns the shipping fee for the given weight.
- getShowOnShippingFeesPage() — Returns whether to show this shipping method on shipping fees page.
- getTitle() — getter for the shipping methods title
- getTitleWithCarrier() — pseudo attribute
- getTitleWithCarrierAndFee() — pseudo attribute which can be called with $this->TitleWithCarrierAndFee
- get_delivery_time() — Returns the delivery time as string.
- get_delivery_time_for() — Returns the delivery time as string.
- hasFeeWithPostPricing() — Checks whether this shipping method has a fee with activated post pricing
- plural_name() — Returns the translated plural name of the object. If no translation exists the class name will be returned.
- searchableFields() — Searchable fields
- setShippingAddress() — Sets the shipping address
- setShippingCountry() — Sets the shipping country
- setShippingFee() — Sets the shipping fee by weight.
- setShippingFeeByID() — Sets the shipping fee by ID and weight.
- singular_name() — Returns the translated singular name of the object. If no translation exists the class name will be returned.
- summaryFields() — Sets the summary fields.
Inherited from SilverCart\ORM\ExtensibleDataObject
protected
- beforeRequireDefaultRecords() — Allows user code to hook into DataObject::requireDefaultRecords() prior to requireDefaultRecords being called on extensions.
- beforeUpdateCMSActions() — Allows user code to hook into DataObject::getCMSActions prior to updateCMSActions being called on extensions.
- beforeUpdateFieldLabels() — Allows user code to hook into DataObject::fieldLabels() prior to updateFieldLabels being called on extensions.
- beforeUpdateProvidePermissions() — Allows user code to hook into DataObject::updateProvidePermissions() prior to providePermissions being called on extensions.
- scaffoldFieldLabels() — Returns the default field labels for this DataObject.
public
- defaultFieldLabels() — Returns the default field labels.
- reset_field_labels() — Resets the field label cache.