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

Did the new image of black hole confirm the general theory of relativity?

Does Parliament need to approve the new Brexit delay to 31 October 2019?

"... to apply for a visa" or "... and applied for a visa"?

How many people can fit inside Mordenkainen's Magnificent Mansion?

Simulating Exploding Dice

Are my PIs rude or am I just being too sensitive?

Cooking pasta in a water boiler

How can I define good in a religion that claims no moral authority?

Make it rain characters

What can I do if neighbor is blocking my solar panels intentionally?

Can smartphones with the same camera sensor have different image quality?

Why is the object placed in the middle of the sentence here?

Segmentation fault output is suppressed when piping stdin into a function. Why?

Take groceries in checked luggage

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

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

Can withdrawing asylum be illegal?

In horse breeding, what is the female equivalent of putting a horse out "to stud"?

How long does the line of fire that you can create as an action using the Investiture of Flame spell last?

Difference between "generating set" and free product?

What's the point in a preamp?

The variadic template constructor of my class cannot modify my class members, why is that so?

Working through the single responsibility principle (SRP) in Python when calls are expensive

Semisimplicity of the category of coherent sheaves?



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
























                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




























                                  0














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



                                  https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement





                                  share


























                                    0












                                    0








                                    0







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



                                    https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement





                                    share













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



                                    https://github.com/kirtinariya1/MinicartAjaxQtyIncrementDecrement






                                    share











                                    share


                                    share










                                    answered 2 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

                                        “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

                                        How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

                                        變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...