Jump to content

Code Injection Cart Page

Go to solution Solved by paul2009,

Recommended Posts

  • Solution
Posted (edited)
On 1/29/2022 at 9:58 PM, andymallinsphotography said:

Is it possible to inject Javascript on the cart page, currently I can do this on all my pages using the page header code injection for my Trustpilot widget

Instead of injecting code on each page individually, you can inject it to all pages via the site Code Injection panel. Code added here will apply to most* pages, including the cart page. 

*It will not apply to the Checkout page, Lock Screen or Cover Pages.

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

Edited by paul2009
edited for clarity

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
9 minutes ago, paul2009 said:

Instead of injecting code on each page individually, you can inject it to all pages via the site code injection panel in Settings > Advanced > Code Injection. This will include the cart page. 

thank you! that sorted it, no idea why I hadn't thought of this as using it for other code! Thanks again, I've also got another question around resizing the cart view on mobile, any help on that one to would be greatly appreciated! Thanks again.

  • 1 year later...
Posted
1 hour ago, pixels said:

Is there a way to add a code snippet that only applies to the shopping cart page?

You should add the code in the usual place (the Custom CSS panel for CSS or the Code Injection panel (for JavaScript or HTML) and then target your code, through the use of selectors, to ensure it only applies to the cart page. For example, the ID "#cart".

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

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.

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.