Jump to content

How to add a 'red dot' to sold product in my shop when I've hidden the 'add to cart' button

Recommended Posts

Site URL: https://drkmcb.com/shop

Hello 

With thanks for your help to add custom code to hide the 'add to cart' button in my shop, I'm now wanting to know how to add a red dot or a way to show an item is sold in the shop. 

I mentioned in my question yesterday that I want to have the shop without the ecommerce. Hiding 'add to cart' and not setting up a check out is basically what I want, but it would be great to add a red dot to art that recently sold if I can. 

In case you need to know the code I'm using for hiding add-to-cart, this is what has been injected currently vai Design > Custom CSS:

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

Link to comment

Not sure this is exactly what you want. I suggest trying to work within the features SS does provide.

You can set the product quantity to zero.

1382663836_ScreenShot2022-07-22at2_11_37PM.thumb.png.7a2aac69949abed0d8056e5cae389069.png

Doing so will then put the sold out mark on the product.

1202673679_ScreenShot2022-07-22at2_16_32PM.png.71072f66a32c244cb5c4aadd3da6c23b.png

489307604_ScreenShot2022-07-22at2_16_12PM.png.d1f596020d08acf8e4321434325d1d30.png

From there if you want something different from Sold Out. Use CSS and/or JavaScript to manipulate the mark.

The idea here being take advantage of the underlying elements SS is providing and modify them.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
2 hours ago, Dr_KMcB said:

Do you know if there is a way to drop 'out' so it just says 'sold'? 

For that you need a little custom code.

Add the following to Store Settings > Advanced > Page Header Code Injection for the store page. Please see per-page code injection.

<style>

  .products.collection-content-wrapper .product-mark.sold-out {
  
    visibility : hidden;
    
    }
	
  .products.collection-content-wrapper .product-mark.sold-out::after {
  
    content : 'sold';
    visibility : visible;
    
    }
	
  .sold-out .product-details .product-mark.sold-out {
  
    visibility : hidden;
    
    }
	
  .sold-out .product-details .product-mark.sold-out::before {
  
    content : 'sold';
    visibility : visible;
    
    }
	
  </style>

This is for v7.1 and specific to the posters need.

In the future if you have a unique painting (only 1 available) just set the product quantity to 1 and SS will take care of the rest after it is sold.

Let us know how it goes.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 2 weeks later...
  • 2 months later...
22 hours ago, catalienne said:

Hi @tuanphan any idea re red dot for sold out thanks 🙂

Like this?

image.thumb.png.ddd910fbdbec854e43876cb486ae59d7.png

.sold-out .pdp-gallery-slides.selected.going-next.sqs-pinterest-products-wrapper.loaded:after {
    content: "";
    background-color: red;
    width: 50px;
    height: 50px;
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    border-radius: 50%;
}

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 4 weeks later...
On 11/8/2022 at 6:04 PM, catalienne said:

Thank you @tuanphan

I was thinking something similar to how art galleries have red dots under the paintings so the red dot would be next to the title of the painting.

Thank you

Like this?

image.thumb.png.75ebbb28532584792a9c2c3ef5febef9.png

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 11/14/2022 at 1:55 PM, catalienne said:

Yes thank you mainly in the title in the Shop thanks 🙂

Add to Design > Custom CSS

.sold-out h1.pdp-details-title:after {
    content: "";
    background-color: red;
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: absolute;
    right: -20px;
    top: 50%;
}

h1.pdp-details-title {
    position: relative;
    display: inline-block;
}

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 11/24/2022 at 5:13 PM, catalienne said:

Thanks @tuanphan unfortunately nothing happened 😞

Try adding this to Settings > Advanced > Code Injection > Header

<style>
  .sold-out h1.pdp-details-title:after {
    content: "";
    background-color: red;
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: absolute;
    right: -20px;
    top: 50%;
}

h1.pdp-details-title {
    position: relative;
    display: inline-block;
}
</style>

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 5 months later...
  • 4 months later...
On 10/17/2023 at 10:13 PM, hannahmunby said:

Hi @tuanphan - sorry I never got back to you on this!! I was hoping to be able to add the red dot next to the title underneath the image. Here is a product page. https://www.fendittongallery.com/going-yellow. I have also since update the website to 7.1 so it isn't quite the same now.

Thank you!

add to right of title or under title?

and how about individual pages? do both (list + detail page) or on list page only

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.