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, 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) | |
![]() | |
collectRates (RateRequest $request) | |
checkAvailableShipCountries (\Magento\Framework\DataObject $request) | |
Data Fields | |
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 | |
_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) | |
Protected Attributes | |
$_activeFlag = 'active' | |
$_directoryData = null | |
$_xmlElFactory | |
$_rateFactory | |
$_rateMethodFactory | |
$_trackFactory | |
$_trackErrorFactory | |
$_trackStatusFactory | |
$_regionFactory | |
$_countryFactory | |
$_currencyFactory | |
$stockRegistry | |
$_rawRequest = null | |
$xmlSecurity | |
![]() | |
$_code | |
$_rates | |
$_numBoxes = 1 | |
$_freeMethod = 'free_method' | |
$_isFixed = false | |
$_customizableContainerTypes = [] | |
$_debugReplacePrivateDataKeys = [] | |
$_scopeConfig | |
$_rateErrorFactory | |
$_logger | |
![]() | |
$_data = [] | |
Static Protected Attributes | |
static | $_quotesCache = [] |
![]() | |
static | $_underscoreCache = [] |
Abstract online shipping carrier model
@api @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 22 of file AbstractCarrierOnline.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, | ||
array | $data = [] |
||
) |
\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 | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 137 of file AbstractCarrierOnline.php.
|
abstractprotected |
Do shipment request to carrier web service, obtain Print Shipping Labels and process errors in response
\Magento\Framework\DataObject | $request |
|
protected |
Checks whether some request to rates have already been done, so we have cache for it Used to reduce number of same requests done to carrier service during one session
Returns cached response or null
string | array | $requestParams |
Definition at line 410 of file AbstractCarrierOnline.php.
|
protected |
Returns cache key for some request to carrier quotes service
string | array | $requestParams |
Definition at line 389 of file AbstractCarrierOnline.php.
|
protected |
Check is Country U.S. Possessions and Trust Territories
string | $countyId |
Definition at line 591 of file AbstractCarrierOnline.php.
|
protected |
Prepare service name. Strip tags and entities from name
string | object | $name | service name or object with implemented __toString() method |
Definition at line 438 of file AbstractCarrierOnline.php.
|
protected |
Prepare shipment request. Validate and correct request information
\Magento\Framework\DataObject | $request |
Definition at line 453 of file AbstractCarrierOnline.php.
|
protected |
Sets received carrier quotes to cache
string | array | $requestParams | |
string | $response |
Definition at line 424 of file AbstractCarrierOnline.php.
canCollectRates | ( | ) |
Checks if shipping method can collect rates
Definition at line 686 of file AbstractCarrierOnline.php.
|
protected |
Debug errors if showmethod is unset
Error | $errors |
Definition at line 697 of file AbstractCarrierOnline.php.
getAllItems | ( | RateRequest | $request | ) |
Return items for further shipment rate evaluation. We need to pass children of a bundle instead passing the bundle itself, otherwise we may not get a rate at all (e.g. when total weight of a bundle exceeds max weight despite each item by itself is not)
RateRequest | $request |
Definition at line 273 of file AbstractCarrierOnline.php.
getCarrierCode | ( | ) |
Return code of carrier
Implements AbstractCarrierInterface.
Definition at line 189 of file AbstractCarrierOnline.php.
|
protected |
Get error messages
Definition at line 710 of file AbstractCarrierOnline.php.
getMethodPrice | ( | $cost, | |
$method = '' |
|||
) |
Calculate price considering free shipping and handling fee
string | $cost | |
string | $method |
Definition at line 648 of file AbstractCarrierOnline.php.
getTrackingInfo | ( | $tracking | ) |
Get tracking information
string | $tracking |
Definition at line 201 of file AbstractCarrierOnline.php.
isCityRequired | ( | ) |
Check if city option required
Implements AbstractCarrierInterface.
Definition at line 233 of file AbstractCarrierOnline.php.
isGirthAllowed | ( | $countyDest = null , |
|
$carrierMethodCode = null |
|||
) |
Check whether girth is allowed for the carrier
null | string | $countyDest | |
null | string | $carrierMethodCode |
Definition at line 623 of file AbstractCarrierOnline.php.
isShippingLabelsAvailable | ( | ) |
Check if carrier has shipping label option available
Implements AbstractCarrierInterface.
Definition at line 258 of file AbstractCarrierOnline.php.
isTrackingAvailable | ( | ) |
Check if carrier has shipping tracking option available All \Magento\Usa carriers have shipping tracking option available
Implements AbstractCarrierInterface.
Definition at line 223 of file AbstractCarrierOnline.php.
isZipCodeRequired | ( | $countryId = null | ) |
Determine whether zip-code is required for the country of destination
string | null | $countryId |
Implements AbstractCarrierInterface.
Definition at line 244 of file AbstractCarrierOnline.php.
parseXml | ( | $xmlContent, | |
$customSimplexml = 'SimpleXMLElement' |
|||
) |
Parse XML string and return XML document object or false
string | $xmlContent | |
string | $customSimplexml |
LocalizedException | @api |
Definition at line 671 of file AbstractCarrierOnline.php.
proccessAdditionalValidation | ( | \Magento\Framework\DataObject | $request | ) |
Processing additional validation to check if carrier applicable.
\Magento\Framework\DataObject | $request |
Implements AbstractCarrierInterface.
Definition at line 309 of file AbstractCarrierOnline.php.
requestToShipment | ( | $request | ) |
Do request to shipment
Request | $request |
Implements AbstractCarrierInterface.
Definition at line 471 of file AbstractCarrierOnline.php.
returnOfShipment | ( | $request | ) |
Do request to RMA shipment
Request | $request |
Implements AbstractCarrierInterface.
Definition at line 519 of file AbstractCarrierOnline.php.
rollBack | ( | $data | ) |
For multi package shipments. Delete requested shipments if the current shipment request is failed
array | $data |
Definition at line 572 of file AbstractCarrierOnline.php.
setActiveFlag | ( | $code = 'active' | ) |
Set flag for check carriers for activity
string | $code |
Definition at line 177 of file AbstractCarrierOnline.php.
setRawRequest | ( | $request | ) |
\Magento\Framework\DataObject | null | $request |
Definition at line 633 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 44 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 91 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 96 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 51 of file AbstractCarrierOnline.php.
|
staticprotected |
Definition at line 37 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 61 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 66 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 108 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 86 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 76 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 71 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 81 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 56 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 101 of file AbstractCarrierOnline.php.
|
protected |
Definition at line 115 of file AbstractCarrierOnline.php.
const GUAM_COUNTRY_ID = 'GU' |
Definition at line 28 of file AbstractCarrierOnline.php.
const GUAM_REGION_CODE = 'GU' |
Definition at line 30 of file AbstractCarrierOnline.php.
const PUERTORICO_COUNTRY_ID = 'PR' |
Definition at line 26 of file AbstractCarrierOnline.php.
const USA_COUNTRY_ID = 'US' |
Definition at line 24 of file AbstractCarrierOnline.php.