Jump to content

How to enable "Add to Cart" for specific items only?

Recommended Posts

Hello I have disabled all add to cart buttons using this code in custom CCS

// Hide Add To Cart Button //

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

is there anyway I could enable the add to cart button on specific items of my choosing (Lets say just for the "spring footsal league 2nd-4th division" just for example). If this is not possible, I would love help doing it the other way around where I disable the add to cart button on specific items of my choosing. Any insight would be greatly appreciated!

Spring Futsal League 2nd-4th Division — BEYOND BALL HAWAII

Edited by Beyondballhawaii
added link
Link to comment
1 hour ago, Beyondballhawaii said:

Hello I have disabled all add to cart buttons using this code in custom CCS

// Hide Add To Cart Button //

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

is there anyway I could enable the add to cart button on specific items of my choosing (Lets say just for the "spring footsal league 2nd-4th division" just for example). If this is not possible, I would love help doing it the other way around where I disable the add to cart button on specific items of my choosing. Any insight would be greatly appreciated!

Spring Futsal League 2nd-4th Division — BEYOND BALL HAWAII

Each product page on squarespace has a unique id. You can use your above code with item id to set the appropriate style for add to cart button

image.thumb.png.03e96687e2c603920b277c3a6675fb48.png

You can the following extension to get page id: squarespace id finder - Google Search

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
On 3/25/2024 at 8:07 PM, Beyondspace said:

Each product page on squarespace has a unique id. You can use your above code with item id to set the appropriate style for add to cart button

image.thumb.png.03e96687e2c603920b277c3a6675fb48.png

You can the following extension to get page id: squarespace id finder - Google Search

what would the code look like to disable the add to cart for the specific unique item ID? Not sure how to add that part to the code. 

Link to comment
18 minutes ago, Beyondballhawaii said:

what would the code look like to disable the add to cart for the specific unique item ID? Not sure how to add that part to the code. 

<style>

    #item-65bc2f73a96a806b3a8d7d26 .ProductItem-details .sqs-add-to-cart-button-wrapper {
    
      display : none;
      
      }
      
  </style>

 

found the code above on this forum and it solved my issue. Thank you for recommending the square id finder, very helpful.

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.