Catalogo
{% comment %}
Sezione: custom-catalog.liquid
Catalogo prodotti personalizzato per Svendovendo
{% endcomment %}
{% schema %}
{
"name": "Catalogo Personalizzato",
"settings": [
{
"type": "text",
"id": "page_title",
"label": "Titolo Pagina",
"default": "Catalogo Prodotti"
},
{
"type": "textarea",
"id": "page_subtitle",
"label": "Sottotitolo Pagina",
"default": "Scopri tutti i nostri elettrodomestici premium a prezzi imbattibili"
},
{
"type": "range",
"id": "products_per_page",
"label": "Prodotti per Pagina",
"min": 12,
"max": 48,
"step": 6,
"default": 24
},
{
"type": "checkbox",
"id": "enable_sorting",
"label": "Abilita Ordinamento",
"default": true
},
{
"type": "checkbox",
"id": "show_vendor",
"label": "Mostra Brand Prodotto",
"default": false
}
],
"presets": [
{
"name": "Catalogo Personalizzato"
}
]
}
{% endschema %}
🛍️ {{ section.settings.page_title | default: 'Catalogo Prodotti' }}
{{ section.settings.page_subtitle | default: 'Scopri tutti i nostri elettrodomestici premium a prezzi imbattibili' }}
{% assign all_products = collections.all.products %}
{% assign products_count = all_products.size %}
{% if all_products.size > 0 %}
{% endif %}
Mostrando {{ products_count }} prodotti
{% for product in all_products limit: section.settings.products_per_page %}
{% endfor %}
{% if all_products.size > section.settings.products_per_page %}
{% if product.featured_image %}
{% else %}
📦 Immagine non disponibile
{% endif %}
{% if product.available == false %}
Esaurito
{% elsif product.compare_at_price > product.price %}
{% assign discount_percentage = product.compare_at_price | minus: product.price | times: 100 | divided_by: product.compare_at_price %}
-{{ discount_percentage }}%
{% elsif product.tags contains 'nuovo' %}
Nuovo
{% elsif product.tags contains 'bestseller' %}
🔥 Bestseller
{% endif %}
{{ product.title }}
{{ product.price | money }}
{% if product.compare_at_price > product.price %}
{{ product.compare_at_price | money }}
{% endif %}
{% if product.available %}
{% if product.variants.size == 1 %}
{% else %}
👀 Vedi Dettagli
{% endif %}
{% else %}
{% endif %}
{% comment %}
Implementazione paginazione base - da migliorare con AJAX se necessario
{% endcomment %}
1
{% assign total_pages = all_products.size | divided_by: section.settings.products_per_page | plus: 1 %}
{% for i in (2..total_pages) %}
{{ i }}
{% endfor %}
{% endif %}
{% else %}
😔 Nessun prodotto disponibile
Al momento non ci sono prodotti nel catalogo. Torna a trovarci presto!
🏠 Torna alla Homepage