how to add quantity increment and decreament (+ and - button) in minicart magento 2? Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?shopping cart page increment and decrement buttonIncrement and decrement qty button on shopping cart pageHow to add “Empty Cart” button to minicartUpdate quantity in minicartQuantity Increment and Decrement Button not work in Magento 2Magento 2 product list quantity increment buttonsAdding quantity increment button in cart and mini cartAdd Ajax Quantity Increment and Decrement Button on mini cart in Magento 2How to use blue foot cms in magento 2.3 cmsSalable Quantity is showing zero in product grid magento 2?

Is there a kind of relay only consumes power when switching?

Using et al. for a last / senior author rather than for a first author

Is it common practice to audition new musicians one-on-one before rehearsing with the entire band?

How do I find out the mythology and history of my Fortress?

Maximum summed powersets with non-adjacent items

Can a party unilaterally change candidates in preparation for a General election?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

Would "destroying" Wurmcoil Engine prevent its tokens from being created?

Is this homebrew Lady of Pain warlock patron balanced?

What is the longest distance a player character can jump in one leap?

Why are the trig functions versine, haversine, exsecant, etc, rarely used in modern mathematics?

Compare a given version number in the form major.minor.build.patch and see if one is less than the other

Dating a Former Employee

What is the meaning of the simile “quick as silk”?

An adverb for when you're not exaggerating

Why are both D and D# fitting into my E minor key?

Crossing US/Canada Border for less than 24 hours

Delete nth line from bottom

Is CEO the profession with the most psychopaths?

2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?

What does できなさすぎる means?

How to tell that you are a giant?

Extracting terms with certain heads in a function

How can I use the Python library networkx from Mathematica?



how to add quantity increment and decreament (+ and - button) in minicart magento 2?



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?shopping cart page increment and decrement buttonIncrement and decrement qty button on shopping cart pageHow to add “Empty Cart” button to minicartUpdate quantity in minicartQuantity Increment and Decrement Button not work in Magento 2Magento 2 product list quantity increment buttonsAdding quantity increment button in cart and mini cartAdd Ajax Quantity Increment and Decrement Button on mini cart in Magento 2How to use blue foot cms in magento 2.3 cmsSalable Quantity is showing zero in product grid magento 2?



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








1
















actually i am trying to add quantity increment and decreament (+ and
- button) in minicart magento 2.3.
If anyone have any idea please guide me.











