How render product wishlist link functionality in custom template (phtml) in magento 2 The Next CEO of Stack Overflowadd static block on top of headerGetting id from wishlist product remove linkHow to add product to wishlist after login by guest customer?change Wishlist price phtml templateHow to create Guest Wishlist For Magentohow to get current wishlist in magentoHow to get WishList Product sku's or id's in phtml in Magento 2?Magento 2 Custom Customer Account Link Created but that related phtml is coming with out navigeation links on left side?How to create custom XML file for new .phtml template page in Magento 2.1?Magento 2.2.4 wishlist count not display on top of the product category pageHow to update/trigger wishlist counter in Magento 2.3?

Yu-Gi-Oh cards in Python 3

IC has pull-down resistors on SMBus lines?

What was Carter Burke's job for "the company" in Aliens?

What flight has the highest ratio of timezone difference to flight time?

Is there a way to save my career from absolute disaster?

How do I fit a non linear curve?

Is it OK to decorate a log book cover?

Audio Conversion With ADS1243

Which one is the true statement?

Where do students learn to solve polynomial equations these days?

Free fall ellipse or parabola?

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

Is fine stranded wire ok for main supply line?

Expressing the idea of having a very busy time

Purpose of level-shifter with same in and out voltages

Does Germany produce more waste than the US?

What is the process for purifying your home if you believe it may have been previously used for pagan worship?

Can this note be analyzed as a non-chord tone?

Film where the government was corrupt with aliens, people sent to kill aliens are given rigged visors not showing the right aliens

Is it convenient to ask the journal's editor for two additional days to complete a review?

What happened in Rome, when the western empire "fell"?

How to avoid supervisors with prejudiced views?

Towers in the ocean; How deep can they be built?

Is French Guiana a (hard) EU border?



How render product wishlist link functionality in custom template (phtml) in magento 2



The Next CEO of Stack Overflowadd static block on top of headerGetting id from wishlist product remove linkHow to add product to wishlist after login by guest customer?change Wishlist price phtml templateHow to create Guest Wishlist For Magentohow to get current wishlist in magentoHow to get WishList Product sku's or id's in phtml in Magento 2?Magento 2 Custom Customer Account Link Created but that related phtml is coming with out navigeation links on left side?How to create custom XML file for new .phtml template page in Magento 2.1?Magento 2.2.4 wishlist count not display on top of the product category pageHow to update/trigger wishlist counter in Magento 2.3?










5















How to display wishlist link (with functionality) in custom phtml file using template file in magento 2










share|improve this question




























    5















    How to display wishlist link (with functionality) in custom phtml file using template file in magento 2










    share|improve this question


























      5












      5








      5


      2






      How to display wishlist link (with functionality) in custom phtml file using template file in magento 2










      share|improve this question
















      How to display wishlist link (with functionality) in custom phtml file using template file in magento 2







      magento2 custom phtml wishlist






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 min ago









      Sanjay Gohil

      472214




      472214










      asked Oct 24 '16 at 9:18









      shankar bossshankar boss

      59431230




      59431230




















          1 Answer
          1






          active

          oldest

          votes


















          12














          You can try something like



          <a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
          __('Add to Wish List') . '</span></a>


          Refer the below file and related block for more details



          vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml



          Make sure your custom module should use



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

          "*":
          "Magento_Ui/js/core/app":
          "components":
          "wishlist":
          "component": "Magento_Wishlist/js/view/wishlist"





          </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%2f142299%2fhow-render-product-wishlist-link-functionality-in-custom-template-phtml-in-mag%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            12














            You can try something like



            <a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
            __('Add to Wish List') . '</span></a>


            Refer the below file and related block for more details



            vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml



            Make sure your custom module should use



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

            "*":
            "Magento_Ui/js/core/app":
            "components":
            "wishlist":
            "component": "Magento_Wishlist/js/view/wishlist"





            </script>





            share|improve this answer





























              12














              You can try something like



              <a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
              __('Add to Wish List') . '</span></a>


              Refer the below file and related block for more details



              vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml



              Make sure your custom module should use



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

              "*":
              "Magento_Ui/js/core/app":
              "components":
              "wishlist":
              "component": "Magento_Wishlist/js/view/wishlist"





              </script>





              share|improve this answer



























                12












                12








                12







                You can try something like



                <a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
                __('Add to Wish List') . '</span></a>


                Refer the below file and related block for more details



                vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml



                Make sure your custom module should use



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

                "*":
                "Magento_Ui/js/core/app":
                "components":
                "wishlist":
                "component": "Magento_Wishlist/js/view/wishlist"





                </script>





                share|improve this answer















                You can try something like



                <a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
                __('Add to Wish List') . '</span></a>


                Refer the below file and related block for more details



                vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml



                Make sure your custom module should use



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

                "*":
                "Magento_Ui/js/core/app":
                "components":
                "wishlist":
                "component": "Magento_Wishlist/js/view/wishlist"





                </script>






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Sep 6 '17 at 18:49









                Prince Patel

                14.4k65481




                14.4k65481










                answered Oct 24 '16 at 9:53









                Krishna ijjadaKrishna ijjada

                5,85742356




                5,85742356



























                    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%2f142299%2fhow-render-product-wishlist-link-functionality-in-custom-template-phtml-in-mag%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

                    Nidaros erkebispedøme

                    Birsay

                    Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?