Magento 2 how to do minicart ajax updateHow to get quote and update total through AJAX Magento 1.9Magento2: Update minicart view using ajaxMagento 2 : Mini-cart quantity update button not working properlyMagento 2 : Minicart always showing loader after product add to cart?Magento2 update minicart using custom ajaxHow to update cart qty using ajax Magento 2Show popup when update qty in mini cart using ajax magentoHow to auto update Subtotal, Total in cart when I update product qty?Add Ajax Quantity Increment and Decrement Button on mini cart in Magento 2Magento 2 Minicart Ajax update

Animal Shelter Management C++

What are "full piece" and "half piece" in chess?

When to ask for constructive criticism?

How to ask my office to remove the pride decorations without appearing anti-LGBTQ?

Why is Katakana not pronounced Katagana?

Why are road bikes (not time trial bikes) used in many triathlons?

Cine footage fron Saturn V launch's

When did the US colonies/states stop making their own currencies?

What impact would a dragon the size of Asia have on the environment?

When does Fisher's "go get more data" approach make sense?

Why do so many pure math PhD students drop out or leave academia, compared to applied mathematics PhDs?

Is it OK to use personal email ID for faculty job applications or should we use (current) institute's ID

What exactly is a Hadouken?

What "fuel more powerful than anything the West (had) in stock" put Laika in orbit aboard Sputnik 2?

What made Windows ME so crash-prone?

Why doesn't philosophy have higher standards for its arguments?

More output neurons than labels?

Can a pizza stone be fixed after soap has been used to clean it?

Why did Steve Rogers choose this character in Endgame?

What happens on Day 6?

What powers the air required for pneumatic brakes in aircraft?

Do aircraft cabins have suspension?

Will a contempt of congress lawsuit actually reach the merits?

(Piano) is the purpose of sheet music to be played along to? Or a guide for learning and reference during playing?



Magento 2 how to do minicart ajax update


How to get quote and update total through AJAX Magento 1.9Magento2: Update minicart view using ajaxMagento 2 : Mini-cart quantity update button not working properlyMagento 2 : Minicart always showing loader after product add to cart?Magento2 update minicart using custom ajaxHow to update cart qty using ajax Magento 2Show popup when update qty in mini cart using ajax magentoHow to auto update Subtotal, Total in cart when I update product qty?Add Ajax Quantity Increment and Decrement Button on mini cart in Magento 2Magento 2 Minicart Ajax update






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








1















Is there any way to update the mini cart with ajax without update button.



I am using Magento 2.1.7 how to do mini cart ajax update when qty increment(+) and decrement(-) inside the mini cart, as qty increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update



Thanks in advance










