106 \
Magento\Framework\
View\Element\BlockFactory $blockFactory,
112 $this->_blockFactory = $blockFactory;
114 $this->_customerMetadataService = $customerMetadataService;
115 $this->_addressMetadataService = $addressMetadataService;
116 $this->_addressConfig = $addressConfig;
117 parent::__construct($context);
156 if (is_string($renderer) && $renderer) {
157 return $this->_blockFactory->createBlock($renderer, []);
175 $this->_config[
$websiteId] = $this->scopeConfig->getValue(
177 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
181 return isset($this->_config[
$websiteId][$key]) ? (string)$this->_config[
$websiteId][$key] :
null;
193 if (!isset($this->_streetLines[
$websiteId])) {
194 $attribute = $this->_addressMetadataService->getAttributeMetadata(
'street');
200 $this->_streetLines[
$websiteId] = min($lines, 20);
212 $format = $this->_addressConfig->getFormatByCode(
$code);
213 return $format->getRenderer() ?
$format->getRenderer()->getFormatArray() :
'';
224 $formatType = $this->_addressConfig->getFormatByCode(
$code);
225 if (!$formatType || !$formatType->getRenderer()) {
228 return $formatType->getRenderer();
258 : $this->_addressMetadataService->getAttributeMetadata(
$attributeCode);
261 }
catch (NoSuchEntityException $e) {
286 if (!empty($origStreets) && $toCount > 0) {
287 $countArgs = (int)floor(count($origStreets) / $toCount);
288 $modulo = count($origStreets) % $toCount;
290 $neededLinesCount = 0;
291 for (
$i = 0;
$i < $toCount;
$i++) {
292 $offset += $neededLinesCount;
293 $neededLinesCount = $countArgs;
298 $values = array_slice($origStreets, $offset, $neededLinesCount);
300 $lines[] = implode(
' ',
$values);
316 return (
bool)$this->scopeConfig->getValue(
317 self::XML_PATH_VAT_VALIDATION_ENABLED,
318 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
330 return (
bool)$this->scopeConfig->getValue(
331 self::XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT,
332 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
344 return (
bool)$this->scopeConfig->getValue(
345 self::XML_PATH_VIV_ON_EACH_TRANSACTION,
346 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
359 return (
string)$this->scopeConfig->getValue(
360 self::XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE,
361 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
373 return (
bool)$this->scopeConfig->getValue(
374 self::XML_PATH_VAT_FRONTEND_VISIBILITY,
375 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
388 $attributeMetadata = $this->_addressMetadataService->getAttributeMetadata(
$code);
389 if ($attributeMetadata) {
390 return $attributeMetadata->isVisible();
isAttributeVisible($code)
getTaxCalculationAddressType($store=null)
$_option $_optionId $class
const XML_PATH_VIV_ON_EACH_TRANSACTION
convertStreetLines($origStreets, $toCount)
const XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE
const XML_PATH_VAT_FRONTEND_VISIBILITY
const XML_PATH_VAT_VALIDATION_ENABLED
isVatValidationEnabled($store=null)
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Framework\View\Element\BlockFactory $blockFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, CustomerMetadataInterface $customerMetadataService, AddressMetadataInterface $addressMetadataService, \Magento\Customer\Model\Address\Config $addressConfig)
getStreetLines($store=null)
getConfig($key, $store=null)
getFormatTypeRenderer($code)
isDisableAutoGroupAssignDefaultValue()
const XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT
$_customerMetadataService
hasValidateOnEachTransaction($store=null)