39 parent::__construct($context);
51 foreach ($this->scopeConfig->getValue(
52 self::XML_PATH_CARRIERS_ROOT,
53 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
55 ) as $carrierCode => $carrier) {
56 if (isset($carrier[
'is_online']) && $carrier[
'is_online']) {
57 $carriersCodes[] = $carrierCode;
60 return $carriersCodes;
73 return $this->scopeConfig->getValue(
74 sprintf(
'%s/%s/%s', self::XML_PATH_CARRIERS_ROOT, $carrierCode, $configPath),
75 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
91 $locale = $this->localeResolver->getLocale();
92 $unitWeight = new \Zend_Measure_Weight(
$value, $sourceWeightMeasure, $locale);
93 $unitWeight->setType($toWeightMeasure);
94 return $unitWeight->getValue();
110 $locale = $this->localeResolver->getLocale();
111 $unitDimension = new \Zend_Measure_Length(
$value, $sourceDimensionMeasure, $locale);
112 $unitDimension->setType($toDimensionMeasure);
113 return $unitDimension->getValue();
126 $weight = new \Zend_Measure_Weight(0);
127 $conversionList = $weight->getConversionList();
128 if (!empty($conversionList[$key]) && !empty($conversionList[$key][1])) {
129 return $conversionList[$key][1];
142 $weight = new \Zend_Measure_Length(0);
143 $conversionList = $weight->getConversionList();
144 if (!empty($conversionList[$key]) && !empty($conversionList[$key][1])) {
145 return $conversionList[$key][1];
159 $euCountries = explode(
161 $this->scopeConfig->getValue(
162 self::XML_PATH_EU_COUNTRIES_LIST,
163 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
168 return in_array($countryCode, $euCountries);
const XML_PATH_EU_COUNTRIES_LIST
isCountryInEU($countryCode, $storeId=null)
const XML_PATH_CARRIERS_ROOT
convertMeasureWeight($value, $sourceWeightMeasure, $toWeightMeasure)
convertMeasureDimension($value, $sourceDimensionMeasure, $toDimensionMeasure)
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Framework\Locale\ResolverInterface $localeResolver)
getMeasureWeightName($key)
getCarrierConfigValue($carrierCode, $configPath, $store=null)
getMeasureDimensionName($key)
getOnlineCarrierCodes($store=null)