Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
edit.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
10 ?>
11 <?php $_company = $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Company') ?>
12 <?php $_telephone = $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Telephone') ?>
13 <?php $_fax = $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Fax') ?>
14 <form class="form-address-edit"
15  action="<?= $block->escapeUrl($block->getSaveUrl()) ?>"
16  method="post"
17  id="form-validate"
18  enctype="multipart/form-data"
19  data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>">
20  <fieldset class="fieldset">
21  <legend class="legend"><span><?= $block->escapeHtml(__('Contact Information')) ?></span></legend><br>
22  <?= $block->getBlockHtml('formkey') ?>
23  <input type="hidden" name="success_url" value="<?= $block->escapeUrl($block->getSuccessUrl()) ?>">
24  <input type="hidden" name="error_url" value="<?= $block->escapeUrl($block->getErrorUrl()) ?>">
25  <?= $block->getNameBlockHtml() ?>
26 
27  <?php if ($_company->isEnabled()): ?>
28  <?= $_company->setCompany($block->getAddress()->getCompany())->toHtml() ?>
29  <?php endif ?>
30 
31  <?php if ($_telephone->isEnabled()): ?>
32  <?= $_telephone->setTelephone($block->getAddress()->getTelephone())->toHtml() ?>
33  <?php endif ?>
34 
35  <?php if ($_fax->isEnabled()): ?>
36  <?= $_fax->setFax($block->getAddress()->getFax())->toHtml() ?>
37  <?php endif ?>
38 
39  </fieldset>
40  <fieldset class="fieldset">
41  <legend class="legend"><span><?= $block->escapeHtml(__('Address')) ?></span></legend><br>
42  <?php $_streetValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('street'); ?>
43  <div class="field street required">
44  <label for="street_1" class="label">
45  <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('street') ?></span>
46  </label>
47  <div class="control">
48  <input type="text"
49  name="street[]"
50  value="<?= $block->escapeHtmlAttr($block->getStreetLine(1)) ?>"
51  title="<?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('street') ?>"
52  id="street_1"
53  class="input-text <?= $block->escapeHtmlAttr($_streetValidationClass) ?>"/>
54  <div class="nested">
55  <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
56  <?php for ($_i = 1, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i < $_n; $_i++): ?>
57  <div class="field additional">
58  <label class="label" for="street_<?= /* @noEscape */ $_i + 1 ?>">
59  <span><?= $block->escapeHtml(__('Street Address %1', $_i + 1)) ?></span>
60  </label>
61  <div class="control">
62  <input type="text" name="street[]"
63  value="<?= $block->escapeHtmlAttr($block->getStreetLine($_i + 1)) ?>"
64  title="<?= $block->escapeHtmlAttr(__('Street Address %1', $_i + 1)) ?>"
65  id="street_<?= /* @noEscape */ $_i + 1 ?>"
66  class="input-text <?= $block->escapeHtmlAttr($_streetValidationClass) ?>">
67  </div>
68  </div>
69  <?php endfor; ?>
70  </div>
71  </div>
72  </div>
73 
74  <?php if ($this->helper('Magento\Customer\Helper\Address')->isVatAttributeVisible()) : ?>
75  <div class="field taxvat">
76  <label class="label" for="vat_id">
77  <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('vat_id') ?></span>
78  </label>
79  <div class="control">
80  <input type="text"
81  name="vat_id"
82  value="<?= $block->escapeHtmlAttr($block->getAddress()->getVatId()) ?>"
83  title="<?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('vat_id') ?>"
84  class="input-text <?= $block->escapeHtmlAttr($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('vat_id')) ?>"
85  id="vat_id">
86  </div>
87  </div>
88  <?php endif; ?>
89  <div class="field city required">
90  <label class="label" for="city"><span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('city') ?></span></label>
91  <div class="control">
92  <input type="text"
93  name="city"
94  value="<?= $block->escapeHtmlAttr($block->getAddress()->getCity()) ?>"
95  title="<?= $block->escapeHtmlAttr(__('City')) ?>"
96  class="input-text <?= $block->escapeHtmlAttr($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('city')) ?>"
97  id="city">
98  </div>
99  </div>
100  <div class="field region required">
101  <label class="label" for="region_id">
102  <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('region') ?></span>
103  </label>
104  <div class="control">
105  <select id="region_id" name="region_id"
106  title="<?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('region') ?>"
107  class="validate-select" <?= /* @noEscape */ !$block->getConfig('general/region/display_all') ? ' disabled="disabled"' : '' ?>>
108  <option value=""><?= $block->escapeHtml(__('Please select a region, state or province.')) ?></option>
109  </select>
110  <input type="text"
111  id="region"
112  name="region"
113  value="<?= $block->escapeHtmlAttr($block->getRegion()) ?>"
114  title="<?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('region') ?>"
115  class="input-text validate-not-number-first <?= $block->escapeHtmlAttr($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('region')) ?>"<?= !$block->getConfig('general/region/display_all') ? ' disabled="disabled"' : '' ?>/>
116  </div>
117  </div>
118  <div class="field zip required">
119  <label class="label" for="zip">
120  <span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('postcode') ?></span>
121  </label>
122  <div class="control">
123  <input type="text"
124  name="postcode"
125  value="<?= $block->escapeHtmlAttr($block->getAddress()->getPostcode()) ?>"
126  title="<?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('postcode') ?>"
127  id="zip"
128  class="input-text validate-zip-international <?= $block->escapeHtmlAttr($this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('postcode')) ?>">
129  </div>
130  </div>
131  <div class="field country required">
132  <label class="label" for="country"><span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('country_id') ?></span></label>
133  <div class="control">
134  <?= $block->getCountryHtmlSelect() ?>
135  </div>
136  </div>
137 
138  <?php if ($block->isDefaultBilling()): ?>
139  <div class="message info">
140  <span><?= $block->escapeHtml(__("It's a default billing address.")) ?></span>
141  </div>
142  <?php elseif ($block->canSetAsDefaultBilling()): ?>
143  <div class="field choice set billing">
144  <input type="checkbox" id="primary_billing" name="default_billing" value="1" class="checkbox">
145  <label class="label" for="primary_billing">
146  <span><?= $block->escapeHtml(__('Use as my default billing address')) ?></span>
147  </label>
148  </div>
149  <?php else: ?>
150  <input type="hidden" name="default_billing" value="1" />
151  <?php endif; ?>
152 
153  <?php if ($block->isDefaultShipping()): ?>
154  <div class="message info">
155  <span><?= $block->escapeHtml(__("It's a default shipping address.")) ?></span>
156  </div>
157  <?php elseif ($block->canSetAsDefaultShipping()): ?>
158  <div class="field choice set shipping">
159  <input type="checkbox" id="primary_shipping" name="default_shipping" value="1" class="checkbox">
160  <label class="label" for="primary_shipping">
161  <span><?= $block->escapeHtml(__('Use as my default shipping address')) ?></span>
162  </label>
163  </div>
164  <?php else: ?>
165  <input type="hidden" name="default_shipping" value="1">
166  <?php endif; ?>
167  </fieldset>
168  <div class="actions-toolbar">
169  <div class="primary">
170  <button type="submit"
171  class="action save primary"
172  data-action="save-address"
173  title="<?= $block->escapeHtmlAttr(__('Save Address')) ?>">
174  <span><?= $block->escapeHtml(__('Save Address')) ?></span>
175  </button>
176  </div>
177  <div class="secondary">
178  <a class="action back" href="<?= $block->escapeUrl($block->getBackUrl()) ?>">
179  <span><?= $block->escapeHtml(__('Go back')) ?></span>
180  </a>
181  </div>
182  </div>
183 </form>
184 <script type="text/x-magento-init">
185  {
186  "#form-validate": {
187  "addressValidation": {}
188  },
189  "#country": {
190  "regionUpdater": {
191  "optionalRegionAllowed": <?= /* @noEscape */ $block->getConfig('general/region/display_all') ? 'true' : 'false' ?>,
192  "regionListId": "#region_id",
193  "regionInputId": "#region",
194  "postcodeId": "#zip",
195  "form": "#form-validate",
196  "regionJson": <?= /* @noEscape */ $this->helper(\Magento\Directory\Helper\Data::class)->getRegionJson() ?>,
197  "defaultRegion": "<?= (int) $block->getRegionId() ?>",
198  "countriesWithOptionalZip": <?= /* @noEscape */ $this->helper(\Magento\Directory\Helper\Data::class)->getCountriesWithOptionalZip(true) ?>
199  }
200  }
201  }
202 </script>
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
__()
Definition: __.php:13
jquery extjs ext tree mage adminhtml form
Definition: tree.phtml:41
$block
Definition: block.php:8
$_streetValidationClass
Definition: edit.phtml:55
endif
Definition: edit.phtml:54
if(empty( $_rates))( 'You must first configure currency options before being able to see currency rates.') ?></p ></div ><?php else() ?>"> <? $_i
Definition: matrix.phtml:30