Jump to content

Adding 'new' label to product thumbnail pictures

Recommended Posts

Is there a way to add a 'new' label to certain product thumbnails - much like the 'sold out' label - which appears once something is out of stock? Ideally I'd like to see a label which says NEW on relevant thumbnail products on the product list page, with a green background colour.

I googled & found this link which seems to describe what I want. i've founded instructions, but it's not working for me: https://sf.digital/squarespace-solutions/adding-a-custom-product-badge-to-squarespace

Link to comment

Hi,

This is possible. I helped some member with new label on Summary & Related Products

First, you need to add a tag: new to these products, then share link to shop page & product where you assign tag: New, we can check & give you code easier

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
  • 11 months later...

I got this working now, however ideally I'd like to have a second type of tag - saying best seller, is this possible? I added custom CSS as well as code injection, and when duplicating this solution and changing to the word 'new' in the code for 'best seller', it then stopped all tags working

Link to comment
13 hours ago, rockout_james said:

I got this working now, however ideally I'd like to have a second type of tag - saying best seller, is this possible? I added custom CSS as well as code injection, and when duplicating this solution and changing to the word 'new' in the code for 'best seller', it then stopped all tags working

Suppose you have 5 products: A, B, C, D, E, F

You want:

  • A, B: "New"
  • C, D, E, F: "Best Seller"

The process should be

(1) Create 2 tags: New, Best Seller
(2) Assign tag New for products A, B

(3) Assign tag Best Seller for products C, D, E, F

(4) Use CSS code

/* Badge: New */
.tag-new:after {
    content: "New";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #f1f2f3;
    padding-left: 10px;
    padding-right: 10px;
    color: red;
    font-weight: 600;
    font-size: 14px;
}
/* Badge: Best Sẹller */
.tag-best-seller:after {
    content: "Best Seller";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: violet;
    padding-left: 10px;
    padding-right: 10px;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

If you follow exact steps but it still doesn't work, you can share link to your shop page, I will check it again

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

Tuanphanton CSS code works like a charm for me. However, there's a small problem with the positioning of the tag on the shop->product page: the tag is positioned at the right-hand corner of the page and not on the thumbnail image.  

Link to comment
On 3/3/2024 at 5:54 PM, SuperSuper said:

Tuanphanton CSS code works like a charm for me. However, there's a small problem with the positioning of the tag on the shop->product page: the tag is positioned at the right-hand corner of the page and not on the thumbnail image.  

Can you share link to a product page? I can check it easier

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 3/3/2024 at 5:54 PM, SuperSuper said:

Tuanphanton CSS code works like a charm for me. However, there's a small problem with the positioning of the tag on the shop->product page: the tag is positioned at the right-hand corner of the page and not on the thumbnail image.  

You can use this CSS code. Repeat similar for other tags

body.view-item .tag-promo:after {
    content: "%💥 ";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #000058;
    padding-left: 10px;
    padding-right: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    display: none;
}
body.view-item .tag-promo .ProductItem-gallery-slides:after {
    content: "%💥 ";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #000058;
    padding-left: 10px;
    padding-right: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

image.thumb.png.1a31085ec5d375507f7473eacae17fc4.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
  • 2 weeks later...

Hello Tuanphan !

I'm sorry for my traditional answer. Thank you for your code. But, it seems to me that there is a mistake. This corrected the problem on the shop->product page. 
https://www.bluecabas.com/quality-apple-cases-best-price/p/ultramarine-blue-iphone-cases-affordable

But now the Tag is no longer visible on the Shop page. 
https://www.bluecabas.com/quality-apple-cases-best-price

Do you have a solution? 
Thanks for your help!!!

Link to comment
21 hours ago, SuperSuper said:

Hello Tuanphan !

I'm sorry for my traditional answer. Thank you for your code. But, it seems to me that there is a mistake. This corrected the problem on the shop->product page. 
https://www.bluecabas.com/quality-apple-cases-best-price/p/ultramarine-blue-iphone-cases-affordable

But now the Tag is no longer visible on the Shop page. 
https://www.bluecabas.com/quality-apple-cases-best-price

Do you have a solution? 
Thanks for your help!!!

 

New code for Product Detail Only.

Don't remove code you used for Tag/Category Page

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.