share|improve this question






























    1
















    actually i am trying to add quantity increment and decreament (+ and
    - button) in minicart magento 2.3.
    If anyone have any idea please guide me.











    share|improve this question


























      1












      1








      1









      actually i am trying to add quantity increment and decreament (+ and
      - button) in minicart magento 2.3.
      If anyone have any idea please guide me.











      share|improve this question

















      actually i am trying to add quantity increment and decreament (+ and
      - button) in minicart magento 2.3.
      If anyone have any idea please guide me.








      magento2.3 mini-cart quantity custom-theme qty-increment






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 25 at 6:11









      Ashish Viradiya

      1,2401831




      1,2401831










      asked Feb 22 at 7:35









      hitesh balpandehitesh balpande

      40910




      40910




















          3 Answers
          3






          active

          oldest

          votes


















          0














          Magento 2 using KnockoutJs for render data in Minicart.
          You can override template:
          vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html



          And call to ajax function for update data
          checkout/sidebar/updateItemQty/



          Or use free module:
          https://github.com/php-cuong/magento2-qty






          share|improve this answer






























            1















            app/design/frontend/Module/theme/Magento_Checkout/web/template/minicart/item/default.html




            <div class="product-item-pricing">
            <!-- ko if: canApplyMsrp -->

            <div class="details-map">
            <span class="label" data-bind="i18n: 'Price'"></span>
            <span class="value" data-bind="i18n: 'See price before order confirmation.'"></span>
            </div>
            <!-- /ko -->
            <!-- ko ifnot: canApplyMsrp -->
            <!-- ko foreach: $parent.getRegion('priceSidebar') -->
            <!-- ko template: name: getTemplate(), data: item.product_price, as: 'price' --><!-- /ko -->
            <!-- /ko -->
            <!-- /ko -->

            <div class="details-qty qty">
            <label class="label" data-bind="i18n: 'Qty', attr:
            for: 'cart-item-'+item_id+'-qty'"></label>
            <div class="more">+</div>
            <input data-bind="attr:
            id: 'cart-item-'+item_id+'-qty',
            'data-cart-item': item_id,
            'data-item-qty': qty,
            'data-cart-item-id': product_sku
            , value: qty"
            type="number"
            size="4"
            class="item-qty cart-item-qty">

            <div class="less">-</div>
            <button data-bind="attr:
            id: 'update-cart-item-'+item_id,
            'data-cart-item': item_id,
            title: $t('Update')
            "
            class="update-cart-item"
            style="display: none">
            <span data-bind="i18n: 'Update'"></span>
            </button>
            </div>
            </div>



            app/design/frontend/Module/theme/Magento_Checkout/templates/cart/minicart.phtml




            <script type="text/javascript">
            require(["jquery"],function($){
            $('body').on("click",".more, .less",function()
            var obj = $(this);
            var currentQty = obj.siblings('.cart-item-qty').val();
            var iid = obj.siblings('.update-cart-item').attr('data-cart-item');

            if(obj.hasClass('more'))
            var newAdd = parseInt(currentQty)+parseInt(1);
            obj.siblings('.cart-item-qty').val(newAdd);
            obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
            //$('#update-cart-item-'+iid).click();
            $('.update-cart-item').show();
            else
            if(parseInt(currentQty) > 1)

            var newAdd = parseInt(currentQty)-parseInt(1);
            obj.siblings('.cart-item-qty').val(newAdd);
            obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
            //$('#update-cart-item-'+iid).click();
            $('.update-cart-item').show();


            );
            );
            </script>



            Its working fine for me.







            share|improve this answer




















            • 1





              thanks man its work for me also

              – Rohit Chauhan
              17 hours ago


















            0














            For ajax increment and decrement quantity in minicart you can use the below extension.



            https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement






            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%2f262976%2fhow-to-add-quantity-increment-and-decreament-and-button-in-minicart-magent%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Magento 2 using KnockoutJs for render data in Minicart.
              You can override template:
              vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html



              And call to ajax function for update data
              checkout/sidebar/updateItemQty/



              Or use free module:
              https://github.com/php-cuong/magento2-qty






              share|improve this answer



























                0














                Magento 2 using KnockoutJs for render data in Minicart.
                You can override template:
                vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html



                And call to ajax function for update data
                checkout/sidebar/updateItemQty/



                Or use free module:
                https://github.com/php-cuong/magento2-qty






                share|improve this answer

























                  0












                  0








                  0







                  Magento 2 using KnockoutJs for render data in Minicart.
                  You can override template:
                  vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html



                  And call to ajax function for update data
                  checkout/sidebar/updateItemQty/



                  Or use free module:
                  https://github.com/php-cuong/magento2-qty






                  share|improve this answer













                  Magento 2 using KnockoutJs for render data in Minicart.
                  You can override template:
                  vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html



                  And call to ajax function for update data
                  checkout/sidebar/updateItemQty/



                  Or use free module:
                  https://github.com/php-cuong/magento2-qty







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 22 at 9:34









                  bang.nguyen47bang.nguyen47

                  1115




                  1115























                      1















                      app/design/frontend/Module/theme/Magento_Checkout/web/template/minicart/item/default.html




                      <div class="product-item-pricing">
                      <!-- ko if: canApplyMsrp -->

                      <div class="details-map">
                      <span class="label" data-bind="i18n: 'Price'"></span>
                      <span class="value" data-bind="i18n: 'See price before order confirmation.'"></span>
                      </div>
                      <!-- /ko -->
                      <!-- ko ifnot: canApplyMsrp -->
                      <!-- ko foreach: $parent.getRegion('priceSidebar') -->
                      <!-- ko template: name: getTemplate(), data: item.product_price, as: 'price' --><!-- /ko -->
                      <!-- /ko -->
                      <!-- /ko -->

                      <div class="details-qty qty">
                      <label class="label" data-bind="i18n: 'Qty', attr:
                      for: 'cart-item-'+item_id+'-qty'"></label>
                      <div class="more">+</div>
                      <input data-bind="attr:
                      id: 'cart-item-'+item_id+'-qty',
                      'data-cart-item': item_id,
                      'data-item-qty': qty,
                      'data-cart-item-id': product_sku
                      , value: qty"
                      type="number"
                      size="4"
                      class="item-qty cart-item-qty">

                      <div class="less">-</div>
                      <button data-bind="attr:
                      id: 'update-cart-item-'+item_id,
                      'data-cart-item': item_id,
                      title: $t('Update')
                      "
                      class="update-cart-item"
                      style="display: none">
                      <span data-bind="i18n: 'Update'"></span>
                      </button>
                      </div>
                      </div>



                      app/design/frontend/Module/theme/Magento_Checkout/templates/cart/minicart.phtml




                      <script type="text/javascript">
                      require(["jquery"],function($){
                      $('body').on("click",".more, .less",function()
                      var obj = $(this);
                      var currentQty = obj.siblings('.cart-item-qty').val();
                      var iid = obj.siblings('.update-cart-item').attr('data-cart-item');

                      if(obj.hasClass('more'))
                      var newAdd = parseInt(currentQty)+parseInt(1);
                      obj.siblings('.cart-item-qty').val(newAdd);
                      obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
                      //$('#update-cart-item-'+iid).click();
                      $('.update-cart-item').show();
                      else
                      if(parseInt(currentQty) > 1)

                      var newAdd = parseInt(currentQty)-parseInt(1);
                      obj.siblings('.cart-item-qty').val(newAdd);
                      obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
                      //$('#update-cart-item-'+iid).click();
                      $('.update-cart-item').show();


                      );
                      );
                      </script>



                      Its working fine for me.







                      share|improve this answer




















                      • 1





                        thanks man its work for me also

                        – Rohit Chauhan
                        17 hours ago















                      1















                      app/design/frontend/Module/theme/Magento_Checkout/web/template/minicart/item/default.html




                      <div class="product-item-pricing">
                      <!-- ko if: canApplyMsrp -->

                      <div class="details-map">
                      <span class="label" data-bind="i18n: 'Price'"></span>
                      <span class="value" data-bind="i18n: 'See price before order confirmation.'"></span>
                      </div>
                      <!-- /ko -->
                      <!-- ko ifnot: canApplyMsrp -->
                      <!-- ko foreach: $parent.getRegion('priceSidebar') -->
                      <!-- ko template: name: getTemplate(), data: item.product_price, as: 'price' --><!-- /ko -->
                      <!-- /ko -->
                      <!-- /ko -->

                      <div class="details-qty qty">
                      <label class="label" data-bind="i18n: 'Qty', attr:
                      for: 'cart-item-'+item_id+'-qty'"></label>
                      <div class="more">+</div>
                      <input data-bind="attr:
                      id: 'cart-item-'+item_id+'-qty',
                      'data-cart-item': item_id,
                      'data-item-qty': qty,
                      'data-cart-item-id': product_sku
                      , value: qty"
                      type="number"
                      size="4"
                      class="item-qty cart-item-qty">

                      <div class="less">-</div>
                      <button data-bind="attr:
                      id: 'update-cart-item-'+item_id,
                      'data-cart-item': item_id,
                      title: $t('Update')
                      "
                      class="update-cart-item"
                      style="display: none">
                      <span data-bind="i18n: 'Update'"></span>
                      </button>
                      </div>
                      </div>



                      app/design/frontend/Module/theme/Magento_Checkout/templates/cart/minicart.phtml




                      <script type="text/javascript">
                      require(["jquery"],function($){
                      $('body').on("click",".more, .less",function()
                      var obj = $(this);
                      var currentQty = obj.siblings('.cart-item-qty').val();
                      var iid = obj.siblings('.update-cart-item').attr('data-cart-item');

                      if(obj.hasClass('more'))
                      var newAdd = parseInt(currentQty)+parseInt(1);
                      obj.siblings('.cart-item-qty').val(newAdd);
                      obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
                      //$('#update-cart-item-'+iid).click();
                      $('.update-cart-item').show();
                      else
                      if(parseInt(currentQty) > 1)

                      var newAdd = parseInt(currentQty)-parseInt(1);
                      obj.siblings('.cart-item-qty').val(newAdd);
                      obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
                      //$('#update-cart-item-'+iid).click();
                      $('.update-cart-item').show();


                      );
                      );
                      </script>



                      Its working fine for me.







                      share|improve this answer




















                      • 1





                        thanks man its work for me also

                        – Rohit Chauhan
                        17 hours ago













                      1












                      1








                      1








                      app/design/frontend/Module/theme/Magento_Checkout/web/template/minicart/item/default.html




                      <div class="product-item-pricing">
                      <!-- ko if: canApplyMsrp -->

                      <div class="details-map">
                      <span class="label" data-bind="i18n: 'Price'"></span>
                      <span class="value" data-bind="i18n: 'See price before order confirmation.'"></span>
                      </div>
                      <!-- /ko -->
                      <!-- ko ifnot: canApplyMsrp -->
                      <!-- ko foreach: $parent.getRegion('priceSidebar') -->
                      <!-- ko template: name: getTemplate(), data: item.product_price, as: 'price' --><!-- /ko -->
                      <!-- /ko -->
                      <!-- /ko -->

                      <div class="details-qty qty">
                      <label class="label" data-bind="i18n: 'Qty', attr:
                      for: 'cart-item-'+item_id+'-qty'"></label>
                      <div class="more">+</div>
                      <input data-bind="attr:
                      id: 'cart-item-'+item_id+'-qty',
                      'data-cart-item': item_id,
                      'data-item-qty': qty,
                      'data-cart-item-id': product_sku
                      , value: qty"
                      type="number"
                      size="4"
                      class="item-qty cart-item-qty">

                      <div class="less">-</div>
                      <button data-bind="attr:
                      id: 'update-cart-item-'+item_id,
                      'data-cart-item': item_id,
                      title: $t('Update')
                      "
                      class="update-cart-item"
                      style="display: none">
                      <span data-bind="i18n: 'Update'"></span>
                      </button>
                      </div>
                      </div>



                      app/design/frontend/Module/theme/Magento_Checkout/templates/cart/minicart.phtml




                      <script type="text/javascript">
                      require(["jquery"],function($){
                      $('body').on("click",".more, .less",function()
                      var obj = $(this);
                      var currentQty = obj.siblings('.cart-item-qty').val();
                      var iid = obj.siblings('.update-cart-item').attr('data-cart-item');

                      if(obj.hasClass('more'))
                      var newAdd = parseInt(currentQty)+parseInt(1);
                      obj.siblings('.cart-item-qty').val(newAdd);
                      obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
                      //$('#update-cart-item-'+iid).click();
                      $('.update-cart-item').show();
                      else
                      if(parseInt(currentQty) > 1)

                      var newAdd = parseInt(currentQty)-parseInt(1);
                      obj.siblings('.cart-item-qty').val(newAdd);
                      obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
                      //$('#update-cart-item-'+iid).click();
                      $('.update-cart-item').show();


                      );
                      );
                      </script>



                      Its working fine for me.







                      share|improve this answer
















                      app/design/frontend/Module/theme/Magento_Checkout/web/template/minicart/item/default.html




                      <div class="product-item-pricing">
                      <!-- ko if: canApplyMsrp -->

                      <div class="details-map">
                      <span class="label" data-bind="i18n: 'Price'"></span>
                      <span class="value" data-bind="i18n: 'See price before order confirmation.'"></span>
                      </div>
                      <!-- /ko -->
                      <!-- ko ifnot: canApplyMsrp -->
                      <!-- ko foreach: $parent.getRegion('priceSidebar') -->
                      <!-- ko template: name: getTemplate(), data: item.product_price, as: 'price' --><!-- /ko -->
                      <!-- /ko -->
                      <!-- /ko -->

                      <div class="details-qty qty">
                      <label class="label" data-bind="i18n: 'Qty', attr:
                      for: 'cart-item-'+item_id+'-qty'"></label>
                      <div class="more">+</div>
                      <input data-bind="attr:
                      id: 'cart-item-'+item_id+'-qty',
                      'data-cart-item': item_id,
                      'data-item-qty': qty,
                      'data-cart-item-id': product_sku
                      , value: qty"
                      type="number"
                      size="4"
                      class="item-qty cart-item-qty">

                      <div class="less">-</div>
                      <button data-bind="attr:
                      id: 'update-cart-item-'+item_id,
                      'data-cart-item': item_id,
                      title: $t('Update')
                      "
                      class="update-cart-item"
                      style="display: none">
                      <span data-bind="i18n: 'Update'"></span>
                      </button>
                      </div>
                      </div>



                      app/design/frontend/Module/theme/Magento_Checkout/templates/cart/minicart.phtml




                      <script type="text/javascript">
                      require(["jquery"],function($){
                      $('body').on("click",".more, .less",function()
                      var obj = $(this);
                      var currentQty = obj.siblings('.cart-item-qty').val();
                      var iid = obj.siblings('.update-cart-item').attr('data-cart-item');

                      if(obj.hasClass('more'))
                      var newAdd = parseInt(currentQty)+parseInt(1);
                      obj.siblings('.cart-item-qty').val(newAdd);
                      obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
                      //$('#update-cart-item-'+iid).click();
                      $('.update-cart-item').show();
                      else
                      if(parseInt(currentQty) > 1)

                      var newAdd = parseInt(currentQty)-parseInt(1);
                      obj.siblings('.cart-item-qty').val(newAdd);
                      obj.siblings('.cart-item-qty').attr('data-item-qty',newAdd);
                      //$('#update-cart-item-'+iid).click();
                      $('.update-cart-item').show();


                      );
                      );
                      </script>



                      Its working fine for me.








                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Feb 25 at 6:04

























                      answered Feb 22 at 14:26









                      hitesh balpandehitesh balpande

                      40910




                      40910







                      • 1





                        thanks man its work for me also

                        – Rohit Chauhan
                        17 hours ago












                      • 1





                        thanks man its work for me also

                        – Rohit Chauhan
                        17 hours ago







                      1




                      1





                      thanks man its work for me also

                      – Rohit Chauhan
                      17 hours ago





                      thanks man its work for me also

                      – Rohit Chauhan
                      17 hours ago











                      0














                      For ajax increment and decrement quantity in minicart you can use the below extension.



                      https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement






                      share|improve this answer



























                        0














                        For ajax increment and decrement quantity in minicart you can use the below extension.



                        https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement






                        share|improve this answer

























                          0












                          0








                          0







                          For ajax increment and decrement quantity in minicart you can use the below extension.



                          https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement






                          share|improve this answer













                          For ajax increment and decrement quantity in minicart you can use the below extension.



                          https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 14 at 6:06









                          Kirti NariyaKirti Nariya

                          1,183415




                          1,183415



























                              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%2f262976%2fhow-to-add-quantity-increment-and-decreament-and-button-in-minicart-magent%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

                              Sum ergo cogito? 1 nng

                              419 nièngy_Soadمي 19bal1.5o_g

                              Queiggey Chernihivv 9NnOo i Zw X QqKk LpB