Below you will find the code to insert the promotional message inside the product sheet.
For HeyLight Dilazione you do not need any Public API Key.
<!-- DEFINE CUSTOM TERMS HERE -->
{% assign minimum_amount = 10000 %}
{% assign maximum_amount = 500000 %}
{% assign available_terms = '3,6,12,24,36' | split:"," %}
{% assign min_instalment_amount = 2000 %}
<!-- DON'T CHANGE ANYTHING BELOW THIS LINE -->
{%- if product.price >= minimum_amount and product.price <= maximum_amount -%}
{% assign term_ceiling = product.price | divided_by: min_instalment_amount %}
{% assign acceptable_terms = '' %}
{% for term in available_terms %}
{% assign test_term = term | times: 1 %}
{% if test_term <= term_ceiling %}
{% assign acceptable_terms = acceptable_terms | append: "," %}
{% assign acceptable_terms = acceptable_terms | append: term %}
{% endif %}
{% endfor %}
<div class="heidi_messaging">
<div id="heidipay-container"
data-heidipay="true"
data-heidipay-minorAmount="{{ product.price }}"
data-heidipay-allowedterms="{{ acceptable_terms | split: "," | last }}"
data-heidipay-currencySymbol="EUR"
data-heidipay-lang="it"
data-heidipay-type="PRODUCT_DESCRIPTION_HEYLIGHT_BNPL_IT"
data-heidipay-apiKey="PUBLIC_API_KEY"
data-heidipay-cadence="MONTHLY"
data-heidipay-thousandsSeparator="."
data-heidipay-decimalSeparator=","
data-heidipay-symbolOnLeft="false"
data-heidipay-spaceBetweenAmountAndSymbol="true"
data-heylight-logo-variant="red"
data-heidipay-decimalDigits="2" >
</div>
</div>
{%- endif -%}
You will also need to include the script below. We recommend it be included somewhere it will always load (typically the index or a footer).
<!-- FOR DEMO / SANDBOX VERSION -->
<script src="https://sbx-upstream.heidipay.io/sdk/heidi-upstream-lib.js" ></script>
<!-- FOR PRODUCTION / LIVE VERSION -->
<script src="https://upstream.heidipay.com/sdk/heidi-upstream-lib.js" ></script>
This script will load the promotional message.