SilverCart\Model\Shipment\ShippingFee
A carrier has many shipping fees.
They mainly depend on the freights weight.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class ShippingFee
extends DataObject
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $casting = ;
- private static string $default_sort = "priority DESC";
- private static string $table_name = 'SilvercartShippingFee';
- protected bool $getCMSFieldsIsCalled = false;
- protected Tax $cachedTax = NULL;
- protected array $freeOfShippingCostsFromCache = ;
- protected array $shippingIsFreeCache = ;
- // methods
- public string singular_name()
- public string plural_name()
- public array summaryFields()
- public array fieldLabels()
- public string getMaximumWeightLimitedOrNot()
- public SearchContext getDefaultSearchContext()
- public FieldList getCMSFields()
- public string PriceFormattedForDetailViewProduct()
- public string PriceFormatted()
- public string getPriceFormatted()
- public string getPriceFormattedPlain()
- public string AttributedShippingMethods()
- public Tax Tax()
- public int getTaxRate()
- public float getTaxAmount()
- public false|string getFeeWithCarrierAndShippingMethod()
- public DBMoney getCalculatedPrice()
- public DBMoney getPrice()
- public DBMoney getOriginalPrice()
- public DBMoney getOriginalPriceGross()
- public DBMoney getOriginalPriceNet()
- public float getPriceAmount()
- public bool UseFreeOfShippingCostsFrom()
- public DBMoney FreeOfShippingCostsFrom()
- public bool ShippingIsFree()
- public string getPriceCurrency()
- public string getMaximumWeightNice()
- public string getMaximumWeightUnitAbreviation()
- public string getMaximumWeightUnitAbbreviation()
- public string getDeliveryTime()
- public string getTitle()
- // 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
- $casting
—
array
Virtual database fields. - $db
—
array
Attributes. - $default_sort
—
string
Default sort field and direction - $has_many
—
array
Has-many Relationship. - $has_one
—
array
Has-one relationships. - $table_name
—
string
DB table name
protected
- $cachedTax
—
SilverCart\Model\Product\Tax
Cached Tax object. The related tax object will be stored in this property after its first call. - $defaultFieldLabels
—
array
Default field labels. - $freeOfShippingCostsFromCache
—
array
Contains all requested free of shipping costs from properties by country. - $getCMSFieldsIsCalled
—
SilverCart\Model\Shipment\bool
Marker to check whether the CMS fields are called or not - $shippingIsFreeCache
—
array
Contains all requested shipping is free properties by country.
Methods
public
- AttributedShippingMethods() — Returns the attributed shipping methods as string (limited to 150 chars).
- FreeOfShippingCostsFrom() — Returns needed value for free shipping
- PriceFormatted() — Returns the Price formatted by locale.
- PriceFormattedForDetailViewProduct() — Returns the Price for the current detail product formatted by locale.
- ShippingIsFree() — Returns whether shipping is free for the given amount and country
- Tax() — Returns the related Tax object.
- UseFreeOfShippingCostsFrom() — Returns whether to use free shipping costs or not
- fieldLabels() — i18n for field labels
- getCMSFields() — Customizes the backends fields, mainly for ModelAdmin
- getCalculatedPrice() — Returns the price for this shipping fee.
- getDefaultSearchContext() — Set a custom search context for fields like "greater than", "less than", etc.
- getDeliveryTime() — Returns the delivery time as string.
- getFeeWithCarrierAndShippingMethod() — helper method for displaying a fee in a dropdown menu
- getMaximumWeightLimitedOrNot() — Returns the maximum weight or a hint, that this fee is unlimited.
- getMaximumWeightNice() — Returns the maximum weight with unit abreviation in context of Config::DisplayWeightsInKilogram().
- getMaximumWeightUnitAbbreviation() — Returns the maximum weights unit abreviation in context of Config::DisplayWeightsInKilogram().
- getMaximumWeightUnitAbreviation() — Returns the maximum weights unit abreviation in context of Config::DisplayWeightsInKilogram().
- getOriginalPrice() — Returns the fee's original price gross or net dependent on the current price type context.
- getOriginalPriceGross() — Returns the fee's original price gross.
- getOriginalPriceNet() — Returns the fee's original price net.
- getPrice() — Returns the price.
- getPriceAmount() — Returns the prices amount
- getPriceCurrency() — Returns the prices currency
- getPriceFormatted() — Returns the Price formatted by locale.
- getPriceFormattedPlain() — Returns the Price formatted by locale.
- getTaxAmount() — returns the tax amount included in $this
- getTaxRate() — Returns the tax rate for this fee.
- getTitle() — Title to show in CMS.
- plural_name() — Returns the translated plural name of the object.
- singular_name() — Returns the translated singular name of the object.
- summaryFields() — i18n for 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.