akb33 Posted May 21, 2020 Share Posted May 21, 2020 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
tuanphan Posted May 22, 2020 Share Posted May 22, 2020 Add category: no-cart, then add this to Home > Design > Custom CSS .category-no-cart .sqs-add-to-cart-button { display: none !important; } fred 1 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
fred Posted March 10, 2021 Share Posted March 10, 2021 Hi there, I added the no-cart category to product but the button still shows but it didn't work.. any ideas? Much appreciated!Thanks Link to comment
creedon Posted March 11, 2021 Share Posted March 11, 2021 @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
fred Posted March 11, 2021 Share Posted March 11, 2021 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
creedon Posted March 11, 2021 Share Posted March 11, 2021 @fred I can see a tag called "no-cart" has been added to that product but no category with that name. Edit that product and double-check that you have added that category. Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
fred Posted March 12, 2021 Share Posted March 12, 2021 Thanks for the reply, the "no-cart " was always in category (per my previous screenshot). I since added the No-cart tag testing something else.. sorry about the confusion. Here's another screenshot.. showing both. Link to comment
Solution paul2009 Posted March 12, 2021 Solution Share Posted March 12, 2021 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 ⬇️ creedon, tuanphan and fred 3 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
fred Posted March 12, 2021 Share Posted March 12, 2021 paul2009's solutions works like a charm! Thank You! Fred tuanphan 1 Link to comment
Hebon Posted May 26, 2021 Share Posted May 26, 2021 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
tuanphan Posted May 26, 2021 Share Posted May 26, 2021 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
ecweb2 Posted March 1, 2022 Share Posted March 1, 2022 Hello @tuanphan I wondered if you might be able to help me with the same thing. I followed the directions above using the tag no-cart but it still isn't working for me. I just need it hidden on this one page: https://www.samavesayoga.com/short-course-enroll/p/community-inclusivity-trauma-informed-yoga Thank you so much Link to comment
creedon Posted March 1, 2022 Share Posted March 1, 2022 @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
ecweb2 Posted March 1, 2022 Share Posted March 1, 2022 @creedon You way works! Thank you so much! creedon 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment