Jump to content

Adding same text to appear for all products on product details page

Recommended Posts

I'm trying to add some common text to the Product Details page that appears for every product.  I could add the text manually in the product description or additional Info on every product record, but hopefully there's a way to add it once somewhere in the code so that it appears at the end of the product additional info automatically.

Thank you in advance

Link to comment

I think we need to inject it by code, what is your site url and your text needed to be added?

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
6 hours ago, PeterWard said:

Hey thanks  bangank36...

Website is :https://www.blaiserubyloves.co.uk/shop/p/mansur-gavriel-beige-tote

Password: buster

The text I want for every product is the part that starts with "For more on this bag.....".  At the moment i have to type that into every product description

You may need js to help with, modify it at your will and place it in Advanced->Custom code injection

<script>
var addedText = '<p class="" style="white-space:pre-wrap;"><em>For more on this bag head to @blaiserubyloves instagram for more in depth videos and pictures of this bag and others, where you will see more on condition, imagery of the bag and styling tips.&nbsp;</em></p>';
document.addEventListener('DOMContentLoaded', function() {
    if ( document.querySelector(".ProductItem-details-excerpt") ) {
        document.querySelector(".ProductItem-details-excerpt").insertAdjacentHTML("beforeend", addedText);
    }
});
</script>

 

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 11/4/2020 at 7:32 PM, PeterWard said:

Thats brilliant.  Thanks bangank36.. On the mark

Some feedback for your site, hope it useful

I see on product page, it shows number (1/3), you can consider adding a slideshow arrows, users can easily navigate to view more pictures

You can add this to Home > Design > Custom CSS to achieve this.

/* Arrow slide */
/* Product slide arrows control */
@media screen and (max-width:767px) {
.ProductItem-gallery-carousel-controls {
    display: flex !important;
}
/* arrows background */
.ProductItem-gallery-carousel-controls * {
    background: white;
}
.ProductItem-gallery-carousel-controls>div {
    justify-content: center !important;
}
.ProductItem .ProductItem-gallery-carousel-controls>div::after, .ProductItem .ProductItem-gallery-carousel-controls>div::before {
    border-color: black !important;
}
}

image.thumb.png.de145484a50c236adbc105ff8fe517b9.png

Also, the product page has very long content, you can add a back to top button, it would be better.

Eg this page. https://www.blaiserubyloves.co.uk/shop/designers

You can follow this guide to add one.

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
  • 1 year later...
39 minutes ago, violetcraft said:

this is really helpful. Is there a way to add the text only to digital products?

Can you share your site URL with the digital products so we can take a look?

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

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.