Afterpay Site Messaging
How can I add Afterpay Site Messaging to my product and cart pages?
Be careful, as these instructions require editing code. Before you make any changes to theme template files, back up your current theme customizations.
There are two types of theme platform on BigCommerce; Stencil & Blueprint.
Follow the instructions below according to which theme platform your store uses.
If you are not sure what platform is used by your store, see Which Theme Platform do I have?.
Stencil
-
Go to Storefront › Script Manager
-
Click Create a Script.
-
Set up the following:
- Name of Script: Afterpay Messaging
- Description: Place Afterpay Site Messaging on product and cart pages
- Location on page: Footer
- Select pages where script will be added: Store pages
- Script category: Essential
- Script type: Script
- Load method: Default
-
Copy and paste the below script into Script Contents:
You can modify the script so that the banner will only display a price breakdown if the product meets your order minimum and maximum thresholds.
To do so, you will need to edit the following values within the script and set the minimum and maximum values to mirror your Afterpay account settings.
script.dataset.min = “1.00”;
script.dataset.max = “800.00”;
For example, if you set the script.dataset.max value to 100.00, your shoppers would see the following banner on a 200.00 priced product:
Banner not showing up?
Sometimes the script may not work because the HTML elements may be named differently depending on your theme. Please work with your developer to help update the script depending on your theme.
Blueprint
-
Access your themes template files by going to Storefront › Templates Files.
Find the file Panels/ProductDetails.html. -
Copy the script below and paste it in Panels/ProductDetails.html:
You should now see Afterpay’s messaging underneath the price of products and the cart total.