Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
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.
Any guidance will be greatly appreciated.
Best regards,
SJ
Solved! Go to the solution
This is an accepted solution.
Hi @goldi07
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:
{% comment %}data-min="{{ item.variant.quantity_rule.min }}"
{% if item.variant.quantity_rule.max != null %}
max="{{ item.variant.quantity_rule.max }}"
{% endif %} {% endcomment %}
After making the above change, the min and max limitations worked like a charm.
Thank you for trying to help. Much appreciated.
Best regards,
SJ
Hello @SJ_PPM
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:
<input type="number" name="updates[]" value="{{ item.quantity }}" min="1" max="1" class="cart__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
Thank you 😊
This is an accepted solution.
Hi @goldi07
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:
{% comment %}data-min="{{ item.variant.quantity_rule.min }}"
{% if item.variant.quantity_rule.max != null %}
max="{{ item.variant.quantity_rule.max }}"
{% endif %} {% endcomment %}
After making the above change, the min and max limitations worked like a charm.
Thank you for trying to help. Much appreciated.
Best regards,
SJ
Hello @SJ_PPM,
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 @Carlos-Sz .
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.
Thank you for help.
Best regards,
SJ
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025