Jump to content

Hiding Add to Cart Button on Certain Products

Go to solution Solved by paul2009,

Recommended Posts

Site URL: https://www.asiawest.net/

Hi! I have some products listed on my site that are not available for online purchase, and I would like to get rid of the Add to Cart button on these product's pages. Somebody suggested this code:

.sqs-add-to-cart-button {
  display: none !important;
}

However, this removes the Add to Cart button on every product page, and I only want it to remove the button on certain products (say, products that are tagged "in-store" or that have 0 inventory). Is this possible?

Thank you!

Link to comment

Add category: no-cart, then add this to Home > Design > Custom CSS

.category-no-cart .sqs-add-to-cart-button {
  display: none !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 9 months later...

@fred

Please post the URL for your site.

If your site is not public please set up a site-wide password, if you've not already done so.

Post the password here.

Adding a site-wide password is not a security breach. Please read the documentation at the link provided to understand how it works.

We can then take a look at your issue.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment
19 hours ago, creedon said:

@fred

Please post the URL for your site.

If your site is not public please set up a site-wide password, if you've not already done so.

Post the password here.

Adding a site-wide password is not a security breach. Please read the documentation at the link provided to understand how it works.

We can then take a look at your issue.

Much appreciated..

https://squareone.squarespace.com/

Password: zoro

Link to comment
  • Solution
On 5/21/2020 at 8:05 PM, akb33 said:

I only want it to remove the [add to cart] button on certain products (say, products that are tagged "in-store" or that have 0 inventory). Is this possible?

 

The reason why the code above isn't working, is because it is now outdated. It relies on categories being included in the Product Details section of the page, but they are no longer included on Squarespace 7.1 (since Product Collections 2.0 were introduced). 

As you've already added a 'no-cart' tag to the product, you can use this instead. Simply change .category-no-cart to .tag-no-cart in the code, and the button should be hidden. See below.

.tag-no-cart .sqs-add-to-cart-button, .tag-no-cart .product-quantity-input {
  display: none !important;
}

  If this helps you, please click "Like" below  ⬇️

hide-add-to-cart-using-tag-7-1.thumb.gif.b87c3056ba64fdf889ad3311b798adfc.gif

 

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

Link to comment
  • 2 months later...

Hello, 

I also tried to add 'no-cart' category and the code:

.category-no-cart .sqs-add-to-cart-button {
  display: none !important;
}

 but no luck. Any thoughts on having 'GIRLS' as a non-buyable product listed on the BOOK NOW page?

www.thepappyshow.co.uk

Link to comment
2 hours ago, Hebon said:

Hello, 

I also tried to add 'no-cart' category and the code:


.category-no-cart .sqs-add-to-cart-button {
  display: none !important;
}

 but no luck. Any thoughts on having 'GIRLS' as a non-buyable product listed on the BOOK NOW page?

www.thepappyshow.co.uk

Add to Design > Custom CSS

/* Girls-hide add to cart */
body#item-60aded5b7a384613d66dc440 .sqs-add-to-cart-button-wrapper {
    display: none !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 9 months later...

@ecweb2

It appears you added the tags to your product but you have not installed the CSS that actually does the hiding.

There are several different ways being discussed in this thread so I can't help further as I don't know which one you tried to follow.

And to add to the confusion I have my own variation on this technique! 🙂

 

My code is a bit more generalized and flexible in that it handles the two most common things folks want to hide. The add to cart button and quantity.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.