A Shopify user working with the Refresh theme needed to limit digital product quantities to 1 in the cart pop-up, as their digital download app only provides one download per product regardless of cart quantity.
Proposed Solutions:
Modify cart.js with JavaScript to restrict quantity input changes
Edit cart.liquid or cart-drawer.liquid to add max="1" attribute to quantity inputs
Check theme customization settings or digital product app configurations
Resolution:
The user successfully solved the issue by editing main-cart-items.liquid and commenting out the variant quantity rule code that was overriding manual min/max attributes. After this modification, standard HTML min/max limitations worked correctly.
Status: Resolved. The workaround involved disabling Shopify’s built-in quantity rule system to allow custom cart quantity restrictions for digital products.
Summarized with AI on October 30.
AI used: claude-sonnet-4-5-20250929.
I am very new to Shopify and trying to use Refresh theme to create the website. I have digital products with 1 download option per product. I chose the Refresh theme which works well for what I need. However, I can’t seem to modify the the maximum value in the cart pop up.
In the Refresh theme, Shopify doesn’t natively restrict the cart quantity for digital products, but you can modify the cart’s behavior using custom code. Here’s how to set the maximum quantity to 1 in the cart pop-up:
Steps to Restrict Quantity in the Cart Pop-up
1.Go to Online Store > Themes > Edit Code.
2.Open cart.js or cart.liquid (depending on how the Refresh theme handles cart updates).
3.If using cart.js, add this JavaScript snippet:
document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll('.cart__quantity-input').forEach(function (input) {
input.addEventListener('change', function () {
if (parseInt(input.value) > 1) {
alert("Only one download per product is allowed.");
input.value = 1;
}
});
});
});
4.If the theme doesn’t use JavaScript for quantity handling, edit cart.liquid or cart-drawer.liquid, and modify the quantity input:
5.Save and test your cart.
This ensures that customers can’t add more than one of the same digital product. Let me know if you need help with the specific file in Refresh
Since you’re using the Refresh theme and selling digital products, it makes sense that you’d want to adjust the cart settings. If you’re referring to the quantity limit in the cart pop-up, there are a couple of things to check:
Theme Settings – Some themes allow you to modify cart quantity settings directly in the Theme Editor. Go to Online Store > Themes > Customize, then navigate to the cart settings and see if there’s an option to adjust the quantity limits.
Cart Liquid Code – If the limit is coded into the theme, you might need to edit the cart.liquid or cart.js file. Look for something like max=“1” or a script restricting quantity selection and adjust it.
Shopify Digital Products App or Custom App – If you’re using Shopify’s Digital Downloads app or another digital product app, some of them automatically set limits to prevent multiple downloads per purchase. Check the app’s settings in Apps > Digital Downloads (or your chosen app).
If you still can’t modify it, it could be a theme restriction. In that case, a Shopify developer might be able to tweak it for you.
Thank you for your response. I tried to follow the instruction and the code didn’t work.
Some of the Shopify guides kind of helped me. I noticed while editing ‘Template’, there is ‘Edit Code’ option from the Cart page I was trying to modify, it opened the file that needed the change. This file is ‘main-cart-items.liquid’. Adding max or min didn’t help. Until I commented out the following:
The digital app I am using has limitation for downloads, but doesn’t have limit to adding it in the cart. I can add up to 999999 items and still get only 1 download.
Wish it was simpler for digital products. We got there at the end.