Magento2: How to trigger a popup when click on My Account header link?How to open popup click on top linkOnly show My Account when logged inIn Customer Account Dashboard Page i have added linkHow to show product details in popup when click link in custom grid in Magento 2Modal Popup Form On Image Clickhow to trigger click event in M2in Magento 2 how to Open Modal popup with dynamic value for dynamic click button?How to display template file in popup model in Magento2?How to remove Register link from the header and rename Log in Magento2.2.5?Hide toggle link for logout in header magento2

What should I do with the stock I own if I anticipate there will be a recession?

Is there a word for returning to unpreparedness?

What exactly happened to the 18 crew members who were reported as "missing" in "Q Who"?

Generating Error when data size is larger then max text repl size

What was the intention with the Commodore 128?

How to train a replacement without them knowing?

Is a USB 3.0 device possible with a four contact USB 2.0 connector?

Is this bar slide trick shown on Cheers real or a visual effect?

Why don't modern jet engines use forced exhaust mixing?

Will some rockets really collapse under their own weight?

6502: is BCD *fundamentally* the same performance as non-BCD?

Heyawacky: Ace of Cups

Minimum population for language survival

How does the Moon's gravity affect Earth's oceans despite Earth's stronger gravitational pull?

Good way to stop electrolyte tabs from turning into powder?

Can anyone help me what's wrong here as i can prove 0 = 1?

Typesetting "hollow slash"

Can anybody tell me who this Pokemon is?

What is the opposite of "hunger level"?

How do I answer an interview question about how to handle a hard deadline I won't be able to meet?

A Magic Diamond

What is the purpose/function of this power inductor in parallel?

What should we do with manuals from the 80s?

Why does "auf der Strecke bleiben" mean "to fall by the wayside"?



Magento2: How to trigger a popup when click on My Account header link?


How to open popup click on top linkOnly show My Account when logged inIn Customer Account Dashboard Page i have added linkHow to show product details in popup when click link in custom grid in Magento 2Modal Popup Form On Image Clickhow to trigger click event in M2in Magento 2 how to Open Modal popup with dynamic value for dynamic click button?How to display template file in popup model in Magento2?How to remove Register link from the header and rename Log in Magento2.2.5?Hide toggle link for logout in header magento2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I want to show a popup when click on My Account header link.
As I could not find any phtml file for My Account.
Please anybody help me on this.



Any help would be appreciated.










