Address Book - “Add New Address” button issue for Magento 2.2.2Create Account not working properly for Guest User : Delete operation is forbidden for current area (Enterprise Magento ver. 2.1.0)How to add new custom field to billing address section in magento2Use getUrl() in form action in Magento1.9?Add new field in address form for create new order and re-order section in magento 2 backendMagento 2 : Implement update functionality of new customer billing address on place order button in checkout pageAddress book redirect to 'new' always when I click on address bookCheckout with Multiple Addresses, click update qty & addresses, come back to Shopping cart and Summary section shows $0.00Default values are not rendering on Wishlist product edit pageMagento 2 how to disable 'add new address' button from customer address book page, in account section?Magento 2.2.7 SalesOrderAfterPlaceObserver not found Amasty error when creating order

How to interpret the phrase "t’en a fait voir à toi"?

The most efficient algorithm to find all possible integer pairs which sum to a given integer

Should my PhD thesis be submitted under my legal name?

Giant Toughroad SLR 2 for 200 miles in two days, will it make it?

Blender - show edges angles “direction”

Is there any significance to the Valyrian Stone vault door of Qarth?

Adding empty element to declared container without declaring type of element

Can somebody explain Brexit in a few child-proof sentences?

QGIS Geometry Generator Line Type

Lifted its hind leg on or lifted its hind leg towards?

General topology proving something for all of its points

How to deal with or prevent idle in the test team?

How to deal with loss of decision making power over a change?

Why are all the doors on Ferenginar (the Ferengi home world) far shorter than the average Ferengi?

Greatest common substring

Is there an Impartial Brexit Deal comparison site?

Is it okay / does it make sense for another player to join a running game of Munchkin?

Issues with Installing Powershell to Kali Machine

Superhero words!

word describing multiple paths to the same abstract outcome

Fast sudoku solver

What's an appropriate phrasing of a caveat about self-citation?

Perfect riffle shuffles

Can I use my Chinese passport to enter China after I acquired another citizenship?



Address Book - “Add New Address” button issue for Magento 2.2.2


Create Account not working properly for Guest User : Delete operation is forbidden for current area (Enterprise Magento ver. 2.1.0)How to add new custom field to billing address section in magento2Use getUrl() in form action in Magento1.9?Add new field in address form for create new order and re-order section in magento 2 backendMagento 2 : Implement update functionality of new customer billing address on place order button in checkout pageAddress book redirect to 'new' always when I click on address bookCheckout with Multiple Addresses, click update qty & addresses, come back to Shopping cart and Summary section shows $0.00Default values are not rendering on Wishlist product edit pageMagento 2 how to disable 'add new address' button from customer address book page, in account section?Magento 2.2.7 SalesOrderAfterPlaceObserver not found Amasty error when creating order













2















I have issue in Address Book when "Add New Address"
Steps to reproduce:



Go to "My Account" page
Navigate to "Address Book"
Click "Add New Address" button


Expected result



On "Add New Address" button click should prompt a new form to create an additional address


also I have discovered that the "Delete Address" button that shows after you have successfully added an additional address to your address book has an href="#" and therefore doesn't do anything.










