Jump to content

Add text after price on product overview and product pages EXCEPT on tagged products

Recommended Posts

Posted (edited)

Site URL: https://pineapple-seadragon-2hrz.squarespace.com/

Hi

Site pwd: Hello

I have previously used code from here:

The three last products on my site are tagged poa so that they do not show an add to cart button on their pages or the product overview, and I have a separate piece of code so that the text "Contact us for more information" replaces the pricing on the product overview.

I then followed the link above for code to add text after every product price in both locations. I need to omit that text from items tagged poa on the product overview. Please see the attached image where the item on the left is correct but the item on the right (tagged poa in order to show custom text instead of pricing) is incorrect.

Help with this would be greatly appreciated.

 

Screenshot 2024-09-20 153854.png

Edited by DBrabazon
formatting/clarification
  • Replies 3
  • Views 667
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted (edited)
2 hours ago, DBrabazon said:

I...followed the link above for code to add text after every product price in both locations. I need to omit that text from items tagged poa

@DBrabazon Instead of using the CSS below that adds the text after every product price:

.product-price::after {
  content: ' when collected from our Hobart collection point';
}

Use the CSS below instead. This will only add the text when the item doesn't have the POA tag.

.grid-item:not(.tag-poa) .product-price::after {
  content: ' when collected from our Hobart collection point';
}

Did this help? Please give feedback by clicking an icon below  ⬇️

Edited by paul2009

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Posted (edited)
On 9/20/2024 at 8:40 AM, paul2009 said:

@DBrabazon Instead of using the CSS below that adds the text after every product price:

.product-price::after {
  content: ' when collected from our Hobart collection point';
}

Use the CSS below instead. This will only add the text when the item doesn't have the POA tag.

.grid-item:not(.tag-poa) .product-price::after {
  content: ' when collected from our Hobart collection point';
}

Did this help? Please give feedback by clicking an icon below  ⬇️

Thank you for your response.

I tried this, replacing in Website Tools>Custom CSS:

.product-price::after {
  content: ' when collected from our Hobart collection point';
}

with

.grid-item:not(.tag-poa) .product-price::after {
  content: ' when collected from our Hobart collection point';
}

And this did fix the problem where "when collected from our Hobart collection point" would show on the products page after POA items, but it had the unwanted side effect of removing "when collected from our Hobart collection point" from product pages. Images attached before and after.

 

1111.png

2222.png

Edited by DBrabazon
attachment before/after ordering fix
Posted
22 hours ago, DBrabazon said:

Thank you for your response.

I tried this, replacing in Website Tools>Custom CSS:

.product-price::after {
  content: ' when collected from our Hobart collection point';
}

with

.grid-item:not(.tag-poa) .product-price::after {
  content: ' when collected from our Hobart collection point';
}

And this did fix the problem where "when collected from our Hobart collection point" would show on the products page after POA items, but it had the unwanted side effect of removing "when collected from our Hobart collection point" from product pages. Images attached before and after.

 

1111.png

2222.png

  

I was able to fix it myself by adding a code block to each non-POA item's product page.

<style>.product-price::after {
  content: ' when collected from our Hobart collection point';
}</style>

Everything seems to be fixed. Thank you!

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.