Remove Quantity from a product

Solved
Bo
Shopify Staff
Shopify Staff
1780 193 535

Hey there, @AidanSchaper 

 

I would recommend posting this query in the Design Community board to get more eyes on it as this is a relatively old post. I would love to look into it for you so feel free to @Bo me in the new post. 

 

All the Best,

Bo

Bo | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
mrussett
New Member
3 0 0

Bo, I did this and it worked fine on the Venture theme product page, but then when i view my cart the quantities choice reappears. How do I go about removing the quantities choices on the cart of one specific product?

ThxScreen Shot 2019-09-30 at 4.47.46 PM.jpgScreen Shot 2019-09-30 at 4.48.11 PM.jpg

0 Likes
Bo
Shopify Staff
Shopify Staff
1780 193 535

 

Wonderful!! I am glad to hear that this worked on the product page. Removing the quantity selector for all products in the cart page would be relatively easy, however, having it appear and remove based on the product will be more complicated. If you want it to only not show on certain products I would recommend reaching out to a Shopify Expert.

 

  • Go to Online Store > Actions > Edit Code. 
  • Open the cart-template.liquid.
  • Search for the following:
<p>
                    <a href="{{ routes.cart_change_url }}?line={{ forloop.index }}&amp;quantity=0">{{ 'cart.general.remove' | t }}</a>
                  </p>
                </td>
                <td class="cart__cell--quantity">
                  <label for="Updates_{{ item.key }}" class="cart__quantity-label medium-up--hide">{{ 'cart.label.quantity' | t }}</label>
                  <input type="number" name="updates[]" id="Updates_{{ item.key }}" class="cart__quantity" value="{{ item.quantity }}" min="0" data-line="{{ forloop.index }}" aria-label="{{ 'cart.label.quantity' | t }}">
                </td> 

 

  • Add {% comment %} to the start, right before <p> and {% endcomment %} at the end right after </td>. The finished code will look like this:
{% comment %} <p>
                    <a href="{{ routes.cart_change_url }}?line={{ forloop.index }}&amp;quantity=0">{{ 'cart.general.remove' | t }}</a>
                  </p>
                </td>
                <td class="cart__cell--quantity">
                  <label for="Updates_{{ item.key }}" class="cart__quantity-label medium-up--hide">{{ 'cart.label.quantity' | t }}</label>
                  <input type="number" name="updates[]" id="Updates_{{ item.key }}" class="cart__quantity" value="{{ item.quantity }}" min="0" data-line="{{ forloop.index }}" aria-label="{{ 'cart.label.quantity' | t }}">
                </td> {% endcomment %}
  • Click Save.

Let me know how this goes and if there is anything else I can assist you with, I'm happy to help!

 

All the Best,

Bo

 

Bo | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
roxysocherry
New Member
3 0 0

Hello,

So tested the solution, using Debut theme as well.

But did not work for me. 

On product page I had 2 buttons showing (capture here).

And I had an error when clicking on one of them.

 

What I'm trying to achieve is removing quantity from product, so when clicking on "buy now" button it redirects to cart without adding a quantity (if there's already 1 product in cart, if 0 than it adds 1, if 1 than adds 0).

 

Screen Shot 2019-11-11 at 11.47.16 AM.pngScreen Shot 2019-11-11 at 11.47.20 AM.png

0 Likes
marbil_1
New Member
1 0 0

Hi Bo,

 

I'm using Brooklyn theme and I would like to remove the quantity box on the cart slider. Is it possible? If yes, please let me know how it could be done!

0 Likes
Bo
Shopify Staff
Shopify Staff
1780 193 535

Hey there, @marbil_1 

 

I would recommend posting this query in the Design Community board to get more eyes on it as this is a relatively old post. I would love to look into it for you so feel free to @Bo me in the new post. 

 

All the Best,

Bo

Bo | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
AnnCodi39
New Member
2 0 0

Are we also be able to remove quantity selector on the cart page? 

0 Likes
Bo
Shopify Staff
Shopify Staff
1780 193 535

That can be done for sure. What version of what theme are you currently using? These tutorials are very specific to the theme and version. If you would like, you can create a new thread altogether about this in the design forum so other people can chime in on how to help and find the answer you get when they are looking for the same solution! 

 

All the Best,

Bo

Bo | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
AnnCodi39
New Member
2 0 0

I'm using a third party theme :(

 

 

0 Likes
Bo
Shopify Staff
Shopify Staff
1780 193 535

Thank you for confirming, @AnnCodi39. In that case, I would recommend starting a new thread, as the theme is the third party I would not be the best to advise you. You could also hire a Shopify Expert.

 

All the Best,

Bo

Bo | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes