Widget configuration
Most stores need two attributes. Everything else is optional and only changes the look.
The essentials
Every widget needs to know who you are and where your price is. With these two attributes and the default settings, the widget is ready to go live.
<scalapay-widget
merchant-token="YOUR_MERCHANT_TOKEN"
amount-selectors='["#product-price"]'
></scalapay-widget>| Attribute | What it tells the widget |
|---|---|
merchant-token | Who you are, so it shows the plans in your contract |
amount-selectors | Where the price is, so it can calculate the installments and follow price changes |
Then add type for pages other than the product page, and locale if your site isn't in English.
Recipes
Copy the one that matches your case.
My site is in another language
Set locale to the page language: it, fr, es, de, pt or en. The currency symbol moves to the usual position for that language.
<scalapay-widget locale="it" merchant-token="YOUR_MERCHANT_TOKEN" amount-selectors='["#product-price"]'></scalapay-widget>I show a sale price and a regular price
List both selectors, the sale price first. The widget uses the first one that holds a valid amount.
amount-selectors='[".price .sale", ".price .regular"]'My prices use a dot for decimals
For prices written like 1,299.00:
amount-separator="."The price isn't in the page
If a script calculates the price and no element holds it, pass it directly. amount is used only when amount-selectors finds nothing.
amount="300,64"I want a smaller widget
Hide the info band, use the small font and remove the grey background.
info-band="hidden" font-size="small" background="false"My site has a dark theme
Use always for a site that is always dark, system to follow the customer's device setting.
dark-mode="always"I want the widget only within a price range
Narrow the range in which the widget appears. You can narrow your contract limits but not widen them.
min-amount="100" max-amount="1500"I want to set every option
The full tag for each page type, with every attribute that page accepts set explicitly. Leave out any attribute you don't need: it falls back to its default. The attribute reference lists the values and defaults.
<scalapay-widget
type="product"
merchant-token="YOUR_MERCHANT_TOKEN"
environment="production"
amount-selectors='["#product-price"]'
amount="99.90"
amount-separator=","
min-amount="5"
max-amount="2000"
currency-position="after"
locale="en"
channel=""
info-band="visible"
background="true"
font-size="normal"
dark-mode="never"
logo-color="black"
alignment="left"
max-width="auto"
></scalapay-widget><scalapay-widget
type="cart"
merchant-token="YOUR_MERCHANT_TOKEN"
environment="production"
amount-selectors='["#cart-total"]'
amount="99.90"
amount-separator=","
min-amount="5"
max-amount="2000"
currency-position="after"
locale="en"
channel=""
info-band="visible"
background="true"
font-size="normal"
dark-mode="never"
logo-color="black"
alignment="left"
max-width="auto"
></scalapay-widget><scalapay-widget
type="listing"
merchant-token="YOUR_MERCHANT_TOKEN"
environment="production"
amount-selectors='[".catalog .card .amount"]'
position-selectors='[".catalog .card .actions"]'
amount-separator=","
min-amount="5"
max-amount="2000"
currency-position="after"
locale="en"
channel=""
background="true"
font-size="small"
dark-mode="never"
logo-color="black"
alignment="left"
max-width="auto"
></scalapay-widget><scalapay-widget
type="checkout"
merchant-token="YOUR_MERCHANT_TOKEN"
environment="production"
amount-selectors='["#order-total"]'
amount="99.90"
amount-separator=","
min-amount="5"
max-amount="2000"
currency-position="after"
locale="en"
dark-mode="never"
alignment="left"
max-width="auto"
></scalapay-widget>amount is used only when amount-selectors finds no price. An empty channel means the standard text. min-amount and max-amount must stay within your contract limits. On listing, position-selectors is required.
I sell travel
The text then refers to bookings instead of purchases.
channel="travel"
What you can't changeThe text, the costs shown and the link to the details window follow the consumer credit rules, including CCD2. No attribute changes them. If a setting looks missing, that's usually why.
Attribute reference
The attribute works on that page type. It has no effect there.
Required
| Attribute | Description | Values | Default | Product | Listing | Cart | Checkout |
|---|---|---|---|---|---|---|---|
merchant-token | Identifies your store and its contract | Your token, from Developer in the Merchant Portal, or from your acquirer setup. Test token: 8KDS3SPEL | None | ||||
amount-selectors | Where the widget reads the price | JSON array of CSS selectors | None | ||||
position-selectors | Required on listing. Where the label goes in each product card | JSON array of CSS selectors. The label goes after the matched element | None |
Page and environment
| Attribute | Description | Values | Default | Product | Listing | Cart | Checkout |
|---|---|---|---|---|---|---|---|
type | The page the widget is on | product · listing · cart · checkout | product | ||||
environment | Test or live environment. Must match your token | integration · production | production |
Price
| Attribute | Description | Values | Default | Product | Listing | Cart | Checkout |
|---|---|---|---|---|---|---|---|
amount | Fixed price, used if amount-selectors finds none | A price, e.g. 99.90 | None | ||||
amount-separator | Decimal separator in your prices | , · . | , | ||||
min-amount / max-amount | Price range in which the widget appears | Within your contract limits | Contract limits | ||||
currency-position | Currency symbol before or after the amount | before · after | Depends on locale |
Language
| Attribute | Description | Values | Default | Product | Listing | Cart | Checkout |
|---|---|---|---|---|---|---|---|
locale | Language of the widget text | en · it · fr · es · de · pt | en | ||||
channel | Travel wording: bookings instead of purchases | travel | None |
Look
| Attribute | Description | Values | Default | Product | Listing | Cart | Checkout |
|---|---|---|---|---|---|---|---|
info-band | Band listing all the ways to pay | visible · hidden | visible | ||||
background | Grey background behind the widget | true · false | true, false on listing | ||||
font-size | Text size | normal · small | normal | ||||
dark-mode | Version for dark backgrounds | never · always · system | never | ||||
logo-color | Color of the Scalapay logo | black · pink | black | ||||
alignment | Text alignment | left · center · right | left | ||||
max-width | Maximum width in its container | auto or a percentage of the container, e.g. 60% | auto |
Settings saved for your accountWidget settings saved for your account, for example in the Merchant Portal, take precedence over the attributes on your tag. Change them where they were saved.
Release notes
Release notes are in the widget changelog.
Updated 1 day ago
