- Faster Load Times
- Local hosting reduces dependency on external servers.
- Greater Control
- Merchants have full authority over the widget’s appearance and behavior, as the Sezzle team cannot modify it.
This local control means merchants are responsible for any updates or changes to the widget.
Installation
Select the implementation that fits your needs:NPM Implementation
If your website is built with React, please refer to the package and documentation here.
npm install @sezzle/sezzle-static-widget@latest
Within your product page, add the following code snippet where you want the widget to render, updating the path to node_modules for your file structure:
HTML Implementation
Implementation varies greatly by platform, theme, etc. Below is a general overview of the process. The code snippets below are samples and may need to be modified to fit your site. For Shopify merchants, please proceed to the next section.
- Create a new Javascript file within your site’s code where appropriate
- Copy and paste this minified code into the newly created file
-
Import the new file into the page(s) where the Sezzle widget will be added
-
Create a placeholder element where the Sezzle widget should be rendered on the page(s), usually below the price container element
-
Add the following script below the placeholder element, updating the amount value to reflect your price variable which renders the current product price or cart total as applicable
-
Preview your changes to confirm the widget is displaying correctly in each of the following scenarios
- Use the Configuration options below to customize the widget appearance as desired:
- Regular Price
- Sale Price
- Variant Selection
- Desktop
- Mobile
- Use the Configuration options below to customize the widget appearance as desired:
Shopify Implementation
- Log into your Shopify store admin
-
Click
Online Store>Themes -
Next to the theme you wish to edit, click
Actions, then selectEdit Code -
Under the
Assetsfolder, clickAdd a new asset -
On the
Create a Blank Filetab, name the filesezzle-static-widgetand select.jsas the file type, then clickAdd Asset -
Copy the code from the repository file and paste it into this new file, then click
Save -
Add the following lines of code wherever the widget should render on the product page within
templates/product.liquidorsections/product-template.liquidas applicable -
Add the following lines of code wherever the widget should render on the cart page within
templates/cart.liquidorsections/cart-template.liquidas applicable
Customizing the Configuration
Once the widget is rendering, additional configurations can be added to the AwesomeSezzle to change the appearance. Below is an example featuring all the options. However, amount is the only required value.- Template
- Example
- Options
Methods
The following functions are built into the static widget and are ready for use for your widget installation. Simply add the applicable snippet to your webpage code, updating the event listener and variables as necessary.alterPrice(newPrice)
Alters price on widget. Create an event listener after renderSezzle.init() that invokes this function where newPrice is the new price value of the selected variant. Example: