I have added 3 attribute to customer account and i want to diplay them in account information I just overrided info.phtml but i just have name and email. Any Idea of how to display this new attributes!!?? and thanks in advance
<div class="box box-information">
<strong class="box-title">
<span><?= $block->escapeHtml(__('Contact Information')) ?></span>
</strong>
<div class="box-content">
<p>
<?= $block->escapeHtml($block->getName()) ?><br>
<?= $block->escapeHtml($block->getAdresse()) ?><br>
<?= $block->escapeHtml($block->getPhone()) ?><br>
<?= $block->escapeHtml($block->getCustomer()->getEmail()) ?><br>
</p>
</div>
<div class="box-actions">
<a class="action edit" href="<?= $block->escapeUrl($block->getUrl('customer/account/edit')) ?>">
<span><?= $block->escapeHtml(__('Edit')) ?></span>
</a>
<a href="<?= $block->escapeUrl($block->getChangePasswordUrl()) ?>" class="action change-password">
<?= $block->escapeHtml(__('Change Password')) ?>
</a>
</div>
</div>
This is what i put in InstallData.php
$customerSetup->addAttribute(Customer::ENTITY, 'adresse', [
'type' => 'varchar',
'label' => 'Adresse',
'input' => 'text',
'required' => false,
'visible' => true,
'is_used_in_grid' => true,
'user_defined' => true,
'sort_order' => 1001,
'position' => 1001,
'system' => 0,
]);
$customerSetup->addAttribute(Customer::ENTITY, 'phone', [
'type' => 'varchar',
'label' => 'Phone Number',
'input' => 'text',
'required' => false,
'visible' => true,
'is_used_in_grid' => true,
'user_defined' => true,
'validate_rules' => '{"max_text_length":255,"min_text_length":1}',
'sort_order' => 1002,
'position' => 1002,
'system' => 0,
]);
http://127.0.0.1/magento/customer/account/edit/– Klaus Mikaelson Aug 24 '18 at 13:15