I have put the form for
add new address of
Address book in address book index page itself without redirecting it to a new page for adding a new address.
I need to open the form html on click of
add address without changing the url and redirecting to the
instead i want to remain in
2) on clicking
+ Add New Address i need to put the html of the form which is at
So that Save button will work exactly like as it will in
/address/new url form.
How to achieve this.
Since address has
/** @var \Magento\Customer\Block\Address\Book $block */
and address new has
/** @var \Magento\Customer\Block\Address\Edit $block */ block, so i cannot just put the
form phtml from
I cannot put edit.phtml form code in book.phtml it throw error as in edit.phtml has it down block
<?php $_company = $block->getLayout()- >createBlock(\Magento\Customer\Block\Widget\Company::class) ?> <?php $_telephone = $block->getLayout()- >createBlock(\Magento\Customer\Block\Widget\Telephone::class) ?> <?php $_fax = $block->getLayout()- >createBlock(\Magento\Customer\Block\Widget\Fax::class) ?>
codes like this throw error
<?php if ($_company->isEnabled()): ?> <?= $_company->setCompany($block->getAddress()->getCompany())->toHtml() ?> <?php endif ?>
$_company variable is being used