Package DE_EPAGES::Shipping::API::Object::ShippingMethod
object interface for ShippingMethod.
Base |
DE_EPAGES::Object::API::Object::Object |
Functions
- canDelete
- className
- dbPackage
- discount
- exportXMLAttributes
- featureName
- getLevels
- levels
- price
- setLevels
- usableAtStorefront
canDelete
In case of the default shipping method a warning is added. The default shipping method can't be deleted.
Syntax |
$Object->canDelete($aWarnings); |
Input |
|
className
Returns the class name, used for DAL access.
Syntax |
$ClassName = $ShippingMethod->className; |
Return |
|
dbPackage
Returns the database package, used for DAL access.
Syntax |
$DbPackage = $ShippingMethod->dbPackage; |
Return |
|
discount
Returns the shipping discount by the given requirements. The hook 'ShippingDiscount' is triggered before the standard discount = 0.
Syntax |
$ShippingDiscount = $Object->discount( $hVars ); |
Example |
$ShippingDiscount = $ShippingMethod->discount( { CurrencyID => 'USD', TaxModel => $ShippingMethod->getSite()->get('TaxModel') } ); |
Input |
|
Return |
|
exportXMLAttributes
Returns plain attributes of object to XML export driver. This function removes bit attributes with value 0.
Syntax |
$hAttributes = $Object->exportXMLAttributes( $Driver, $hAllAttributes ); |
Input |
|
Return |
|
featureName
Returns the feature name.
Syntax |
$FeatureName = $ShippingMethod->featureName; |
Return |
|
getLevels
Return the shipping levels for the given currency in the requested tax model.
Syntax |
$ahLevels = $Object->getLevels($CurrencyID, $TaxModel); $ahLevels = $Object->getLevels($CurrencyID, $TaxModel, $ExtraPrecision); |
Input |
|
Return |
|
levels
Returns all shipping level objects of that shipping method.
Syntax |
$aShippingLevels = $Object->levels; |
Return |
|
price
Returns the shipping price by the given requirements. Needs to be implemented for a new shipping method.
Syntax |
$ShippingPrice = $Object->price( $hVars ); |
Example |
$Product = LoadObjectByPath('/Shops/DemoShop/Products/0815'); $ShippingPrice = $ShippingPrice = $ShippingMethod->price({ 'CurrencyID' => 'EUR', 'TaxModel' => 1, 'ShippingElements' => [ { 'Element' => $Product, 'Quantity' => 1, } ] }); |
Input |
|
Return |
|
setLevels
Sets all shipping levels for the given currency. Deletes shipping levels that are not included in the list. Calculates net prices from gross prices if $TaxModel is TAX_MODEL_GROSS.
Syntax |
$Object->setLevels($CurrencyID, $TaxModel, $ahLevels); |
Input |
|
usableAtStorefront
Tests if a shipping method with the given currency is visible in the storefront. Uses function DE_EPAGES::Shipping::API::Object::ShippingMethod::price to evaluate if shipping methode has a price (price can be 0).
Syntax |
$Usable = $ShippingMethod->usableAtStorefront($hVars); |
Input |
|
Return |
|