Product Upsell For 7.0

The original library, featuring hundreds of copy-and-paste plugins for Squarespace. These legacy plugins are preserved as they were originally released and are available as-is. For no-code plugins with visual editing and live previews, explore the current plugin library.
Overview
Redirect customers to an upsell page after they add an item to the cart. This plugin uses code injection and works with Squarespace 7.0 (Brine template family).
Plugin Delivery
This is a free plugin from the original Ghost Plugins library. Copy the code below and paste it into your Squarespace site. No purchase or account needed.
Squarespace Compatibility & Requirements
Compatibility notes preserved from the original release.
Install
Legacy plugins install by hand, there is no Plugin Studio build for this one.
- 1Copy the code from the Code Documentation section below.
- 2In Squarespace, open Website, Pages, Website Tools, Custom CSS for CSS, or Settings, Advanced, Code Injection for HTML and JavaScript.
- 3Paste the code, save, then refresh your site to see the plugin running.
Code Documentation
From your Squarespace account, go to Site Code Injection. Copy and paste the code below into the Header Code Injection box.
JavaScript
<!-- Redirect to the Upsell Page after clicking on the Add To Cart button -->
<!-- Author: Dmitry Kiselyov @_dmitrykiselyov -->
<script>
function redirectToUpsellPage() {
var upsellPageUrl = '/PAGE-URL-SLUG';
var addToCartButton = document.querySelector('.sqs-add-to-cart-button');
var productVariants = document.querySelector('.product-variants');
function isVariantInStock() {
return productVariants.getAttribute('data-variant-in-stock');
}
function onClick() {
if (productVariants && isVariantInStock() || !productVariants) {
setTimeout(function() {
document.location.href = upsellPageUrl;
}, 1000);
}
}
if (addToCartButton) {
addToCartButton.addEventListener('click', onClick);
}
}
document.addEventListener('DOMContentLoaded', redirectToUpsellPage);
window.addEventListener('mercury:load', redirectToUpsellPage);
</script>
<!-- end Redirect to the Upsell Page after clicking on the Add To Cart button -->Script Settings
Values you can adjust at the top of the script to change how the plugin behaves.
'/PAGE-URL-SLUG'document.querySelector('.sqs-add-to-cart-button')document.querySelector('.product-variants')FAQ
Answers to common questions about setup, customization, and troubleshooting.
Is this plugin free?
Yes. Legacy plugins are free to use on any site, no account or purchase needed.
Will it work on my Squarespace version?
Legacy plugins were built for the version noted in Squarespace Compatibility & Requirements and are provided as-is. Newer platform changes may require small tweaks.
Can I customize it?
Yes. Edit the values in Script Settings or override the selectors listed under Classes and Styling in your Custom CSS.
Do you support legacy plugins?
Legacy plugins are no longer updated. For maintained plugins with Plugin Studio and ongoing support, browse the current plugin library.
Changelog
A history of updates released for this plugin.
Original release
Archived exactly as it shipped in the original plugin library. No further updates are planned for legacy plugins.
Customizable Options
Change the PAGE-URL-SLUG in the code to the page’s url slug that you’d like customers to be redirect to. The url slug can be found in the page’s settings.
Express Checkout in the checkout settings must be disabled for the redirect to work.
Recommended
Want the current Ghost experience?
Explore the current plugin library for plugins with live previews, built-in customization options, Plugin Studio editing, easier installation, and ongoing updates designed for the latest Ghost experience.
Browse Current Plugins →