### Insert Promotional Message in Product Sheet
Source: https://docs.heylight.com/reference/dilazione-it
Use this Liquid snippet to conditionally render the HeyLight messaging container based on product price and installment eligibility.
```liquid
{% assign minimum_amount = 6000 %}
{% assign maximum_amount = 500000 %}
{% assign available_terms = '3,6,12,18,24' | split:"," %}
{% assign min_instalment_amount = 2000 %}
{%- 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 %}
{%- endif -%}
```
--------------------------------
### Installazione dei moduli HeyLight
Source: https://docs.heylight.com/docs/magento-it
Comandi per installare i moduli di dilazione e finanziamento, inclusa l'opzione per Hyva Themes.
```bash
heylight/it-dilazione
heylight/it-finanziamento
```
```bash
hyva-themes/magento2-heidipay-core
```
--------------------------------
### Configurazione delle credenziali di autenticazione
Source: https://docs.heylight.com/docs/magento-it
Configura il file auth locale con il token fornito da HeyLight per l'accesso al repository.
```bash
composer config --auth http-basic.heidi-pay.repo.packagist.com token
```
--------------------------------
### Configurazione del repository HeyLight
Source: https://docs.heylight.com/docs/magento-it
Aggiunge il repository privato di HeyLight alla configurazione di Composer del progetto.
```bash
composer config repositories.heidi-pay composer https://heidi-pay.repo.packagist.com/pagolight-merchant/
```
--------------------------------
### Configurazione widget HeyLight in Liquid
Source: https://docs.heylight.com/docs/messaggio-promozionale-heylight-dilazione
Snippet Liquid da inserire nel file heylight-widget per definire le soglie di prezzo e le rate disponibili per il messaggio promozionale.
```liquid
{% assign minimum_amount = 6000 %}
{% assign maximum_amount = 500000 %}
{% assign available_terms = '3,6,12,18,24' | split:"," %}
{% assign min_instalment_amount = 2000 %}
{%- 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 %}
{%- endif -%}
```
--------------------------------
### Configurazione Snippet HeyLight Widget
Source: https://docs.heylight.com/docs/messaggio-promozionale-heylight-finanziamento
Crea un nuovo file denominato 'heylight-widget' nella sezione Snippet del tema Shopify e incolla il codice per definire i parametri di finanziamento e il container del widget.
```liquid
{% assign minimum_amount = 10000 %}
{% assign maximum_amount = 500000 %}
{% assign available_terms = '3,6,9,12,18,24' | split:"," %}
{% assign min_instalment_amount = 2000 %}
{%- 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 %}
{%- endif -%}
```
--------------------------------
### Inclusione Widget nel Template Prodotto
Source: https://docs.heylight.com/docs/messaggio-promozionale-heylight-finanziamento
Aggiungi la riga di rendering dello snippet all'interno del file price.liquid per visualizzare il messaggio promozionale nella scheda prodotto.
```liquid
{% render 'heylight-widget' %}
```
--------------------------------
### Insert HeyLight promotional message in Liquid
Source: https://docs.heylight.com/reference/finanziamento-it
Configures financing terms and renders the HeyLight container within a product sheet.
```liquid
{% assign minimum_amount = 10000 %}
{% assign maximum_amount = 500000 %}
{% assign available_terms = '3,6,12,24,36' | split:"," %}
{% assign min_instalment_amount = 2000 %}
{%- 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 %}
{%- endif -%}
```
--------------------------------
### Include HeyLight SDK Script
Source: https://docs.heylight.com/reference/dilazione-it
Include the appropriate script tag in your site's footer or index to load the HeyLight promotional messaging library.
```html
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.