\CarrierCore

Summary

Methods
Properties
Constants
__construct()
add()
delete()
setConfiguration()
getDeliveryPriceByWeight()
checkDeliveryPriceByWeight()
getMaxDeliveryPriceByWeight()
getDeliveryPriceByPrice()
checkDeliveryPriceByPrice()
getMaxDeliveryPriceByPrice()
getDeliveryPriceByRanges()
getCarriers()
getIdTaxRulesGroupMostUsed()
getDeliveredCountries()
getDefaultCarrierSelection()
getCarriersForOrder()
checkCarrierZone()
getZones()
getZone()
addZone()
deleteZone()
getGroups()
deleteDeliveryPrice()
addDeliveryPrice()
copyCarrierData()
getCarrierByReference()
isUsed()
getShippingMethod()
getRangeTable()
getRangeObject()
getRangeSuffix()
getIdTaxRulesGroup()
getIdTaxRulesGroupByIdCarrier()
deleteTaxRulesGroup()
setTaxRulesGroup()
getTaxesRate()
getTaxCalculator()
sqlDeliveryRangeShop()
updatePosition()
cleanPositions()
getHigherPosition()
getAvailableCarrierList()
assignGroupToAllCarriers()
setGroups()
$id_reference
$name
$url
$delay
$active
$deleted
$shipping_handling
$range_behavior
$is_module
$is_free
$shipping_method
$shipping_external
$external_module_name
$need_range
$position
$max_width
$max_height
$max_depth
$max_weight
$grade
$definition
PS_CARRIERS_ONLY
CARRIERS_MODULE
CARRIERS_MODULE_NEED_RANGE
PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE
ALL_CARRIERS
SHIPPING_METHOD_DEFAULT
SHIPPING_METHOD_WEIGHT
SHIPPING_METHOD_PRICE
SHIPPING_METHOD_FREE
SORT_BY_PRICE
SORT_BY_POSITION
SORT_BY_ASC
SORT_BY_DESC
No protected methods found
$price_by_weight
$price_by_weight2
$price_by_price
$price_by_price2
$cache_tax_rule
$webserviceParameters
N/A
No private methods found
No private properties found
N/A

Constants

PS_CARRIERS_ONLY

PS_CARRIERS_ONLY

getCarriers method filter

CARRIERS_MODULE

CARRIERS_MODULE

CARRIERS_MODULE_NEED_RANGE

CARRIERS_MODULE_NEED_RANGE

PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE

PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE

ALL_CARRIERS

ALL_CARRIERS

SHIPPING_METHOD_DEFAULT

SHIPPING_METHOD_DEFAULT

SHIPPING_METHOD_WEIGHT

SHIPPING_METHOD_WEIGHT

SHIPPING_METHOD_PRICE

SHIPPING_METHOD_PRICE

SHIPPING_METHOD_FREE

SHIPPING_METHOD_FREE

SORT_BY_PRICE

SORT_BY_PRICE

SORT_BY_POSITION

SORT_BY_POSITION

SORT_BY_ASC

SORT_BY_ASC

SORT_BY_DESC

SORT_BY_DESC

Properties

$id_reference

$id_reference : integer

Type

integer — common id for carrier historization

$name

$name : string

Type

string — Name

$url

$url : string

Type

string — URL with a '@' for

$delay

$delay : string

Type

string — Delay needed to deliver customer

$active

$active : boolean

Type

boolean — Carrier statuts

$deleted

$deleted : boolean

Type

boolean — True if carrier has been deleted (staying in database as deleted)

$shipping_handling

$shipping_handling : boolean

Type

boolean — Active or not the shipping handling

$range_behavior

$range_behavior : integer

Type

integer — Behavior taken for unknown range

$is_module

$is_module : boolean

Type

boolean — Carrier module

$is_free

$is_free : boolean

Type

boolean — Free carrier

$shipping_method

$shipping_method : integer

Type

integer — shipping behavior: by weight or by price

$shipping_external

$shipping_external : boolean

Type

boolean — Shipping external

$external_module_name

$external_module_name : string

Type

string — Shipping external

$need_range

$need_range : boolean

Type

boolean — Need Range

$position

$position : integer

Type

integer — Position

$max_width

$max_width : integer

Type

integer — maximum package width managed by the transporter

$max_height

$max_height : integer

Type

integer — maximum package height managed by the transporter

$max_depth

$max_depth : integer

Type

integer — maximum package deep managed by the transporter

$max_weight

$max_weight : integer

Type

integer — maximum package weight managed by the transporter

$grade

$grade : integer

Type

integer — grade of the shipping delay (0 for longest, 9 for shortest)

$definition

$definition : 

Type

$price_by_weight

$price_by_weight : 

Type

$price_by_weight2

$price_by_weight2 : 

Type

$price_by_price

$price_by_price : 

Type

$price_by_price2

$price_by_price2 : 

Type

$cache_tax_rule

$cache_tax_rule : 

Type

$webserviceParameters

$webserviceParameters : 

Type

Methods

__construct()

__construct(  $id = null,   $id_lang = null) 

Parameters

$id
$id_lang

add()

add(  $autodate = true,   $null_values = false) 

Parameters

$autodate
$null_values

delete()

delete() 

setConfiguration()

setConfiguration(integer  $id_old) 

Change carrier id in delivery prices when updating a carrier

Parameters

integer $id_old

Old id carrier

getDeliveryPriceByWeight()

getDeliveryPriceByWeight(  $total_weight, integer  $id_zone) : float

Get delivery prices for a given order

Parameters

$total_weight
integer $id_zone

Zone id (for customer delivery address)

Returns

float —

Delivery price

checkDeliveryPriceByWeight()

checkDeliveryPriceByWeight(  $id_carrier,   $total_weight,   $id_zone) 

Parameters

$id_carrier
$total_weight
$id_zone

getMaxDeliveryPriceByWeight()

getMaxDeliveryPriceByWeight(  $id_zone) 

Parameters

$id_zone

getDeliveryPriceByPrice()

getDeliveryPriceByPrice(  $order_total, integer  $id_zone,   $id_currency = null) : float

Get delivery prices for a given order

Parameters

$order_total
integer $id_zone

Zone id (for customer delivery address)

$id_currency

Returns

float —

Delivery price

checkDeliveryPriceByPrice()

checkDeliveryPriceByPrice(  $id_carrier,   $order_total, integer  $id_zone, integer  $id_currency = null) : float

Check delivery prices for a given order

Parameters

$id_carrier
$order_total
integer $id_zone

Zone id (for customer delivery address)

integer $id_currency

Returns

float —

Delivery price

getMaxDeliveryPriceByPrice()

getMaxDeliveryPriceByPrice(  $id_zone) 

Parameters

$id_zone

getDeliveryPriceByRanges()

getDeliveryPriceByRanges(  $range_table,   $id_carrier) : array

Get delivery prices for a given shipping method (price/weight)

Parameters

$range_table
$id_carrier

Returns

array —

Delivery prices

getCarriers()

getCarriers(integer  $id_lang, boolean  $active = false,   $delete = false,   $id_zone = false,   $ids_group = null,   $modules_filters = self::PS_CARRIERS_ONLY) : array

Get all carriers in a given language

Parameters

integer $id_lang

Language id

boolean $active

Returns only active carriers when true

$delete
$id_zone
$ids_group
$modules_filters

Returns

array —

Carriers

getIdTaxRulesGroupMostUsed()

getIdTaxRulesGroupMostUsed() 

getDeliveredCountries()

getDeliveredCountries(  $id_lang,   $active_countries = false,   $active_carriers = false,   $contain_states = null) 

Parameters

$id_lang
$active_countries
$active_carriers
$contain_states

getDefaultCarrierSelection()

getDefaultCarrierSelection(array  $carriers,   $default_carrier) : \number

Return the default carrier to use

Parameters

array $carriers
$default_carrier

Returns

\number —

the id of the default carrier

getCarriersForOrder()

getCarriersForOrder(integer  $id_zone, Array  $groups = null,   $cart = null) : Array

Parameters

