Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Psr\Log\LoggerInterface $logger, Security $xmlSecurity, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, \Magento\Shipping\Model\Tracking\ResultFactory $trackFactory, \Magento\Shipping\Model\Tracking\Result\ErrorFactory $trackErrorFactory, \Magento\Shipping\Model\Tracking\Result\StatusFactory $trackStatusFactory, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, \Magento\Shipping\Helper\Carrier $carrierHelper, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, \Magento\Framework\Module\Dir\Reader $configReader, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\StringUtils $string, \Magento\Framework\Math\Division $mathDivision, \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory, array $data=[], \Magento\Dhl\Model\Validator\XmlValidator $xmlValidator=null) | |
collectRates (RateRequest $request) | |
getResult () | |
setRequest (\Magento\Framework\DataObject $request) | |
getAllowedMethods () | |
getCode ($type, $code='') | |
getDhlProducts ($doc) | |
getDhlProductTitle ($code) | |
proccessAdditionalValidation (\Magento\Framework\DataObject $request) | |
processAdditionalValidation (\Magento\Framework\DataObject $request) | |
getContainerTypes (\Magento\Framework\DataObject $params=null) | |
getTracking ($trackings) | |
requestToShipment ($request) | |
![]() | |
__construct (\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Psr\Log\LoggerInterface $logger, Security $xmlSecurity, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, \Magento\Shipping\Model\Tracking\ResultFactory $trackFactory, \Magento\Shipping\Model\Tracking\Result\ErrorFactory $trackErrorFactory, \Magento\Shipping\Model\Tracking\Result\StatusFactory $trackStatusFactory, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, array $data=[]) | |
setActiveFlag ($code='active') | |
getCarrierCode () | |
getTrackingInfo ($tracking) | |
isTrackingAvailable () | |
isCityRequired () | |
isZipCodeRequired ($countryId=null) | |
isShippingLabelsAvailable () | |
getAllItems (RateRequest $request) | |
proccessAdditionalValidation (\Magento\Framework\DataObject $request) | |
requestToShipment ($request) | |
returnOfShipment ($request) | |
rollBack ($data) | |
isGirthAllowed ($countyDest=null, $carrierMethodCode=null) | |
setRawRequest ($request) | |
getMethodPrice ($cost, $method='') | |
parseXml ($xmlContent, $customSimplexml='SimpleXMLElement') | |
canCollectRates () | |
![]() | |
__construct (\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Psr\Log\LoggerInterface $logger, array $data=[]) | |
getConfigData ($field) | |
getConfigFlag ($field) | |
requestToShipment ($request) | |
returnOfShipment ($request) | |
getContainerTypes (\Magento\Framework\DataObject $params=null) | |
getCustomizableContainerTypes () | |
getDeliveryConfirmationTypes (\Magento\Framework\DataObject $params=null) | |
processAdditionalValidation (\Magento\Framework\DataObject $request) | |
proccessAdditionalValidation (\Magento\Framework\DataObject $request) | |
isActive () | |
isFixed () | |
isTrackingAvailable () | |
isShippingLabelsAvailable () | |
getSortOrder () | |
getFinalPriceWithHandlingFee ($cost) | |
getTotalNumOfBoxes ($weight) | |
isStateProvinceRequired () | |
isCityRequired () | |
isZipCodeRequired ($countryId=null) | |
getDebugFlag () | |
debugData ($debugData) | |
getCarrierCode () | |
getContentTypes (\Magento\Framework\DataObject $params) | |
![]() | |
__construct (array $data=[]) | |
addData (array $arr) | |
setData ($key, $value=null) | |
unsetData ($key=null) | |
getData ($key='', $index=null) | |
getDataByPath ($path) | |
getDataByKey ($key) | |
setDataUsingMethod ($key, $args=[]) | |
getDataUsingMethod ($key, $args=null) | |
hasData ($key='') | |
toArray (array $keys=[]) | |
convertToArray (array $keys=[]) | |
toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
toJson (array $keys=[]) | |
convertToJson (array $keys=[]) | |
toString ($format='') | |
__call ($method, $args) | |
isEmpty () | |
serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
debug ($data=null, &$objects=[]) | |
offsetSet ($offset, $value) | |
offsetExists ($offset) | |
offsetUnset ($offset) | |
offsetGet ($offset) | |
![]() | |
checkAvailableShipCountries (\Magento\Framework\DataObject $request) | |
![]() | |
isTrackingAvailable () | |
Data Fields | |
const | DHL_CONTENT_TYPE_DOC = 'D' |
const | DHL_CONTENT_TYPE_NON_DOC = 'N' |
const | DIMENSION_MIN_CM = 3 |
const | DIMENSION_MIN_IN = 1 |
const | XML_PATH_EU_COUNTRIES_LIST = 'general/country/eu_countries' |
const | CODE = 'dhl' |
![]() | |
const | CONDITION_CODE_SERVICE_DATE_UNAVAILABLE = 1003 |
const | UNAVAILABLE_DATE_LOOK_FORWARD = 5 |
const | REQUEST_DATE_FORMAT = 'Y-m-d' |
![]() | |
const | USA_COUNTRY_ID = 'US' |
const | PUERTORICO_COUNTRY_ID = 'PR' |
const | GUAM_COUNTRY_ID = 'GU' |
const | GUAM_REGION_CODE = 'GU' |
![]() | |
const | DEBUG_KEYS_MASK = '****' |
const | USA_COUNTRY_ID = 'US' |
const | CANADA_COUNTRY_ID = 'CA' |
const | MEXICO_COUNTRY_ID = 'MX' |
const | HANDLING_TYPE_PERCENT = 'P' |
const | HANDLING_TYPE_FIXED = 'F' |
const | HANDLING_ACTION_PERPACKAGE = 'P' |
const | HANDLING_ACTION_PERORDER = 'O' |
Protected Member Functions | |
_getDefaultValue ($origValue, $pathToValue) | |
_setFreeMethodRequest ($freeMethod) | |
_addParams (\Magento\Framework\DataObject $requestObject) | |
_getWeight ($weight, $maxWeight=false, $configWeightUnit=false) | |
_getAllItems () | |
_makePieces (\Magento\Shipping\Model\Simplexml\Element $nodeBkgDetails) | |
_getDimension ($dimension, $configWeightUnit=false) | |
_addDimension ($nodePiece) | |
_getQuotes () | |
_getQuotesFromServer ($request) | |
_buildQuotesRequestXml () | |
_setQuotesRequestXmlDate (\SimpleXMLElement $requestXml, $date) | |
_parseResponse ($response) | |
_addRate (\SimpleXMLElement $shipmentDetails) | |
_getDimensionUnit () | |
_getWeightUnit () | |
getCountryParams ($countryCode) | |
_doShipmentRequest (\Magento\Framework\DataObject $request) | |
_mapRequestToShipment (\Magento\Framework\DataObject $request) | |
_getMinDimension ($dimensionUnit) | |
_shipmentDetails ($xml, $rawRequest, $originRegion='') | |
_parseXmlTrackingResponse ($trackings, $response) | |
_getPerpackagePrice ($cost, $handlingType, $handlingFee) | |
_checkDomesticStatus ($origCountryCode, $destCountryCode) | |
_prepareShippingLabelContent (\SimpleXMLElement $xml) | |
isDutiable ($origCountryId, $destCountryId) | |
![]() | |
_getShipDate () | |
_determineShippingDay ($shippingDays, $date) | |
![]() | |
_getQuotesCacheKey ($requestParams) | |
_getCachedQuotes ($requestParams) | |
_setCachedQuotes ($requestParams, $response) | |
_prepareServiceName ($name) | |
_prepareShipmentRequest (\Magento\Framework\DataObject $request) | |
_doShipmentRequest (\Magento\Framework\DataObject $request) | |
_isUSCountry ($countyId) | |
debugErrors ($errors) | |
getErrorMessage () | |
![]() | |
_getAllowedContainers (\Magento\Framework\DataObject $params=null) | |
_updateFreeMethodQuote ($request) | |
_getPerpackagePrice ($cost, $handlingType, $handlingFee) | |
_getPerorderPrice ($cost, $handlingType, $handlingFee) | |
_debug ($debugData) | |
filterDebugData ($data) | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Additional Inherited Members | |
![]() | |
static | $_quotesCache = [] |
![]() | |
static | $_underscoreCache = [] |
DHL International (API v1.4) @SuppressWarnings(PHPMD.TooManyFields) @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 26 of file Carrier.php.
__construct | ( | \Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig, |
\Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory | $rateErrorFactory, | ||
\Psr\Log\LoggerInterface | $logger, | ||
Security | $xmlSecurity, | ||
\Magento\Shipping\Model\Simplexml\ElementFactory | $xmlElFactory, | ||
\Magento\Shipping\Model\Rate\ResultFactory | $rateFactory, | ||
\Magento\Quote\Model\Quote\Address\RateResult\MethodFactory | $rateMethodFactory, | ||
\Magento\Shipping\Model\Tracking\ResultFactory | $trackFactory, | ||
\Magento\Shipping\Model\Tracking\Result\ErrorFactory | $trackErrorFactory, | ||
\Magento\Shipping\Model\Tracking\Result\StatusFactory | $trackStatusFactory, | ||
\Magento\Directory\Model\RegionFactory | $regionFactory, | ||
\Magento\Directory\Model\CountryFactory | $countryFactory, | ||
\Magento\Directory\Model\CurrencyFactory | $currencyFactory, | ||
\Magento\Directory\Helper\Data | $directoryData, | ||
\Magento\CatalogInventory\Api\StockRegistryInterface | $stockRegistry, | ||
\Magento\Shipping\Helper\Carrier | $carrierHelper, | ||
\Magento\Framework\Stdlib\DateTime\DateTime | $coreDate, | ||
\Magento\Framework\Module\Dir\Reader | $configReader, | ||
\Magento\Store\Model\StoreManagerInterface | $storeManager, | ||
\Magento\Framework\Stdlib\StringUtils | $string, | ||
\Magento\Framework\Math\Division | $mathDivision, | ||
\Magento\Framework\Filesystem\Directory\ReadFactory | $readFactory, | ||
\Magento\Framework\Stdlib\DateTime | $dateTime, | ||
\Magento\Framework\HTTP\ZendClientFactory | $httpClientFactory, | ||
array | $data = [] , |
||
\Magento\Dhl\Model\Validator\XmlValidator | $xmlValidator = null |
||
) |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
\Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory | $rateErrorFactory | |
\Psr\Log\LoggerInterface | $logger | |
Security | $xmlSecurity | |
\Magento\Shipping\Model\Simplexml\ElementFactory | $xmlElFactory | |
\Magento\Shipping\Model\Rate\ResultFactory | $rateFactory | |
\Magento\Quote\Model\Quote\Address\RateResult\MethodFactory | $rateMethodFactory | |
\Magento\Shipping\Model\Tracking\ResultFactory | $trackFactory | |
\Magento\Shipping\Model\Tracking\Result\ErrorFactory | $trackErrorFactory | |
\Magento\Shipping\Model\Tracking\Result\StatusFactory | $trackStatusFactory | |
\Magento\Directory\Model\RegionFactory | $regionFactory | |
\Magento\Directory\Model\CountryFactory | $countryFactory | |
\Magento\Directory\Model\CurrencyFactory | $currencyFactory | |
\Magento\Directory\Helper\Data | $directoryData | |
\Magento\CatalogInventory\Api\StockRegistryInterface | $stockRegistry | |
\Magento\Shipping\Helper\Carrier | $carrierHelper | |
\Magento\Framework\Stdlib\DateTime\DateTime | $coreDate | |
\Magento\Framework\Module\Dir\Reader | $configReader | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Magento\Framework\Stdlib\StringUtils | $string | |
\Magento\Framework\Math\Division | $mathDivision | |
\Magento\Framework\Filesystem\Directory\ReadFactory | $readFactory | |
\Magento\Framework\Stdlib\DateTime | $dateTime | |
\Magento\Framework\HTTP\ZendClientFactory | $httpClientFactory | |
array | $data | |
\Magento\Dhl\Model\Validator\XmlValidator | $xmlValidator | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 238 of file Carrier.php.
|
protected |
Add dimension to piece
\Magento\Shipping\Model\Simplexml\Element | $nodePiece |
Definition at line 901 of file Carrier.php.
|
protected |
Fills request object with Dhl config parameters
\Magento\Framework\DataObject | $requestObject |
Definition at line 387 of file Carrier.php.
|
protected |
Add rate to DHL rates array
\SimpleXMLElement | $shipmentDetails |
Definition at line 1118 of file Carrier.php.
|
protected |
Build quotes request XML object
Definition at line 983 of file Carrier.php.
|
protected |
Check if shipping is domestic
string | $origCountryCode | |
string | $destCountryCode |
Definition at line 1918 of file Carrier.php.
|
protected |
Do shipment request to carrier web service, obtain Print Shipping Labels and process errors in response
\Magento\Framework\DataObject | $request |
Definition at line 1252 of file Carrier.php.
|
protected |
Prepare items to pieces
Definition at line 702 of file Carrier.php.
|
protected |
Returns value of given variable
string | int | $origValue | |
string | $pathToValue |
Definition at line 307 of file Carrier.php.
|
protected |
Convert item dimension to needed dimension based on config dimension unit of measure
float | $dimension | |
string | bool | $configWeightUnit |
Definition at line 865 of file Carrier.php.
|
protected |
Returns dimension unit (cm or inch)
Definition at line 1192 of file Carrier.php.
|
protected |
Retrieve minimum allowed value for dimensions in given dimension unit
string | $dimensionUnit |
Definition at line 1371 of file Carrier.php.
|
protected |
Get final price for shipping method with handling fee per package
float | $cost | |
string | $handlingType | |
float | $handlingFee |
Definition at line 1871 of file Carrier.php.
|
protected |
Get shipping quotes
Definition at line 921 of file Carrier.php.
|
protected |
Get shipping quotes from DHL service
string | $request |
Definition at line 968 of file Carrier.php.
Convert item weight to needed weight based on config weight unit dimensions
float | $weight | |
bool | $maxWeight | |
string | bool | $configWeightUnit |
Definition at line 669 of file Carrier.php.
|
protected |
Returns weight unit (kg or pound)
Definition at line 1211 of file Carrier.php.
|
protected |
Make pieces
\Magento\Shipping\Model\Simplexml\Element | $nodeBkgDetails |
Definition at line 793 of file Carrier.php.
|
protected |
Map request to shipment
\Magento\Framework\DataObject | $request |
Definition at line 1328 of file Carrier.php.
|
protected |
Parse response from DHL web service
string | $response |
Definition at line 1060 of file Carrier.php.
|
protected |
Parse xml tracking response
string[] | $trackings | |
string | $response |
Definition at line 1779 of file Carrier.php.
|
protected |
Prepare shipping label data
\SimpleXMLElement | $xml |
Definition at line 1944 of file Carrier.php.
|
protected |
Set Free Method Request
string | $freeMethod |
Definition at line 363 of file Carrier.php.
|
protected |
Set pick-up date in request XML object
\SimpleXMLElement | $requestXml | |
string | $date |
Definition at line 1045 of file Carrier.php.
|
protected |
Generation Shipment Details Node according to origin region
\Magento\Shipping\Model\Simplexml\Element | $xml | |
RateRequest | $rawRequest | |
string | $originRegion |
The DoorTo Element defines the type of delivery service that applies to the shipment. The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to Door non-compliant)
The DoorTo Element defines the type of delivery service that applies to the shipment. The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to Door non-compliant)
Definition at line 1588 of file Carrier.php.
collectRates | ( | RateRequest | $request | ) |
Collect and get rates
RateRequest | $request |
Implements AbstractCarrierInterface.
Definition at line 326 of file Carrier.php.
getAllowedMethods | ( | ) |
Get allowed shipping methods
Implements CarrierInterface.
Definition at line 513 of file Carrier.php.
getCode | ( | $type, | |
$code = '' |
|||
) |
Get configuration data of carrier
string | $type | |
string | $code |
Definition at line 549 of file Carrier.php.
getContainerTypes | ( | \Magento\Framework\DataObject | $params = null | ) |
Return container types of carrier
\Magento\Framework\DataObject | null | $params |
Definition at line 1313 of file Carrier.php.
|
protected |
Get Country Params by Country Code
string | $countryCode |
Definition at line 1232 of file Carrier.php.
getDhlProducts | ( | $doc | ) |
Returns DHL shipment methods (depending on package content type, if necessary)
string | $doc | Package content type (doc/non-doc) see DHL_CONTENT_TYPE_* constants |
Definition at line 593 of file Carrier.php.
getDhlProductTitle | ( | $code | ) |
Returns title of DHL shipping method by its code
string | $code | One-symbol code (see getDhlProducts()) |
Definition at line 653 of file Carrier.php.
getResult | ( | ) |
getTracking | ( | $trackings | ) |
Get tracking
string|string[] | $trackings |
Definition at line 1691 of file Carrier.php.
|
protected |
string | $origCountryId | |
string | $destCountryId |
Definition at line 1967 of file Carrier.php.
proccessAdditionalValidation | ( | \Magento\Framework\DataObject | $request | ) |
Processing additional validation to check is carrier applicable.
\Magento\Framework\DataObject | $request |
Definition at line 1268 of file Carrier.php.
processAdditionalValidation | ( | \Magento\Framework\DataObject | $request | ) |
Processing additional validation to check is carrier applicable.
\Magento\Framework\DataObject | $request |
Definition at line 1279 of file Carrier.php.
requestToShipment | ( | $request | ) |
Do request to shipment
\Magento\Shipping\Model\Shipment\Request | $request |
Implements AbstractCarrierInterface.
Definition at line 1887 of file Carrier.php.
setRequest | ( | \Magento\Framework\DataObject | $request | ) |
Prepare and set request in property of current instance
\Magento\Framework\DataObject | $request |
Definition at line 409 of file Carrier.php.
|
protected |
Definition at line 158 of file Carrier.php.
|
protected |
Definition at line 99 of file Carrier.php.
|
protected |
Definition at line 173 of file Carrier.php.
|
protected |
Definition at line 163 of file Carrier.php.
|
protected |
Definition at line 78 of file Carrier.php.
|
protected |
Definition at line 52 of file Carrier.php.
|
protected |
Definition at line 188 of file Carrier.php.
|
protected |
Definition at line 198 of file Carrier.php.
|
protected |
Definition at line 85 of file Carrier.php.
|
protected |
Definition at line 106 of file Carrier.php.
|
protected |
Definition at line 193 of file Carrier.php.
|
protected |
Definition at line 144 of file Carrier.php.
|
protected |
Definition at line 120 of file Carrier.php.
|
protected |
Definition at line 113 of file Carrier.php.
|
protected |
Definition at line 92 of file Carrier.php.
|
protected |
Definition at line 64 of file Carrier.php.
|
protected |
Definition at line 127 of file Carrier.php.
|
protected |
Definition at line 71 of file Carrier.php.
|
protected |
Definition at line 168 of file Carrier.php.
|
protected |
Definition at line 178 of file Carrier.php.
|
protected |
Definition at line 183 of file Carrier.php.
|
protected |
Definition at line 151 of file Carrier.php.
const CODE = 'dhl' |
Code of the carrier
Definition at line 57 of file Carrier.php.
const DHL_CONTENT_TYPE_DOC = 'D' |
#+ Carrier Product indicator
Definition at line 31 of file Carrier.php.
const DHL_CONTENT_TYPE_NON_DOC = 'N' |
Definition at line 32 of file Carrier.php.
const DIMENSION_MIN_CM = 3 |
#- #+ Minimum allowed values for shipping package dimensions
Definition at line 38 of file Carrier.php.
const DIMENSION_MIN_IN = 1 |
Definition at line 39 of file Carrier.php.
const XML_PATH_EU_COUNTRIES_LIST = 'general/country/eu_countries' |
#- Config path to UE country list
Definition at line 45 of file Carrier.php.