Overview

Packages

  • Eabi
    • Dpd
  • None
  • PHP

Classes

  • dpdcodpayment
  • eabi_dpd_courier
  • Eabi_dpd_courierCourierModuleFrontController
  • eabi_dpd_parcelstore
  • eabi_dpd_parcelstore_data_send_executor
  • eabi_dpd_parcelstore_dpd_api
  • eabi_dpd_parcelstore_dpd_helper
  • eabi_dpd_parcelstore_html_helper
  • eabi_dpd_parcelstore_validator_helper
  • Eabi_dpd_parcelstoreCourierModuleFrontController
  • Eabi_Postoffice
  • eabi_postoffice_dialcode_helper
  • Eabi_PostofficePostofficeModuleFrontController

Functions

  • upgrade_module_0_3
  • upgrade_module_0_6
  • upgrade_module_0_8
  • Overview
  • Package
  • Class
  • Tree

Class eabi_dpd_courier

Represents DPD courier shipping method.

Extra order data is stored under specialized order comment

Can perform following business actions:

  • Calculate shipping price based on country and weight
  • Send information about shipment data to DPD server.
  • Call courier to pick up the shipment that was ordered using this carrier.
Module
Extended by eabi_dpd_parcelstore
Extended by eabi_dpd_courier
Author: Matis
Located at eabi_dpd_courier/eabi_dpd_courier.php
Methods summary
protected
# _construct( )

Initiates module. Is used because PrestaShop requires special Module initiation which is done in parent class

Initiates module. Is used because PrestaShop requires special Module initiation which is done in parent class

Overrides

eabi_dpd_parcelstore::_construct()
public array
# getRequestForAutoSendData( OrderCore $order, AddressCore $address, array $selectedOfficeId, boolean $forceCod = false )

Prepares op=order request to be sent via DPD API.

Prepares op=order request to be sent via DPD API.

Parameters

$order
OrderCore
$order Order that is using this carrier
$address
AddressCore
$address address, that is from that order (one order can support multiple addresses)
$selectedOfficeId
array
$selectedOfficeId selected entry from table eabi_postoffice
$forceCod
boolean
$forceCod true if request should be sent as cod request

Returns

array
request that is passed directly to DPD

Overrides

eabi_dpd_parcelstore::getRequestForAutoSendData()
protected boolean
# _install( )

Performs following actions:

  • Registers hook extraCarrier
  • Registers carrier with name eabi_dpdee_courier
  • Registers hook with name paymentConfirm - for auto sending data after payment
  • Registers hook with name actionAdminControllerSetMedia - for adding css,js scripts
  • Registers hook with name displayBackOfficeFooter - for adding call to courier button
  • Registers hook with name displayHeader - for adding css,js scripts
  • Registers hook with name displayFooter - for removing shipping methods at onepage checkouts, if HOOK_EXTRACARRIER is not called

Performs following actions:

  • Registers hook extraCarrier
  • Registers carrier with name eabi_dpdee_courier
  • Registers hook with name paymentConfirm - for auto sending data after payment
  • Registers hook with name actionAdminControllerSetMedia - for adding css,js scripts
  • Registers hook with name displayBackOfficeFooter - for adding call to courier button
  • Registers hook with name displayHeader - for adding css,js scripts
  • Registers hook with name displayFooter - for removing shipping methods at onepage checkouts, if HOOK_EXTRACARRIER is not called

Returns

boolean

Overrides

eabi_dpd_parcelstore::_install()
protected boolean
# _uninstall( )

Performs following actions:

  • Unregisters hook extraCarrier
  • Removes carrier with name eabi_dpdee_courier
  • Unregisters hook with name paymentConfirm
  • Unregisters hook with name actionAdminControllerSetMedia
  • Unregisters hook with name displayBackOfficeFooter
  • Unregisters hook with name displayHeader
  • Unregisters hook with name displayFooter
  • If dataSendExecutor is available, then uninstall() method will be called on same object

