Set Maximum Limit on digital product in the Refresh Theme

Solved

Set Maximum Limit on digital product in the Refresh Theme

SJ_PPM
Tourist
3 1 1

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

Accepted Solution (1)
SJ_PPM
Tourist
3 1 1

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

View solution in original post

Replies 4 (4)

goldi07
Trailblazer
171 13 18

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 😊

 

 

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -Goldi184507@gmail.com - Skype: live:.cid.819bad8ddb52736c -Whatsapp: +919317950519
Checkout Some Free Sections Here
SJ_PPM
Tourist
3 1 1

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

Carlos-Sz
Excursionist
92 6 27

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:

  1. 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.

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

  3. 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.

SJ_PPM
Tourist
3 1 1

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