integer $id_zone
Array $groups

group of the customer

$cart

Returns

Array

checkCarrierZone()

checkCarrierZone(  $id_carrier,   $id_zone) 

Parameters

$id_carrier
$id_zone

getZones()

getZones() : array

Get all zones

Returns

array —

Zones

getZone()

getZone(  $id_zone) : array

Get a specific zones

Parameters

$id_zone

Returns

array —

Zone

addZone()

addZone(  $id_zone) 

Add zone

Parameters

$id_zone

deleteZone()

deleteZone(  $id_zone) 

Delete zone

Parameters

$id_zone

getGroups()

getGroups() : array

Gets a specific group

Returns

array —

Group

deleteDeliveryPrice()

deleteDeliveryPrice(  $range_table) : boolean

Clean delivery prices (weight/price)

Parameters

$range_table

Returns

boolean —

Deletion result

addDeliveryPrice()

addDeliveryPrice(  $price_list,   $delete = false) : boolean

Add new delivery prices

Parameters

$price_list
$delete

Returns

boolean —

Insertion result

copyCarrierData()

copyCarrierData(  $old_id) 

Copy old carrier informations when update carrier

Parameters

$old_id

getCarrierByReference()

getCarrierByReference(  $id_reference) 

Get carrier using the reference id

Parameters

$id_reference

isUsed()

isUsed() : integer

Check if carrier is used (at least one order placed)

Returns

integer —

Order count for this carrier

getShippingMethod()

getShippingMethod() 

getRangeTable()

getRangeTable() 

getRangeObject()

getRangeObject(  $shipping_method = false) 

Parameters

$shipping_method

getRangeSuffix()

getRangeSuffix(  $currency = null) 

Parameters

$currency

getIdTaxRulesGroup()

getIdTaxRulesGroup(\Context  $context = null) 

Parameters

\Context $context

getIdTaxRulesGroupByIdCarrier()

getIdTaxRulesGroupByIdCarrier(  $id_carrier, \Context  $context = null) 

Parameters

$id_carrier
\Context $context

deleteTaxRulesGroup()

deleteTaxRulesGroup(array  $shops = null) 

Parameters

array $shops

setTaxRulesGroup()

setTaxRulesGroup(  $id_tax_rules_group,   $all_shops = false) 

Parameters

$id_tax_rules_group
$all_shops

getTaxesRate()

getTaxesRate(\Address  $address) : 

Returns the taxes rate associated to the carrier

Parameters

\Address $address

Returns

getTaxCalculator()

getTaxCalculator(\Address  $address) : 

Returns the taxes calculator associated to the carrier

Parameters

\Address $address

Returns

sqlDeliveryRangeShop()

sqlDeliveryRangeShop(  $range_table,   $alias = 'd') : string

This tricky method generates a sql clause to check if ranged data are overloaded by multishop

Parameters

$range_table
$alias

Returns

string

updatePosition()

updatePosition(boolean  $way, integer  $position) : boolean

Moves a carrier

Parameters

boolean $way

Up (1) or Down (0)

integer $position

Returns

boolean —

Update result

cleanPositions()

cleanPositions() : boolean

Reorders carrier positions.

Called after deleting a carrier.

Returns

boolean —

$return

getHigherPosition()

getHigherPosition() : integer

Gets the highest carrier position

Returns

integer —

$position

getAvailableCarrierList()

getAvailableCarrierList(\Product  $product,   $id_warehouse,   $id_address_delivery = null,   $id_shop = null,   $cart = null) : array

For a given {product, warehouse}, gets the carrier available

Parameters

\Product $product

The id of the product, or an array with at least the package size and weight

$id_warehouse
$id_address_delivery
$id_shop
$cart

Returns

array

assignGroupToAllCarriers()

assignGroupToAllCarriers(integer|array  $id_group_list, array  $exception = null) 

Assign one (ore more) group to all carriers

Parameters

integer|array $id_group_list

group id or list of group ids

array $exception

list of id carriers to ignore

setGroups()

setGroups(  $groups,   $delete = true) 

Parameters

$groups
$delete