share|improve this question




























    2















    I have issue in Address Book when "Add New Address"
    Steps to reproduce:



    Go to "My Account" page
    Navigate to "Address Book"
    Click "Add New Address" button


    Expected result



    On "Add New Address" button click should prompt a new form to create an additional address


    also I have discovered that the "Delete Address" button that shows after you have successfully added an additional address to your address book has an href="#" and therefore doesn't do anything.










    share|improve this question


























      2












      2








      2


      1






      I have issue in Address Book when "Add New Address"
      Steps to reproduce:



      Go to "My Account" page
      Navigate to "Address Book"
      Click "Add New Address" button


      Expected result



      On "Add New Address" button click should prompt a new form to create an additional address


      also I have discovered that the "Delete Address" button that shows after you have successfully added an additional address to your address book has an href="#" and therefore doesn't do anything.










      share|improve this question
















      I have issue in Address Book when "Add New Address"
      Steps to reproduce:



      Go to "My Account" page
      Navigate to "Address Book"
      Click "Add New Address" button


      Expected result



      On "Add New Address" button click should prompt a new form to create an additional address


      also I have discovered that the "Delete Address" button that shows after you have successfully added an additional address to your address book has an href="#" and therefore doesn't do anything.







      magento2 magento2.2.2 customer-address






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 14 '18 at 7:32









      Kirti Nariya

      1,011415




      1,011415










      asked Jun 14 '18 at 6:57









      NiteshNitesh

      1,14711532




      1,14711532




















          2 Answers
          2






          active

          oldest

          votes


















          2














          To solve "Add New Address" button issue replace below code at line no 91:



          <button type="button" role="add-address" title="<?= $block->escapeHtmlAttr(__('Add New Address')) ?>" class="action primary add"><span><?= $block->escapeHtml(__('Add New Address')) ?></span></button>


          with below code



          <a class="action primary add" href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/new'); ?>"><span><?php /* @escapeNotVerified */ echo __('Add New Address') ?></span></a>


          To solve "Delete Address" link issue replace below code at line no 78:



          href="#"


          with below code



          href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/delete', ['id' => $_address->getId()]) ?>" 


          Now, we need to make some changes in below controller file:




          /vendor/magento/module-customer/Controller/Address/Delete.php
          So we need to override controller by creating new module, please refer this link->How to override




          On line no 18 from above controller file we need to comment/remove below code:



          && $this->_formKeyValidator->validate($this->getRequest())


          Both issues solved.






          share|improve this answer






























            0














            If anyone interested I had the same issue with my add new address button doesn't work anymore.
            The reason was because I changed the main layout class. (called by x-magento-init)



            I fixed it by, copying



            module-customer/view/frontend/templates/address/book.phtml


            to



            design/frontend/VENDOR/YOUR_THEME/Magento_Customer/templates/address/book.phtml


            at the very bottom of the file change



            <script type="text/x-magento-init">

            ".page-main":
            "address":
            "deleteAddress": "li.item a[role='delete-address']",
            "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
            "addAddress": "button[role='add-address']",
            "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







            by



            <script type="text/x-magento-init">

            ".class-of-your-parent-container":
            "address":
            "deleteAddress": "li.item a[role='delete-address']",
            "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
            "addAddress": "button[role='add-address']",
            "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







            You add new address button should work now





            share








            New contributor




            fmarrot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.



















              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "479"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f229901%2faddress-book-add-new-address-button-issue-for-magento-2-2-2%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              To solve "Add New Address" button issue replace below code at line no 91:



              <button type="button" role="add-address" title="<?= $block->escapeHtmlAttr(__('Add New Address')) ?>" class="action primary add"><span><?= $block->escapeHtml(__('Add New Address')) ?></span></button>


              with below code



              <a class="action primary add" href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/new'); ?>"><span><?php /* @escapeNotVerified */ echo __('Add New Address') ?></span></a>


              To solve "Delete Address" link issue replace below code at line no 78:



              href="#"


              with below code



              href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/delete', ['id' => $_address->getId()]) ?>" 


              Now, we need to make some changes in below controller file:




              /vendor/magento/module-customer/Controller/Address/Delete.php
              So we need to override controller by creating new module, please refer this link->How to override




              On line no 18 from above controller file we need to comment/remove below code:



              && $this->_formKeyValidator->validate($this->getRequest())


              Both issues solved.






              share|improve this answer



























                2














                To solve "Add New Address" button issue replace below code at line no 91:



                <button type="button" role="add-address" title="<?= $block->escapeHtmlAttr(__('Add New Address')) ?>" class="action primary add"><span><?= $block->escapeHtml(__('Add New Address')) ?></span></button>


                with below code



                <a class="action primary add" href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/new'); ?>"><span><?php /* @escapeNotVerified */ echo __('Add New Address') ?></span></a>


                To solve "Delete Address" link issue replace below code at line no 78:



                href="#"


                with below code



                href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/delete', ['id' => $_address->getId()]) ?>" 


                Now, we need to make some changes in below controller file:




                /vendor/magento/module-customer/Controller/Address/Delete.php
                So we need to override controller by creating new module, please refer this link->How to override




                On line no 18 from above controller file we need to comment/remove below code:



                && $this->_formKeyValidator->validate($this->getRequest())


                Both issues solved.






                share|improve this answer

























                  2












                  2








                  2







                  To solve "Add New Address" button issue replace below code at line no 91:



                  <button type="button" role="add-address" title="<?= $block->escapeHtmlAttr(__('Add New Address')) ?>" class="action primary add"><span><?= $block->escapeHtml(__('Add New Address')) ?></span></button>


                  with below code



                  <a class="action primary add" href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/new'); ?>"><span><?php /* @escapeNotVerified */ echo __('Add New Address') ?></span></a>


                  To solve "Delete Address" link issue replace below code at line no 78:



                  href="#"


                  with below code



                  href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/delete', ['id' => $_address->getId()]) ?>" 


                  Now, we need to make some changes in below controller file:




                  /vendor/magento/module-customer/Controller/Address/Delete.php
                  So we need to override controller by creating new module, please refer this link->How to override




                  On line no 18 from above controller file we need to comment/remove below code:



                  && $this->_formKeyValidator->validate($this->getRequest())


                  Both issues solved.






                  share|improve this answer













                  To solve "Add New Address" button issue replace below code at line no 91:



                  <button type="button" role="add-address" title="<?= $block->escapeHtmlAttr(__('Add New Address')) ?>" class="action primary add"><span><?= $block->escapeHtml(__('Add New Address')) ?></span></button>


                  with below code



                  <a class="action primary add" href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/new'); ?>"><span><?php /* @escapeNotVerified */ echo __('Add New Address') ?></span></a>


                  To solve "Delete Address" link issue replace below code at line no 78:



                  href="#"


                  with below code



                  href="<?php /* @escapeNotVerified */ echo $block->getUrl('customer/address/delete', ['id' => $_address->getId()]) ?>" 


                  Now, we need to make some changes in below controller file:




                  /vendor/magento/module-customer/Controller/Address/Delete.php
                  So we need to override controller by creating new module, please refer this link->How to override




                  On line no 18 from above controller file we need to comment/remove below code:



                  && $this->_formKeyValidator->validate($this->getRequest())


                  Both issues solved.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jun 15 '18 at 6:46









                  NiteshNitesh

                  1,14711532




                  1,14711532























                      0














                      If anyone interested I had the same issue with my add new address button doesn't work anymore.
                      The reason was because I changed the main layout class. (called by x-magento-init)



                      I fixed it by, copying



                      module-customer/view/frontend/templates/address/book.phtml


                      to



                      design/frontend/VENDOR/YOUR_THEME/Magento_Customer/templates/address/book.phtml


                      at the very bottom of the file change



                      <script type="text/x-magento-init">

                      ".page-main":
                      "address":
                      "deleteAddress": "li.item a[role='delete-address']",
                      "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
                      "addAddress": "button[role='add-address']",
                      "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







                      by



                      <script type="text/x-magento-init">

                      ".class-of-your-parent-container":
                      "address":
                      "deleteAddress": "li.item a[role='delete-address']",
                      "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
                      "addAddress": "button[role='add-address']",
                      "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







                      You add new address button should work now





                      share








                      New contributor




                      fmarrot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.
























                        0














                        If anyone interested I had the same issue with my add new address button doesn't work anymore.
                        The reason was because I changed the main layout class. (called by x-magento-init)



                        I fixed it by, copying



                        module-customer/view/frontend/templates/address/book.phtml


                        to



                        design/frontend/VENDOR/YOUR_THEME/Magento_Customer/templates/address/book.phtml


                        at the very bottom of the file change



                        <script type="text/x-magento-init">

                        ".page-main":
                        "address":
                        "deleteAddress": "li.item a[role='delete-address']",
                        "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
                        "addAddress": "button[role='add-address']",
                        "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







                        by



                        <script type="text/x-magento-init">

                        ".class-of-your-parent-container":
                        "address":
                        "deleteAddress": "li.item a[role='delete-address']",
                        "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
                        "addAddress": "button[role='add-address']",
                        "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







                        You add new address button should work now





                        share








                        New contributor




                        fmarrot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.






















                          0












                          0








                          0







                          If anyone interested I had the same issue with my add new address button doesn't work anymore.
                          The reason was because I changed the main layout class. (called by x-magento-init)



                          I fixed it by, copying



                          module-customer/view/frontend/templates/address/book.phtml


                          to



                          design/frontend/VENDOR/YOUR_THEME/Magento_Customer/templates/address/book.phtml


                          at the very bottom of the file change



                          <script type="text/x-magento-init">

                          ".page-main":
                          "address":
                          "deleteAddress": "li.item a[role='delete-address']",
                          "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
                          "addAddress": "button[role='add-address']",
                          "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







                          by



                          <script type="text/x-magento-init">

                          ".class-of-your-parent-container":
                          "address":
                          "deleteAddress": "li.item a[role='delete-address']",
                          "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
                          "addAddress": "button[role='add-address']",
                          "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







                          You add new address button should work now





                          share








                          New contributor




                          fmarrot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.










                          If anyone interested I had the same issue with my add new address button doesn't work anymore.
                          The reason was because I changed the main layout class. (called by x-magento-init)



                          I fixed it by, copying



                          module-customer/view/frontend/templates/address/book.phtml


                          to



                          design/frontend/VENDOR/YOUR_THEME/Magento_Customer/templates/address/book.phtml


                          at the very bottom of the file change



                          <script type="text/x-magento-init">

                          ".page-main":
                          "address":
                          "deleteAddress": "li.item a[role='delete-address']",
                          "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
                          "addAddress": "button[role='add-address']",
                          "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







                          by



                          <script type="text/x-magento-init">

                          ".class-of-your-parent-container":
                          "address":
                          "deleteAddress": "li.item a[role='delete-address']",
                          "deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
                          "addAddress": "button[role='add-address']",
                          "addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"







                          You add new address button should work now






                          share








                          New contributor




                          fmarrot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.








                          share


                          share






                          New contributor




                          fmarrot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered 9 mins ago









                          fmarrotfmarrot

                          1012




                          1012




                          New contributor




                          fmarrot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          fmarrot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          fmarrot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Magento Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f229901%2faddress-book-add-new-address-button-issue-for-magento-2-2-2%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown