Remove Quantity from a product

Solved
Highlighted
New Member
2 0 0

I am trying to remove the quantity picker from one of my products as i am using a variant to chose the quantity as there is discounts if you buy more.

 

I think i have found the code and know i need to make a new  template and section to have my page go to this code.
 Capture 1 is the code i believe i need to edit or change.

 

Would anyone be able to help. i am using the Brooklyn Theme

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1387 136 376

This is an accepted solution.

Hey there,

 

Bo here from Shopify Support!

 

That is a really great question and you are absolutely heading down the right path to get this done. You will be able to remove the quantity selector from this product by creating a new template and a new section so let's get started.

  • Go to Online Store > Edit Code.
  • Under the Templates folder select "Add a new template". Select product from the dropdown and you can name it what you want, for this case we will simply call it alternate and create the template.
  • On line six replace:

 

{% section 'product-template' %}

with:

 

{% section 'product-template-alternate' %} 

 

  • Click Save.
  • Under the Sections folder you will select "Add a new section". You will name this new section "product-template-alternate".
  • Go to product-template.liquid and copy all the code. Once copied go back to product-template-alternate and paste replace whatever code is there with what you have copied.
  • At the start of line 329 you will add {% comment %} and at the end of line 334 you will close it with {% endcomment %}. The finished product will look like this: 

  • Click Save. 

Now that you have made this change to the code itself you can go ahead and select that template for your product. 

 

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

4 Likes
Highlighted
New Member
2 0 0

Thanks Bo,

 

Worked a charm

0 Likes
Highlighted
New Member
2 0 0

Hi Bo,

I'm also a newbee with Shopify and I have followed your instructions on how to make an alternate product page template and thereafter comment out the Quantity selector.

 

At first view it works fine (no quantity selector appears on the product page where I have assigned the my new alternate product page template:-)) - but when I use the new alternate product template it seems that I loose some of the regular settings. For instance, the Social sharing icons ar also gone and the styling of the submit to card button is gone too.

 

Do I have to do some changes in "settings_data.json", "social-sharing.liquid" or some other setting-files to get the altenate product page to act like my normal product pages.

 

Snap_1.png:

My normal product page

 

Snap_2.png:

The product where I have used the new alternate product Page Template (As you can see, The Social Sharing section is gone and the styling off the submit button is also gone.

 

Can you please guide me in this matter?...thanks in advance....

 

/Ulf

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1387 136 376

Hey there, Ulf! 

 

This tutorial was specific for an unedited version of the Brooklyn theme. Is this the theme that you are currently using? 

 

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
Highlighted
New Member
2 0 0

Hi Bo and sorry for the delayed reply.

 

I've solved the issue my self...actually right after I posted my request. It seemed that I just had to update my Shopify settings for that particually the page where I had assigned the new template :-). So all is working great now.

 

But thanks for your rapid reply to my question in the first place :-)

 

Best Regarda

/Ulf

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1387 136 376

Brilliant! I am so glad this worked out for you in the end!

 

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

1 Like
Highlighted
New Member
1 0 0

heyy Bo,

can you suggest me the best way to catch variant change event on product page.

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1387 136 376

Hey there, @1234567891 

 

I would recommend posting this query  in our awesome API and Technology Community. I would not know how to implement that kind of tracking, however, someone in the community might! It's the best place to get help from both Shopify's dev team and other developers for assistance with API related questions and development.

 

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
Highlighted
New Member
6 0 0

Hi! I want to remove the quantity only from certain products on my store (more than one but not all). How would I go about doing this? I am using Debut theme. Would what was previously suggested work for this? 

 

Also, is there a way to change the name of the quantity selector? Also just for certain products.

 

Any help on this would be greatly appreciated!

0 Likes