🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Change Quantity Without Clicking Update Button in Mini Cart in Magento 2

By Sanjay JethvaUpdated on May 22, 2025 1 min read

Earlier I posted a solution to update mini cart in Magento 2.

Talking about user experience and mini cart, here’s more it in this post.

The below solution allows users to change quantity without clicking the update button in mini cart in Magento 2.

The visitor can change the quantity of items in the text field and hit enter to update the mini cart without having to use the update button.

Reducing the number of clicks pushes conversion and that’s what the below code helps to do:

Method to change quantity without clicking update button in mini cart in Magento 2:

Open sidebar.js

Place the below code at vendor/magento/Module_Checkout/view/frontend/web/js

    events['keypress ' + this.options.item.qty] = function (event) {
        var keycode = (event.keyCode ? event.keyCode : event.which);
        if(keycode == '13'){
            $(this.options.item.qty + "+" +" .update-cart-item").click();
        }
    };

That’s it.

Feel free to share the solution with Magento community via social media.

Thank you.

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.