share|improve this question






























    1















    Is there any way to update the mini cart with ajax without update button.



    I am using Magento 2.1.7 how to do mini cart ajax update when qty increment(+) and decrement(-) inside the mini cart, as qty increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update



    Thanks in advance










    share|improve this question


























      1












      1








      1


      0






      Is there any way to update the mini cart with ajax without update button.



      I am using Magento 2.1.7 how to do mini cart ajax update when qty increment(+) and decrement(-) inside the mini cart, as qty increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update



      Thanks in advance










      share|improve this question
















      Is there any way to update the mini cart with ajax without update button.



      I am using Magento 2.1.7 how to do mini cart ajax update when qty increment(+) and decrement(-) inside the mini cart, as qty increment(+) and decrement(-) inside the mini cart product price and the total must change without clicking on update



      Thanks in advance







      magento2 ajax mini-cart qty






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 20 '18 at 4:48









      trilok kumar

      16712 bronze badges




      16712 bronze badges










      asked Oct 8 '18 at 11:20









      Chala ChalapathiChala Chalapathi

      10912 bronze badges




      10912 bronze badges




















          2 Answers
          2






          active

          oldest

          votes


















          3














          There are two Methods of updating the minicart



          Method 1: Using sections.xml



          Create sections.xml file under app/code/Vendor/Module/etc/frontend directory



          <?xml version="1.0"?>

          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
          <action name="module/ajax/index">
          <section name="cart"/>
          </action>
          </config>



          Note: Put your ajax call URL in place of 'module/ajax/index'




          Method 2: Using customerData dependency in the script tag



          <script>
          require([
          'jquery',
          'Magento_Customer/js/customer-data'
          ], function ($, customerData)

          $.ajax(
          type: "post",
          url: "your_url",
          data: data : yourData,
          cache: false,
          success: function(response)

          // reload the minicart
          var sections = ['cart'];
          customerData.reload(sections, true);


          );

          );
          </script>





          share|improve this answer

























          • When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.

            – Dinesh Yadav
            Oct 9 '18 at 9:15











          • Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing

            – trilok kumar
            Oct 18 '18 at 11:34











          • @trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.

            – Dinesh Yadav
            Oct 18 '18 at 12:19











          • How to trigger the update button in mini cart Dinesh Yadav

            – trilok kumar
            Oct 18 '18 at 12:28











          • You have to write the jquery on click of your increment/decrement button. In this click function, you can trigger the update minicart button as given below jQuery('.update-cart-item').trigger('click');

            – Dinesh Yadav
            Oct 18 '18 at 12:35


















          0














          Modify sidebar.js file. Find this code:



          events['keyup ' + this.options.item.qty] = function (event) 
          self._showItemButton($(event.target));
          ;


          And change it to:



          events['keyup ' + this.options.item.qty] = function (event) 
          self._updateItemQty($(event.currentTarget));
          ;


          Now it won't show update button and will update minicart automatically without page refreshing






          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%2f245544%2fmagento-2-how-to-do-minicart-ajax-update%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









            3














            There are two Methods of updating the minicart



            Method 1: Using sections.xml



            Create sections.xml file under app/code/Vendor/Module/etc/frontend directory



            <?xml version="1.0"?>

            <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
            <action name="module/ajax/index">
            <section name="cart"/>
            </action>
            </config>



            Note: Put your ajax call URL in place of 'module/ajax/index'




            Method 2: Using customerData dependency in the script tag



            <script>
            require([
            'jquery',
            'Magento_Customer/js/customer-data'
            ], function ($, customerData)

            $.ajax(
            type: "post",
            url: "your_url",
            data: data : yourData,
            cache: false,
            success: function(response)

            // reload the minicart
            var sections = ['cart'];
            customerData.reload(sections, true);


            );

            );
            </script>





            share|improve this answer

























            • When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.

              – Dinesh Yadav
              Oct 9 '18 at 9:15











            • Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing

              – trilok kumar
              Oct 18 '18 at 11:34











            • @trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.

              – Dinesh Yadav
              Oct 18 '18 at 12:19











            • How to trigger the update button in mini cart Dinesh Yadav

              – trilok kumar
              Oct 18 '18 at 12:28











            • You have to write the jquery on click of your increment/decrement button. In this click function, you can trigger the update minicart button as given below jQuery('.update-cart-item').trigger('click');

              – Dinesh Yadav
              Oct 18 '18 at 12:35















            3














            There are two Methods of updating the minicart



            Method 1: Using sections.xml



            Create sections.xml file under app/code/Vendor/Module/etc/frontend directory



            <?xml version="1.0"?>

            <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
            <action name="module/ajax/index">
            <section name="cart"/>
            </action>
            </config>



            Note: Put your ajax call URL in place of 'module/ajax/index'




            Method 2: Using customerData dependency in the script tag



            <script>
            require([
            'jquery',
            'Magento_Customer/js/customer-data'
            ], function ($, customerData)

            $.ajax(
            type: "post",
            url: "your_url",
            data: data : yourData,
            cache: false,
            success: function(response)

            // reload the minicart
            var sections = ['cart'];
            customerData.reload(sections, true);


            );

            );
            </script>





            share|improve this answer

























            • When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.

              – Dinesh Yadav
              Oct 9 '18 at 9:15











            • Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing

              – trilok kumar
              Oct 18 '18 at 11:34











            • @trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.

              – Dinesh Yadav
              Oct 18 '18 at 12:19











            • How to trigger the update button in mini cart Dinesh Yadav

              – trilok kumar
              Oct 18 '18 at 12:28











            • You have to write the jquery on click of your increment/decrement button. In this click function, you can trigger the update minicart button as given below jQuery('.update-cart-item').trigger('click');

              – Dinesh Yadav
              Oct 18 '18 at 12:35













            3












            3








            3







            There are two Methods of updating the minicart



            Method 1: Using sections.xml



            Create sections.xml file under app/code/Vendor/Module/etc/frontend directory



            <?xml version="1.0"?>

            <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
            <action name="module/ajax/index">
            <section name="cart"/>
            </action>
            </config>



            Note: Put your ajax call URL in place of 'module/ajax/index'




            Method 2: Using customerData dependency in the script tag



            <script>
            require([
            'jquery',
            'Magento_Customer/js/customer-data'
            ], function ($, customerData)

            $.ajax(
            type: "post",
            url: "your_url",
            data: data : yourData,
            cache: false,
            success: function(response)

            // reload the minicart
            var sections = ['cart'];
            customerData.reload(sections, true);


            );

            );
            </script>





            share|improve this answer















            There are two Methods of updating the minicart



            Method 1: Using sections.xml



            Create sections.xml file under app/code/Vendor/Module/etc/frontend directory



            <?xml version="1.0"?>

            <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
            <action name="module/ajax/index">
            <section name="cart"/>
            </action>
            </config>



            Note: Put your ajax call URL in place of 'module/ajax/index'




            Method 2: Using customerData dependency in the script tag



            <script>
            require([
            'jquery',
            'Magento_Customer/js/customer-data'
            ], function ($, customerData)

            $.ajax(
            type: "post",
            url: "your_url",
            data: data : yourData,
            cache: false,
            success: function(response)

            // reload the minicart
            var sections = ['cart'];
            customerData.reload(sections, true);


            );

            );
            </script>






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 9 at 6:27

























            answered Oct 8 '18 at 12:01









            Dinesh YadavDinesh Yadav

            4,2841 gold badge9 silver badges37 bronze badges




            4,2841 gold badge9 silver badges37 bronze badges












            • When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.

              – Dinesh Yadav
              Oct 9 '18 at 9:15











            • Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing

              – trilok kumar
              Oct 18 '18 at 11:34











            • @trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.

              – Dinesh Yadav
              Oct 18 '18 at 12:19











            • How to trigger the update button in mini cart Dinesh Yadav

              – trilok kumar
              Oct 18 '18 at 12:28











            • You have to write the jquery on click of your increment/decrement button. In this click function, you can trigger the update minicart button as given below jQuery('.update-cart-item').trigger('click');

              – Dinesh Yadav
              Oct 18 '18 at 12:35

















            • When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.

              – Dinesh Yadav
              Oct 9 '18 at 9:15











            • Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing

              – trilok kumar
              Oct 18 '18 at 11:34











            • @trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.

              – Dinesh Yadav
              Oct 18 '18 at 12:19











            • How to trigger the update button in mini cart Dinesh Yadav

              – trilok kumar
              Oct 18 '18 at 12:28











            • You have to write the jquery on click of your increment/decrement button. In this click function, you can trigger the update minicart button as given below jQuery('.update-cart-item').trigger('click');

              – Dinesh Yadav
              Oct 18 '18 at 12:35
















            When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.

            – Dinesh Yadav
            Oct 9 '18 at 9:15





            When do you want to update the minicart? There must be an action, right? You can use that action url in one of the two above methods.

            – Dinesh Yadav
            Oct 9 '18 at 9:15













            Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing

            – trilok kumar
            Oct 18 '18 at 11:34





            Dinesh Yadav as i did as you have shared the procedure only but as qty increment(+) and decrement(-) inside the mini cart product price and total is not changing

            – trilok kumar
            Oct 18 '18 at 11:34













            @trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.

            – Dinesh Yadav
            Oct 18 '18 at 12:19





            @trilokkumar There is an update button in minicart. You have to trigger the click on that button if you want to update the quantity on increment and decrement button.

            – Dinesh Yadav
            Oct 18 '18 at 12:19













            How to trigger the update button in mini cart Dinesh Yadav

            – trilok kumar
            Oct 18 '18 at 12:28





            How to trigger the update button in mini cart Dinesh Yadav

            – trilok kumar
            Oct 18 '18 at 12:28













            You have to write the jquery on click of your increment/decrement button. In this click function, you can trigger the update minicart button as given below jQuery('.update-cart-item').trigger('click');

            – Dinesh Yadav
            Oct 18 '18 at 12:35





            You have to write the jquery on click of your increment/decrement button. In this click function, you can trigger the update minicart button as given below jQuery('.update-cart-item').trigger('click');

            – Dinesh Yadav
            Oct 18 '18 at 12:35













            0














            Modify sidebar.js file. Find this code:



            events['keyup ' + this.options.item.qty] = function (event) 
            self._showItemButton($(event.target));
            ;


            And change it to:



            events['keyup ' + this.options.item.qty] = function (event) 
            self._updateItemQty($(event.currentTarget));
            ;


            Now it won't show update button and will update minicart automatically without page refreshing






            share|improve this answer



























              0














              Modify sidebar.js file. Find this code:



              events['keyup ' + this.options.item.qty] = function (event) 
              self._showItemButton($(event.target));
              ;


              And change it to:



              events['keyup ' + this.options.item.qty] = function (event) 
              self._updateItemQty($(event.currentTarget));
              ;


              Now it won't show update button and will update minicart automatically without page refreshing






              share|improve this answer

























                0












                0








                0







                Modify sidebar.js file. Find this code:



                events['keyup ' + this.options.item.qty] = function (event) 
                self._showItemButton($(event.target));
                ;


                And change it to:



                events['keyup ' + this.options.item.qty] = function (event) 
                self._updateItemQty($(event.currentTarget));
                ;


                Now it won't show update button and will update minicart automatically without page refreshing






                share|improve this answer













                Modify sidebar.js file. Find this code:



                events['keyup ' + this.options.item.qty] = function (event) 
                self._showItemButton($(event.target));
                ;


                And change it to:



                events['keyup ' + this.options.item.qty] = function (event) 
                self._updateItemQty($(event.currentTarget));
                ;


                Now it won't show update button and will update minicart automatically without page refreshing







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 8 at 11:43









                xCotxCot

                11 bronze badge




                11 bronze badge



























                    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%2f245544%2fmagento-2-how-to-do-minicart-ajax-update%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

                    Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                    Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                    Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림