Performs following actions:

  • Unregisters hook extraCarrier
  • Removes carrier with name eabi_dpdee_courier
  • Unregisters hook with name paymentConfirm
  • Unregisters hook with name actionAdminControllerSetMedia
  • Unregisters hook with name displayBackOfficeFooter
  • Unregisters hook with name displayHeader
  • Unregisters hook with name displayFooter
  • If dataSendExecutor is available, then uninstall() method will be called on same object

Returns

boolean

Overrides

eabi_dpd_parcelstore::_uninstall()
public string
# hookPaymentConfirm( array & $params )

Automatic data sending is executed at the moment, when order is marked as Paid.

Automatic data sending is executed at the moment, when order is marked as Paid.

Parameters

$params
array
$params

Returns

string

Overrides

eabi_dpd_parcelstore::hookPaymentConfirm()
public
# hookActionAdminControllerSetMedia( )

For adding CSS,JS scripts in backoffice

For adding CSS,JS scripts in backoffice

Overrides

eabi_dpd_parcelstore::hookActionAdminControllerSetMedia()
public
# hookDisplayHeader( )

For adding CSS,JS scripts in frontend

For adding CSS,JS scripts in frontend

Overrides

eabi_dpd_parcelstore::hookDisplayHeader()
public string
# hookDisplayFooter( )

For adding HOOK_EXTRACARRIER callout, when original callout did not occur when it had to.

PrestaShop does not call extracarrier when for example address is not entered yet

For adding HOOK_EXTRACARRIER callout, when original callout did not occur when it had to.

PrestaShop does not call extracarrier when for example address is not entered yet

Returns

string

Overrides

eabi_dpd_parcelstore::hookDisplayFooter()
public string
# hookExtraCarrier( array $params )

This hook is called right after PrestaShop own carriers are rendered.

Returns HTML, which:

  • Replaces PrestaShop carrier element with ajax refreshing select menu element
  • Hides PrestaShop carrier, when this carrier should not be available

Current PrestaShops extraCarrier hook uses following parameters:

  • cart - Cart instance for current customer or order
  • address - Address instance for current cart

Checks following and hides if:

  • Shipping is not allowed for the specified country
  • Products in the cart contain specific HTML comment string
  • Any of the products is overweight

This hook is called right after PrestaShop own carriers are rendered.

Returns HTML, which:

  • Replaces PrestaShop carrier element with ajax refreshing select menu element
  • Hides PrestaShop carrier, when this carrier should not be available

Current PrestaShops extraCarrier hook uses following parameters:

  • cart - Cart instance for current customer or order
  • address - Address instance for current cart

Checks following and hides if:

  • Shipping is not allowed for the specified country
  • Products in the cart contain specific HTML comment string
  • Any of the products is overweight

Parameters

$params
array
$params

Returns

string

Overrides

eabi_dpd_parcelstore::hookExtraCarrier()
public string
# getContent( )

PrestaShop implementation for displaing configuration form for this module

PrestaShop implementation for displaing configuration form for this module

Returns

string

Overrides

eabi_dpd_parcelstore::getContent()
public mixed
# getConfigData( string $param )

Fetches configuration for this instance and if not found, then attempts to look to parent instance.

Fetches configuration for this instance and if not found, then attempts to look to parent instance.

Parameters

$param
string
$param

Returns

mixed

Overrides

eabi_dpd_parcelstore::getConfigData()
protected string
# _initFormFields( )

Renders form HTML from the form fields configuration

Renders form HTML from the form fields configuration

Returns

string
resulting html

Overrides

eabi_dpd_parcelstore::_initFormFields()
public
# __getPostOffices( type $code, type & $groupId = null, type & $officeId = null, null & $addressId = null )

We need this to override addressId, so always one terminal would be available

We need this to override addressId, so always one terminal would be available

Parameters

$code
type
$code
$groupId
type
$groupId
$officeId
type
$officeId
$addressId
null
$addressId
public string
# displayInfoByCart( integer $cart_id )

This function is called when store administrator is viewing the order.

Nothing

This function is called when store administrator is viewing the order.

Nothing

Parameters

$cart_id
integer
$cart_id id cart for the order

Returns

string
html string

Overrides

