Magento 2 how to do minicart ajax updateShopping cart ajax quantity display wrong when changing so fast.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 2

How does a sound wave propagate?

Propulsion Systems

direct sum of representation of product groups

How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?

Is it appropriate to ask a former professor to order a library book for me through ILL?

Professor forcing me to attend a conference, I can't afford even with 50% funding

Why isn't P and P/poly trivially the same?

I am the person who abides by rules but breaks the rules . Who am I

Who has more? Ireland or Iceland?

What does *dead* mean in *What do you mean, dead?*?

How to recover against Snake as a heavyweight character?

Unfamiliar notation in Diabelli's "Duet in D" for piano

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

Why does this boat have a landing pad? (SpaceX's GO Searcher) Any plans for propulsive capsule landings?

What is better: yes / no radio, or simple checkbox?

What would be the most expensive material to an intergalactic society?

Why does a car's steering wheel get lighter with increasing speed

How to install "rounded" brake pads

How would an energy-based "projectile" blow up a spaceship?

Can I negotiate a patent idea for a raise, under French law?

Should I file my taxes? No income, unemployed, but paid 2k in student loan interest

Why aren't there more Gauls like Obelix?

How spaceships determine each other's mass in space?

A running toilet that stops itself



Magento 2 how to do minicart ajax update


Shopping cart ajax quantity display wrong when changing so fast.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 2













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

      1629




      1629










      asked Oct 8 '18 at 11:20









      Chala ChalapathiChala Chalapathi

      9911




      9911




















          1 Answer
          1






          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

























          • Thanks a lot Dinesh for comment , can you please elaborate

            – Chala Chalapathi
            Oct 8 '18 at 12:47











          • I have explained it in the answer. Can you please tell me what did you not understand?

            – Dinesh Yadav
            Oct 9 '18 at 6:16











          • 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










          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

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          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

























          • Thanks a lot Dinesh for comment , can you please elaborate

            – Chala Chalapathi
            Oct 8 '18 at 12:47











          • I have explained it in the answer. Can you please tell me what did you not understand?

            – Dinesh Yadav
            Oct 9 '18 at 6:16











          • 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















          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

























          • Thanks a lot Dinesh for comment , can you please elaborate

            – Chala Chalapathi
            Oct 8 '18 at 12:47











          • I have explained it in the answer. Can you please tell me what did you not understand?

            – Dinesh Yadav
            Oct 9 '18 at 6:16











          • 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













          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 6 mins ago

























          answered Oct 8 '18 at 12:01









          Dinesh YadavDinesh Yadav

          4,0501937




          4,0501937












          • Thanks a lot Dinesh for comment , can you please elaborate

            – Chala Chalapathi
            Oct 8 '18 at 12:47











          • I have explained it in the answer. Can you please tell me what did you not understand?

            – Dinesh Yadav
            Oct 9 '18 at 6:16











          • 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

















          • Thanks a lot Dinesh for comment , can you please elaborate

            – Chala Chalapathi
            Oct 8 '18 at 12:47











          • I have explained it in the answer. Can you please tell me what did you not understand?

            – Dinesh Yadav
            Oct 9 '18 at 6:16











          • 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
















          Thanks a lot Dinesh for comment , can you please elaborate

          – Chala Chalapathi
          Oct 8 '18 at 12:47





          Thanks a lot Dinesh for comment , can you please elaborate

          – Chala Chalapathi
          Oct 8 '18 at 12:47













          I have explained it in the answer. Can you please tell me what did you not understand?

          – Dinesh Yadav
          Oct 9 '18 at 6:16





          I have explained it in the answer. Can you please tell me what did you not understand?

          – Dinesh Yadav
          Oct 9 '18 at 6:16













          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

















          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

          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?