Integrate into Shopify Themes built with Liquid
This guide will walk you through Purple Dot's Platform integration into any Shopify store built with Liquid Templates. If you are using our Shopify App, please seeInstalling our Shopify App instead. See Purple Dot Overview for the comparison of our Shopify App vs. Platform integrations.
This will allow you to turn the Purple Dot integration on and off without any code changes.
Clone your currently live theme to make a new preview theme
In
config/settings_schema.json
add the followingIn
config/settings_data.json
add the following
In the preview theme create a new snippet and name it
purple-dot.liquid
In
layout/theme.liquid
find the closing</head>
tag and place the following code just before itIf your theme still uses
checkout.liquid
find the closing</head>
tag and place the following code just before it
We will use purple-dot.liquid
as the place where all other Purple Dot related code lives. It is being rendered from the header as it is required to run on every single page in your Shopify store for Purple Dot to function correctly.
Paste the following snippet into purple-dot.liquid
Replace SHARED_SECRET
and PUBLIC_API_KEY
with the public API key and shared secret of your Purple Dot store, which can be found at the bottom of the Integration settings page in the Merchant Portal.
Purple Dot offers 3 different methods for shoppers to buy pre-order products
Combined Cart (the default)
Separate Cart
Express
If you want to use a non-default checkout method, please create a new script
tag before init.js
that will use window.PurpleDotConfig
to specify this:
To use Separate Cart
To use Express
If you do not know which checkout method you would like to integrate, contact us for more information.
Each checkout method may require some specifics to work with your store's theme.
No extra configuration is necessary
No extra configuration is necessary
Configure the cart placement
Configure variant selectors on a PDP
Sometimes, a PDP will have variant selectors that show the variant as sold out, even though the variant is available for preorder. In this case, we can target these elements, and remove a 'disabled' class (or similar) from them in order to 'enable' them.
There are two ways of selecting elements (depending on whether or not they are inside an ATC form), but you must always provide a class to remove.
Modify existing PDP/PLP page behaviour
We support a number of customisations to Product Detail Pages (PDP) and Product Listing Pages (PLP) that may be required.
Out of the box, when the shopper selects a variant that is on pre-order through Purple Dot, we will hide the following on every PDP because we do not support them in our checkouts:
Shopify payment buttons
Klarna messaging
Klaviyo notify me buttons
as well as others
If you would like to hide some elements on PLPs or PDPs, simply add a pdp.hide
or plp.hide
attribute with an array of selectors to instruct Purple Dot to hide these if the selected variant will be on pre-order
If you would like to show some elements on PDPs, create them in your theme with display:none
and then add a pdp.show
attribute with an array of selectors to instruct Purple Dot to display these if the selected variant will be on pre-order.
To modify the quick view/add components on a PLP for any product that is on pre-order
Automatically apply discount
The provided discount will be applied to every checkout involving a line item on preorder.
Enable pre-order stock notification
Purple Dot will email the subscribed shoppers when the product is back on pre-order. Please note: this feature is only supported by EXPRESS
and SEPARATE_CART
checkout methods.
Tracking pre-orders
The Purple Dot SDK can automatically forward events to various product analytics, ad and order tracking platforms. You can activate these integrations from the Integration settings page in the Merchant Portal. See Pre-order tracking for more information about these integrations.
Restrict Purple Dot to some markets
Some merchants handle multiple markets with one Shopify store, with checkout handled by another service like Global-E. Purple Dot does not currently support integrating with other checkout providers and so in these cases you can hide Purple Dot in markets you do not wish to offer pre-orders in.
With Global-E
With Shopify
Localise the Pre-order button
Currently we support English, Spanish, German and Dutch.
The correct locale will be automatically detected in most cases but if you wish to override it you can set it yourself.
You can also provide your own copy if you like.
Styling
You may find that you need to style some components on a page differently when a waitlisted variant is selected. In this case, you can add the styles
param to your PurpleDotConfig.pdp
.
A good example of this would be when our 'Waitlist powered by' content is being added incorrectly to the PDP. Our code adds the waitlist content underneath the 'Pre-order' button (in the DOM), but if the button is in a flex container with flex-direction: row
, the waitlist info will be added to the side of the button.
We can solve this using CSS, which will only be applied if the selected variant is on pre-order, and will be removed when the selected variant is not on preorder. We can also specify multiple style rules, if needed, and change values based on screen size, e.g. mobile screens.
The self-service portal allows your customers to see their pre-order history and cancel pre-orders before they are fulfilled. We recommend hosting the self-service iframe on a new page - e.g. /pages/manage-pre-orders
- that is linked from your support pages, similar to how a returns portal would be.
The title of the page should be Manage Pre-orders
The following snippet can be placed on a Shopify page by editing the page's HTML:
Please refer to Test the Platform Integration.
Publish the preview theme
Set up Waitlists in your Purple Dot Merchant Portal
Last updated