eabi_dpd_parcelstore::displayInfoByCart()
protected eabi_dpd_parcelstore_html_helper
# _getHtmlHelper( )

Returns

eabi_dpd_parcelstore_html_helper

Overrides

eabi_dpd_parcelstore::_getHtmlHelper()
public null
# setLastUpdated( integer $lastUpdated )

Does nothing, eabi_postoffice module calls this

Does nothing, eabi_postoffice module calls this

Parameters

$lastUpdated
integer
$lastUpdated

Returns

null

Overrides

eabi_dpd_parcelstore::setLastUpdated()
public integer
# getLastUpdated( )

Returns current timestamp, eabi_postoffice module calls this

Returns current timestamp, eabi_postoffice module calls this

Returns

integer

Overrides

eabi_dpd_parcelstore::getLastUpdated()
public integer
# getGroupTitle( array $group )

Returns empty string, eabi_postoffice module calls this

Returns empty string, eabi_postoffice module calls this

Parameters

$group
array
$group row from database eabi_postoffice

Returns

integer

Overrides

eabi_dpd_parcelstore::getGroupTitle()
public string
# getTerminalTitle( string $terminal )

Returns parcel terminal name when short names are enabled.

Returns parcel terminal name with address, telephone, opening times when short names are disabled.

Returns parcel terminal name when short names are enabled.

Returns parcel terminal name with address, telephone, opening times when short names are disabled.

Parameters

$terminal
string
$terminal

Returns

string

Overrides

eabi_dpd_parcelstore::getTerminalTitle()
public string
# getAdminTerminalTitle( array $terminal )

Returns parcel terminal name when short names are enabled.

Returns parcel terminal name with address, telephone, opening times when short names are disabled.

Returns parcel terminal name when short names are enabled.

Returns parcel terminal name with address, telephone, opening times when short names are disabled.

Parameters

$terminal
array
$terminal

Returns

string

Overrides

eabi_dpd_parcelstore::getAdminTerminalTitle()
public array
# getOfficeList( )

This carrier has no parcel terminal selection feature, so one entry must still be added with shipping method title defined for this carrier.

This carrier has no parcel terminal selection feature, so one entry must still be added with shipping method title defined for this carrier.

Returns

array
single office element

Overrides

eabi_dpd_parcelstore::getOfficeList()
public boolean
# upgrade_module_0_3( )

Adds 2.5€ COD fee to Estonia, Latvia, Lithuania

Adds 2.5€ COD fee to Estonia, Latvia, Lithuania

Returns

boolean
Methods inherited from eabi_dpd_parcelstore
__construct(), _decodeShippingMatrix(), _displayForm(), _getCurrencyIso(), _getDescription(), _getDialCodeHelper(), _getDpdHelper(), _getFooterJs(), _getFormHtml(), _getHelperModule(), _getNumberOfPackagesForOrder(), _getRemark(), _getTaxRateForCart(), _getValidator(), _isSerialized(), _postValidation(), _toJson(), addArrayAfterKey(), getCodFee(), getConfigDataForThis(), getGroupSort(), getOrderShippingCost(), getOrderShippingCostExternal(), getUpdateInterval(), hookDisplayBackOfficeFooter(), install(), isCodEnabled(), ls(), uninstall(), upgrade_module_0_6(), upgrade_module_0_8()
Constants inherited from eabi_dpd_parcelstore
CONST_PREFIX, NAME, ORDER_COMMENT_START_PREFIX, TRACKING_URL
Properties summary
protected string $_parent_code
#

Since it is inherited from DPD parcelstore, then parent shippig method is stored here.

Since it is inherited from DPD parcelstore, then parent shippig method is stored here.

public eabi_dpd_parcelstore_data_send_executor $dataSendExecutor
#
protected boolean $_carrierDisplayed false
#

Evaluates to true, if current shipment method has already been rendered

Evaluates to true, if current shipment method has already been rendered

Properties inherited from eabi_dpd_parcelstore
$_const_prefix, $_footerCalled, $_helperModuleInstance
API documentation generated by ApiGen 2.8.0