|
5 | 5 | */
|
6 | 6 |
|
7 | 7 | /** @var \Magento\Customer\Block\Address\Edit $block */
|
| 8 | +/** @var \Magento\Customer\ViewModel\Address $viewModel */ |
| 9 | +$viewModel = $block->getData('viewModel'); |
8 | 10 | ?>
|
9 | 11 | <?php $_company = $block->getLayout()->createBlock(\Magento\Customer\Block\Widget\Company::class) ?>
|
10 | 12 | <?php $_telephone = $block->getLayout()->createBlock(\Magento\Customer\Block\Widget\Telephone::class) ?>
|
|
19 | 21 | <?php $_dataHelper = $this->helper(\Magento\Directory\Helper\Data::class); ?>
|
20 | 22 | <?php $_addressHelper = $this->helper(\Magento\Customer\Helper\Address::class); ?>
|
21 | 23 |
|
22 |
| -<?php $_vatidValidationClass = $_addressHelper->getAttributeValidationClass('vat_id'); ?> |
23 |
| -<?php $_cityValidationClass = $_addressHelper->getAttributeValidationClass('city'); ?> |
24 |
| -<?php $_postcodeValidationClass_value = $_addressHelper->getAttributeValidationClass('postcode'); ?> |
| 24 | +<?php $_vatidValidationClass = $viewModel->addressGetAttributeValidationClass('vat_id'); ?> |
| 25 | +<?php $_cityValidationClass = $viewModel->addressGetAttributeValidationClass('city'); ?> |
| 26 | +<?php $_postcodeValidationClass_value = $viewModel->addressGetAttributeValidationClass('postcode'); ?> |
25 | 27 | <?php $_postcodeValidationClass = $_postcodeValidationClass_value; ?>
|
26 |
| -<?php $_streetValidationClass = $_addressHelper->getAttributeValidationClass('street'); ?> |
| 28 | +<?php $_streetValidationClass = $viewModel->addressGetAttributeValidationClass('street'); ?> |
27 | 29 | <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
|
28 |
| -<?php $_regionValidationClass = $_addressHelper->getAttributeValidationClass('region'); ?> |
| 30 | +<?php $_regionValidationClass = $viewModel->addressGetAttributeValidationClass('region'); ?> |
29 | 31 |
|
30 | 32 | <form class="form-address-edit"
|
31 | 33 | action="<?= $block->escapeUrl($block->getSaveUrl()) ?>"
|
|
65 | 67 | id="street_1"
|
66 | 68 | class="input-text <?= $block->escapeHtmlAttr($_streetValidationClass) ?>"/>
|
67 | 69 | <div class="nested">
|
68 |
| - <?php for ($_i = 1, $_n = $_addressHelper->getStreetLines(); $_i < $_n; $_i++): ?> |
| 70 | + <?php for ($_i = 1, $_n = $viewModel->addressGetStreetLines(); $_i < $_n; $_i++): ?> |
69 | 71 | <div class="field additional">
|
70 | 72 | <label class="label" for="street_<?= /* @noEscape */ $_i + 1 ?>">
|
71 | 73 | <span><?= $block->escapeHtml(__('Street Address %1', $_i + 1)) ?></span>
|
|
83 | 85 | </div>
|
84 | 86 | </div>
|
85 | 87 |
|
86 |
| - <?php if ($_addressHelper->isVatAttributeVisible()): ?> |
| 88 | + <?php if ($viewModel->addressGetisVatAttributeVisible()): ?> |
87 | 89 | <div class="field taxvat">
|
88 | 90 | <label class="label" for="vat_id">
|
89 | 91 | <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('vat_id') ?></span>
|
|
214 | 216 | "regionInputId": "#region",
|
215 | 217 | "postcodeId": "#zip",
|
216 | 218 | "form": "#form-validate",
|
217 |
| - "regionJson": <?= /* @noEscape */ $_dataHelper->getRegionJson() ?>, |
| 219 | + "regionJson": <?= /* @noEscape */ $viewModel->dataGetRegionJson() ?>, |
218 | 220 | "defaultRegion": "<?= (int) $block->getRegionId() ?>",
|
219 |
| - "countriesWithOptionalZip": <?= /* @noEscape */ $_dataHelper->getCountriesWithOptionalZip(true) ?> |
| 221 | + "countriesWithOptionalZip": <?= /* @noEscape */ $viewModel->dataGetCountriesWithOptionalZip(true) ?> |
220 | 222 | }
|
221 | 223 | }
|
222 | 224 | }
|
|
0 commit comments