how to add quantity increment and decreament (+ and - button) in minicart magento 2? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)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?

Road tyres vs "Street" tyres for charity ride on MTB Tandem

I'm thinking of a number

Hiding Certain Lines on Table

What LEGO pieces have "real-world" functionality?

Do warforged have souls?

Relations between two reciprocal partial derivatives?

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

What are these Gizmos at Izaña Atmospheric Research Center in Spain?

Why is Captain Marvel translated as male in Portugal?

Match Roman Numerals

does high air pressure throw off wheel balance?

rotate text in posterbox

Single author papers against my advisor's will?

Why does this iterative way of solving of equation work?

How to colour the US map with Yellow, Green, Red and Blue to minimize the number of states with the colour of Green

Didn't get enough time to take a Coding Test - what to do now?

How to test the equality of two Pearson correlation coefficients computed from the same sample?

How did passengers keep warm on sail ships?

Windows 10: How to Lock (not sleep) laptop on lid close?

What force causes entropy to increase?

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

Can the prologue be the backstory of your main character?

Make it rain characters

University's motivation for having tenure-track positions



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



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)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,2301831




      1,2301831










      asked Feb 22 at 7:35









      hitesh balpandehitesh balpande

      3929




      3929




















          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






























            0















            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
































              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























                        0















                        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





























                          0















                          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



























                            0












                            0








                            0








                            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

                            3929




                            3929





















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









                                    Kirti NariyaKirti Nariya

                                    1,173415




                                    1,173415



























                                        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

                                        منجزی محتویات تیره‌های طایفه منجزی[ویرایش] مشاهیر طایفه منجزی[ویرایش] محل سکونت[ویرایش] پانویس[ویرایش] منابع[ویرایش] منوی ناوبری«نمودار اجتماعی طوایف بختیاری»«BakhtyārBAḴTĪĀRĪ TRIBE»«اسامی طوایف و شعب ایل بختیاری»ووگسترش آن

                                        بیوانفورماتیک محتویات تاریخچه[ویرایش] اهداف[ویرایش] کاربردهای بیوانفورماتیک[ویرایش] زمینه‌های مهم بیوانفورماتیک[ویرایش] موضوعات سیستم نرم‌افزاری بیوانفورماتیک[ویرایش] مراکز و ابزار[ویرایش] جستارهای وابسته[ویرایش] پیوند به بیرون[ویرایش] منابع[ویرایش] منوی ناوبریووانجمن بیوانفورماتیک ایرانمرکز بیوانفورماتیک دانشگاه تهرانمرکز ملی تحقیقات بیوانفورماتیکانستیتو بیو-آی‌تیبانک داده‌های دی ان ایمرکز ملی اطلاعات بیوتکنولوژیانستیتوی بیوانفورماتیک اروپاپورتال بیوانفورماتیک ایران«فرهنگ واژه‌های مصوب فرهنگستان ـ دفتر هشتم، بخش لاتین»وووو4611085-900870420ووو