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_parcelstore_dpd_helper

Helper class for DPD shipping method related actions

getLocaleToTerritory originates from Zend Framework since PrestaShop does not support proper locales and PHP itself does not too.

Author: Matis Halmann
Located at eabi_dpd_parcelstore/dpd_helper.php
Methods summary
public string
# getOpeningsDescriptionFromTerminal( string $dpdOpeningDescription, string $locale = null )

Converts DPD op=pudo Opening Times into human readable format.

  • Input: 1:11:0:16:0,2:7:30:20:0,3:7:30:20:0,4:7:30:20:0,5:7:30:20:0,6:7:30:20:0,7:8:0:16:0
  • Result: (E-R 7:30-20; L 8-16; P 11-16)

Converts DPD op=pudo Opening Times into human readable format.

  • Input: 1:11:0:16:0,2:7:30:20:0,3:7:30:20:0,4:7:30:20:0,5:7:30:20:0,6:7:30:20:0,7:8:0:16:0
  • Result: (E-R 7:30-20; L 8-16; P 11-16)

Parameters

$dpdOpeningDescription
string
$dpdOpeningDescription DPD Openings description
$locale
string
$locale language code to be used for printing out weekday names

Returns

string
protected
# setTimestamp( DateTime & $dateTime, integer $timeStamp )

Emulates DateTime::setTimeStamp for PHP 5.2

Emulates DateTime::setTimeStamp for PHP 5.2

Parameters

$dateTime
DateTime
$dateTime
$timeStamp
integer
$timeStamp
protected string
# _getLocalizedWeekdayName( DateTime $time, string $locale )

Attempts to return short weekday name for specified date if possible

If not possible, then <span class="php-keyword2">strftime</span>(<span class="php-quote">'%a'</span>) is performed

Attempts to return short weekday name for specified date if possible

If not possible, then <span class="php-keyword2">strftime</span>(<span class="php-quote">'%a'</span>) is performed

Parameters

$time
DateTime
$time
$locale
string
$locale language code

Returns

string
public string|null
# getLocaleToTerritory( string $territory )

Returns the expected locale for a given territory

Returns the expected locale for a given territory

Parameters

$territory
string
$territory Territory for which the locale is being searched

Returns

string|null
Locale string or null when no locale has been found
public integer
# getNumberOfPackagesFromItemWeights( array $itemWeights, integer $maximumWeight )

Takes in array of parcel weights and returns number of packages calculated by maximum allowed weight per package

Uses better methology to find number of packages than regular cart weight divided by maximum package weight

For example, if maximum package weight is 31kg, ang we have 3x 20kg packages, then number of packages would be 3 (not 2)

If maximum package weight is not defined, then it returns 1

If single item in <span class="php-var">$itemWeights</span> exceeds <span class="php-var">$maximumWeight</span> then this function returns false

Takes in array of parcel weights and returns number of packages calculated by maximum allowed weight per package

Uses better methology to find number of packages than regular cart weight divided by maximum package weight

For example, if maximum package weight is 31kg, ang we have 3x 20kg packages, then number of packages would be 3 (not 2)

If maximum package weight is not defined, then it returns 1

If single item in <span class="php-var">$itemWeights</span> exceeds <span class="php-var">$maximumWeight</span> then this function returns false

Parameters

$itemWeights
array
$itemWeights array of item weights
$maximumWeight
integer
$maximumWeight maximum allowed weight of one package

Returns

integer
public eabi_dpd_parcelstore_dpd_api
# getApi( string $storeId = null, string $code = eabi_dpd_parcelstore::CONST_PREFIX )

Gets cached DPD API instance for specified PrestaShop store id and shipping method code.

Gets cached DPD API instance for specified PrestaShop store id and shipping method code.

Parameters

$storeId
string
$storeId store id to fetch the api for
$code
string
$code shipping method code to fetch the api for

Returns

eabi_dpd_parcelstore_dpd_api
Properties summary
protected array $_apis array()
#
API documentation generated by ApiGen 2.8.0