New Shopify Certification now available: Liquid Storefronts for Theme Developers

removing add to cart on specific products - sense theme

Solved
carriemek
Visitor
3 0 0

First off I'm using the Sense theme and everything that I've been finding I can't find the specific code to allow me to do it. or it hasn't worked. 

I'd like to be able to remove the add to cart and the quantity off of specific product pages but leave the rest alone. I'm not horrible with code but by no means am I a genius either. Any help would be appreciated. 

Accepted Solution (1)
Sheesh_b
Shopify Partner
482 108 112

This is an accepted solution.

Hi @carriemek 

Do you need this only on product pages or on whole website like category pages, homepage etc?

 

I did this with a trick. I added a tag to all those products where I don't need quantity and add to cart button.

Then, I modified the code in a way if that tag is available on the product hide quantity and add to cart button.

Note: my tag for this condition is 'catalog'

 

Hidden both

Sheesh_b_0-1695842245616.png

 

Normal product

Sheesh_b_1-1695842280142.png

 

To achieve this, you should open main-product.liquid under Sections.

Then find buy_buttons

Sheesh_b_3-1695842439971.png

 

Replace below code

 

{%- when 'buy_buttons' -%}
              {%- render 'buy-buttons', block: block, product: product, product_form_id: product_form_id, section_id: section.id, show_pickup_availability: true -%}
            

 

and paste below code

 

{%- when 'buy_buttons' -%}
            {% unless product.tags contains 'catalog' %}
              {%- render 'buy-buttons', block: block, product: product, product_form_id: product_form_id, section_id: section.id, show_pickup_availability: true -%}
            {% endunless %}

 

See below picture for better clarity.

Sheesh_b_4-1695842581284.png

 

 

This is fixed for Add to cart button.

Now, let's move to quantity.

Search for " when 'quantity_selector'  "

 

Paste below line after when 'quantity_selector'

 

{% unless product.tags contains 'catalog' %}

 

Like this

Sheesh_b_5-1695842782988.png

 

 

Now find next " when " condition. I've " when 'popup' "

Sheesh_b_6-1695842855824.png

Now, paste {% endunless %} just before this " when 'popup' " as shown in above image.

 

That's it. You did it.

 

Let me know if this solves you query.

 

Thanks

Sheesh B

We're here to simplify website creation for those looking to establish a strong online presence. Book a meeting slot if you want to discuss. It's FREE. BOOK NOW | Try Shopify for $1 for 3 Months: Shopify Trial | Shopify Web Store Developer |
LIKE or mark as ACCEPTED SOLUTION

View solution in original post

Replies 4 (4)
Sheesh_b
Shopify Partner
482 108 112

This is an accepted solution.

Hi @carriemek 

Do you need this only on product pages or on whole website like category pages, homepage etc?

 

I did this with a trick. I added a tag to all those products where I don't need quantity and add to cart button.

Then, I modified the code in a way if that tag is available on the product hide quantity and add to cart button.

Note: my tag for this condition is 'catalog'

 

Hidden both

Sheesh_b_0-1695842245616.png

 

Normal product

Sheesh_b_1-1695842280142.png

 

To achieve this, you should open main-product.liquid under Sections.

Then find buy_buttons

Sheesh_b_3-1695842439971.png

 

Replace below code

 

{%- when 'buy_buttons' -%}
              {%- render 'buy-buttons', block: block, product: product, product_form_id: product_form_id, section_id: section.id, show_pickup_availability: true -%}
            

 

and paste below code

 

{%- when 'buy_buttons' -%}
            {% unless product.tags contains 'catalog' %}
              {%- render 'buy-buttons', block: block, product: product, product_form_id: product_form_id, section_id: section.id, show_pickup_availability: true -%}
            {% endunless %}

 

See below picture for better clarity.

Sheesh_b_4-1695842581284.png

 

 

This is fixed for Add to cart button.

Now, let's move to quantity.

Search for " when 'quantity_selector'  "

 

Paste below line after when 'quantity_selector'

 

{% unless product.tags contains 'catalog' %}

 

Like this

Sheesh_b_5-1695842782988.png

 

 

Now find next " when " condition. I've " when 'popup' "

Sheesh_b_6-1695842855824.png

Now, paste {% endunless %} just before this " when 'popup' " as shown in above image.

 

That's it. You did it.

 

Let me know if this solves you query.

 

Thanks

Sheesh B

We're here to simplify website creation for those looking to establish a strong online presence. Book a meeting slot if you want to discuss. It's FREE. BOOK NOW | Try Shopify for $1 for 3 Months: Shopify Trial | Shopify Web Store Developer |
LIKE or mark as ACCEPTED SOLUTION
carriemek
Visitor
3 0 0

Thank you for responding, I did exactly what you said and I found all the places( your pics where helpful) It saved but nothing changed? I can send screenshots 

carriemek
Visitor
3 0 0

ok I think i actually got it to work thank you so much!

Sheesh_b
Shopify Partner
482 108 112

Hi @carriemek 

I think you missed to add the tag to product but glad you got it.


Kindly accept the answer if you found it working so that others can take benefit as well if they encounter something like this.

 

Thanks

Sheesh B

We're here to simplify website creation for those looking to establish a strong online presence. Book a meeting slot if you want to discuss. It's FREE. BOOK NOW | Try Shopify for $1 for 3 Months: Shopify Trial | Shopify Web Store Developer |
LIKE or mark as ACCEPTED SOLUTION