share|improve this question






























    0















    I want to show a popup when click on My Account header link.
    As I could not find any phtml file for My Account.
    Please anybody help me on this.



    Any help would be appreciated.










    share|improve this question


























      0












      0








      0








      I want to show a popup when click on My Account header link.
      As I could not find any phtml file for My Account.
      Please anybody help me on this.



      Any help would be appreciated.










      share|improve this question














      I want to show a popup when click on My Account header link.
      As I could not find any phtml file for My Account.
      Please anybody help me on this.



      Any help would be appreciated.







      magento2 customer-account login modal-popup






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 5 at 10:02









      AmyAmy

      4411 silver badge10 bronze badges




      4411 silver badge10 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          0














          You will have to override /magentorootfolder/vendor/magento/module-customer/view frontend/layout/default.xml either in your theme or extension & update below code



           <block class="MagentoCustomerBlockAccountLink" name="my-account-link">
          <arguments>
          <argument name="label" xsi:type="string" translate="true">My Account</argument>
          <argument name="class" xsi:type="string">my-account-link</argument>
          <argument name="sortOrder" xsi:type="number">110</argument>
          </arguments>
          </block>


          Here I have added css class my-account-link on My Account Link (on which you have to trigger JS code for modal popup). For that add below JS Code



          require(['jquery', 'Magento_Ui/js/modal/modal'], function($,modal)
          var options =
          type: 'popup',
          responsive: true,
          innerScroll: true,
          buttons: [
          text: $.mage.__('Continue'),
          class: 'mymodal1',
          click: function ()
          this.closeModal();

          ]
          ;

          var popup = modal(options, $('.modal-popup'));
          $(".my-account-link").on('click',function(event)
          event.preventDefault();
          $('.modal-popup'). modal(options, $('.modal-popup')).modal('openModal');

          );


          );


          Content that will be displayed in popup



          <div class="modal-popup" >
          Demo of Modal POpup
          </div>





          share|improve this answer



























          • May I know in which template file shall I add the modal popup.

            – Amy
            Aug 5 at 11:59











          • You can override /magentorootfolder/vendor/magento/module-theme/view/frontend/templates/html/header.phtml in your theme or extension and add this code. we are using header.phtml as it will call on every page. or you can create& add code in your own template file which will load on all pages

            – Mona Mehta
            Aug 5 at 12:06












          • Okay..will try and get back to you.

            – Amy
            Aug 5 at 12:20











          • If this solution worked for you, then please mark the answer as right, as it will help others also.

            – Mona Mehta
            Aug 5 at 12:33











          • Thanks.. It is working.

            – Amy
            Aug 5 at 14:38


















          0














          Please Try this Tutorials



          • Add Magento 2 Modal Widget Module [Step by Step]

          • How To In Magento 2 – How To Add Modal PopUp?

          OR



          Add this line for Whereyou want Account Click



           <a href="#" id="click-me">Click Me</a>


          Popup Contents



          <div id="popup-mpdal" >
          Place Your Contents Here
          </div>


          Add Script



          <script>
          require(
          [
          'jquery',
          'Magento_Ui/js/modal/modal'
          ],
          function(
          $,
          modal
          )
          var options =
          type: 'popup',
          responsive: true,
          innerScroll: true,
          buttons: [
          text: $.mage.__('Continue'),
          class: '',
          click: function ()
          this.closeModal();

          ]
          ;

          var popup = modal(options, $('#popup-mpdal'));
          $("#click-me").on('click',function()
          $("#popup-mpdal").modal("openModal");
          );


          );
          </script>





          share|improve this answer





























            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%2f284419%2fmagento2-how-to-trigger-a-popup-when-click-on-my-account-header-link%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









            0














            You will have to override /magentorootfolder/vendor/magento/module-customer/view frontend/layout/default.xml either in your theme or extension & update below code



             <block class="MagentoCustomerBlockAccountLink" name="my-account-link">
            <arguments>
            <argument name="label" xsi:type="string" translate="true">My Account</argument>
            <argument name="class" xsi:type="string">my-account-link</argument>
            <argument name="sortOrder" xsi:type="number">110</argument>
            </arguments>
            </block>


            Here I have added css class my-account-link on My Account Link (on which you have to trigger JS code for modal popup). For that add below JS Code



            require(['jquery', 'Magento_Ui/js/modal/modal'], function($,modal)
            var options =
            type: 'popup',
            responsive: true,
            innerScroll: true,
            buttons: [
            text: $.mage.__('Continue'),
            class: 'mymodal1',
            click: function ()
            this.closeModal();

            ]
            ;

            var popup = modal(options, $('.modal-popup'));
            $(".my-account-link").on('click',function(event)
            event.preventDefault();
            $('.modal-popup'). modal(options, $('.modal-popup')).modal('openModal');

            );


            );


            Content that will be displayed in popup



            <div class="modal-popup" >
            Demo of Modal POpup
            </div>





            share|improve this answer



























            • May I know in which template file shall I add the modal popup.

              – Amy
              Aug 5 at 11:59











            • You can override /magentorootfolder/vendor/magento/module-theme/view/frontend/templates/html/header.phtml in your theme or extension and add this code. we are using header.phtml as it will call on every page. or you can create& add code in your own template file which will load on all pages

              – Mona Mehta
              Aug 5 at 12:06












            • Okay..will try and get back to you.

              – Amy
              Aug 5 at 12:20











            • If this solution worked for you, then please mark the answer as right, as it will help others also.

              – Mona Mehta
              Aug 5 at 12:33











            • Thanks.. It is working.

              – Amy
              Aug 5 at 14:38















            0














            You will have to override /magentorootfolder/vendor/magento/module-customer/view frontend/layout/default.xml either in your theme or extension & update below code



             <block class="MagentoCustomerBlockAccountLink" name="my-account-link">
            <arguments>
            <argument name="label" xsi:type="string" translate="true">My Account</argument>
            <argument name="class" xsi:type="string">my-account-link</argument>
            <argument name="sortOrder" xsi:type="number">110</argument>
            </arguments>
            </block>


            Here I have added css class my-account-link on My Account Link (on which you have to trigger JS code for modal popup). For that add below JS Code



            require(['jquery', 'Magento_Ui/js/modal/modal'], function($,modal)
            var options =
            type: 'popup',
            responsive: true,
            innerScroll: true,
            buttons: [
            text: $.mage.__('Continue'),
            class: 'mymodal1',
            click: function ()
            this.closeModal();

            ]
            ;

            var popup = modal(options, $('.modal-popup'));
            $(".my-account-link").on('click',function(event)
            event.preventDefault();
            $('.modal-popup'). modal(options, $('.modal-popup')).modal('openModal');

            );


            );


            Content that will be displayed in popup



            <div class="modal-popup" >
            Demo of Modal POpup
            </div>





            share|improve this answer



























            • May I know in which template file shall I add the modal popup.

              – Amy
              Aug 5 at 11:59











            • You can override /magentorootfolder/vendor/magento/module-theme/view/frontend/templates/html/header.phtml in your theme or extension and add this code. we are using header.phtml as it will call on every page. or you can create& add code in your own template file which will load on all pages

              – Mona Mehta
              Aug 5 at 12:06












            • Okay..will try and get back to you.

              – Amy
              Aug 5 at 12:20











            • If this solution worked for you, then please mark the answer as right, as it will help others also.

              – Mona Mehta
              Aug 5 at 12:33











            • Thanks.. It is working.

              – Amy
              Aug 5 at 14:38













            0












            0








            0







            You will have to override /magentorootfolder/vendor/magento/module-customer/view frontend/layout/default.xml either in your theme or extension & update below code



             <block class="MagentoCustomerBlockAccountLink" name="my-account-link">
            <arguments>
            <argument name="label" xsi:type="string" translate="true">My Account</argument>
            <argument name="class" xsi:type="string">my-account-link</argument>
            <argument name="sortOrder" xsi:type="number">110</argument>
            </arguments>
            </block>


            Here I have added css class my-account-link on My Account Link (on which you have to trigger JS code for modal popup). For that add below JS Code



            require(['jquery', 'Magento_Ui/js/modal/modal'], function($,modal)
            var options =
            type: 'popup',
            responsive: true,
            innerScroll: true,
            buttons: [
            text: $.mage.__('Continue'),
            class: 'mymodal1',
            click: function ()
            this.closeModal();

            ]
            ;

            var popup = modal(options, $('.modal-popup'));
            $(".my-account-link").on('click',function(event)
            event.preventDefault();
            $('.modal-popup'). modal(options, $('.modal-popup')).modal('openModal');

            );


            );


            Content that will be displayed in popup



            <div class="modal-popup" >
            Demo of Modal POpup
            </div>





            share|improve this answer















            You will have to override /magentorootfolder/vendor/magento/module-customer/view frontend/layout/default.xml either in your theme or extension & update below code



             <block class="MagentoCustomerBlockAccountLink" name="my-account-link">
            <arguments>
            <argument name="label" xsi:type="string" translate="true">My Account</argument>
            <argument name="class" xsi:type="string">my-account-link</argument>
            <argument name="sortOrder" xsi:type="number">110</argument>
            </arguments>
            </block>


            Here I have added css class my-account-link on My Account Link (on which you have to trigger JS code for modal popup). For that add below JS Code



            require(['jquery', 'Magento_Ui/js/modal/modal'], function($,modal)
            var options =
            type: 'popup',
            responsive: true,
            innerScroll: true,
            buttons: [
            text: $.mage.__('Continue'),
            class: 'mymodal1',
            click: function ()
            this.closeModal();

            ]
            ;

            var popup = modal(options, $('.modal-popup'));
            $(".my-account-link").on('click',function(event)
            event.preventDefault();
            $('.modal-popup'). modal(options, $('.modal-popup')).modal('openModal');

            );


            );


            Content that will be displayed in popup



            <div class="modal-popup" >
            Demo of Modal POpup
            </div>






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Aug 5 at 11:42

























            answered Aug 5 at 11:32









            Mona MehtaMona Mehta

            1057 bronze badges




            1057 bronze badges















            • May I know in which template file shall I add the modal popup.

              – Amy
              Aug 5 at 11:59











            • You can override /magentorootfolder/vendor/magento/module-theme/view/frontend/templates/html/header.phtml in your theme or extension and add this code. we are using header.phtml as it will call on every page. or you can create& add code in your own template file which will load on all pages

              – Mona Mehta
              Aug 5 at 12:06












            • Okay..will try and get back to you.

              – Amy
              Aug 5 at 12:20











            • If this solution worked for you, then please mark the answer as right, as it will help others also.

              – Mona Mehta
              Aug 5 at 12:33











            • Thanks.. It is working.

              – Amy
              Aug 5 at 14:38

















            • May I know in which template file shall I add the modal popup.

              – Amy
              Aug 5 at 11:59











            • You can override /magentorootfolder/vendor/magento/module-theme/view/frontend/templates/html/header.phtml in your theme or extension and add this code. we are using header.phtml as it will call on every page. or you can create& add code in your own template file which will load on all pages

              – Mona Mehta
              Aug 5 at 12:06












            • Okay..will try and get back to you.

              – Amy
              Aug 5 at 12:20











            • If this solution worked for you, then please mark the answer as right, as it will help others also.

              – Mona Mehta
              Aug 5 at 12:33











            • Thanks.. It is working.

              – Amy
              Aug 5 at 14:38
















            May I know in which template file shall I add the modal popup.

            – Amy
            Aug 5 at 11:59





            May I know in which template file shall I add the modal popup.

            – Amy
            Aug 5 at 11:59













            You can override /magentorootfolder/vendor/magento/module-theme/view/frontend/templates/html/header.phtml in your theme or extension and add this code. we are using header.phtml as it will call on every page. or you can create& add code in your own template file which will load on all pages

            – Mona Mehta
            Aug 5 at 12:06






            You can override /magentorootfolder/vendor/magento/module-theme/view/frontend/templates/html/header.phtml in your theme or extension and add this code. we are using header.phtml as it will call on every page. or you can create& add code in your own template file which will load on all pages

            – Mona Mehta
            Aug 5 at 12:06














            Okay..will try and get back to you.

            – Amy
            Aug 5 at 12:20





            Okay..will try and get back to you.

            – Amy
            Aug 5 at 12:20













            If this solution worked for you, then please mark the answer as right, as it will help others also.

            – Mona Mehta
            Aug 5 at 12:33





            If this solution worked for you, then please mark the answer as right, as it will help others also.

            – Mona Mehta
            Aug 5 at 12:33













            Thanks.. It is working.

            – Amy
            Aug 5 at 14:38





            Thanks.. It is working.

            – Amy
            Aug 5 at 14:38













            0














            Please Try this Tutorials



            • Add Magento 2 Modal Widget Module [Step by Step]

            • How To In Magento 2 – How To Add Modal PopUp?

            OR



            Add this line for Whereyou want Account Click



             <a href="#" id="click-me">Click Me</a>


            Popup Contents



            <div id="popup-mpdal" >
            Place Your Contents Here
            </div>


            Add Script



            <script>
            require(
            [
            'jquery',
            'Magento_Ui/js/modal/modal'
            ],
            function(
            $,
            modal
            )
            var options =
            type: 'popup',
            responsive: true,
            innerScroll: true,
            buttons: [
            text: $.mage.__('Continue'),
            class: '',
            click: function ()
            this.closeModal();

            ]
            ;

            var popup = modal(options, $('#popup-mpdal'));
            $("#click-me").on('click',function()
            $("#popup-mpdal").modal("openModal");
            );


            );
            </script>





            share|improve this answer































              0














              Please Try this Tutorials



              • Add Magento 2 Modal Widget Module [Step by Step]

              • How To In Magento 2 – How To Add Modal PopUp?

              OR



              Add this line for Whereyou want Account Click



               <a href="#" id="click-me">Click Me</a>


              Popup Contents



              <div id="popup-mpdal" >
              Place Your Contents Here
              </div>


              Add Script



              <script>
              require(
              [
              'jquery',
              'Magento_Ui/js/modal/modal'
              ],
              function(
              $,
              modal
              )
              var options =
              type: 'popup',
              responsive: true,
              innerScroll: true,
              buttons: [
              text: $.mage.__('Continue'),
              class: '',
              click: function ()
              this.closeModal();

              ]
              ;

              var popup = modal(options, $('#popup-mpdal'));
              $("#click-me").on('click',function()
              $("#popup-mpdal").modal("openModal");
              );


              );
              </script>





              share|improve this answer





























                0












                0








                0







                Please Try this Tutorials



                • Add Magento 2 Modal Widget Module [Step by Step]

                • How To In Magento 2 – How To Add Modal PopUp?

                OR



                Add this line for Whereyou want Account Click



                 <a href="#" id="click-me">Click Me</a>


                Popup Contents



                <div id="popup-mpdal" >
                Place Your Contents Here
                </div>


                Add Script



                <script>
                require(
                [
                'jquery',
                'Magento_Ui/js/modal/modal'
                ],
                function(
                $,
                modal
                )
                var options =
                type: 'popup',
                responsive: true,
                innerScroll: true,
                buttons: [
                text: $.mage.__('Continue'),
                class: '',
                click: function ()
                this.closeModal();

                ]
                ;

                var popup = modal(options, $('#popup-mpdal'));
                $("#click-me").on('click',function()
                $("#popup-mpdal").modal("openModal");
                );


                );
                </script>





                share|improve this answer















                Please Try this Tutorials



                • Add Magento 2 Modal Widget Module [Step by Step]

                • How To In Magento 2 – How To Add Modal PopUp?

                OR



                Add this line for Whereyou want Account Click



                 <a href="#" id="click-me">Click Me</a>


                Popup Contents



                <div id="popup-mpdal" >
                Place Your Contents Here
                </div>


                Add Script



                <script>
                require(
                [
                'jquery',
                'Magento_Ui/js/modal/modal'
                ],
                function(
                $,
                modal
                )
                var options =
                type: 'popup',
                responsive: true,
                innerScroll: true,
                buttons: [
                text: $.mage.__('Continue'),
                class: '',
                click: function ()
                this.closeModal();

                ]
                ;

                var popup = modal(options, $('#popup-mpdal'));
                $("#click-me").on('click',function()
                $("#popup-mpdal").modal("openModal");
                );


                );
                </script>






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Aug 5 at 11:44

























                answered Aug 5 at 11:39









                Shafeel ShaShafeel Sha

                50115 bronze badges




                50115 bronze badges






























                    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%2f284419%2fmagento2-how-to-trigger-a-popup-when-click-on-my-account-header-link%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







                    Popular posts from this blog

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form