Il template product.html rappresenta la pagina dettaglio di un prodotto. Consulta le funzioni disponibli per il prodotto.
Titolo, sku e brand
{{ product.title }}
{{product.code}} {% if product.brandUID != '' %} {% set brand = getBrand(product.brandUID) %} {{ brand.name }} {% endif %}
Quantità minima e scaglionamento
Requisito fondamentale è il controllo su due parametri del prodotto, cioè la quantità minima acquistabile e i successivi step di scaglionamento.
Questi dati sono necessari per verificare se il prodotto e disponibile oppure no.
{% set minQuantity = product.data.minQuantity %}
{% if minQuantity < 1 %}
{% set minQuantity = 1 %}
{% endif %}
{% set step = product.data.step %}
{% if step < 1 %}
{% set step = 1 %}
{% endif %}
Visualizzare il prezzo
Prezzo: € {{ product.final_price | nfx }}
{% if product.sale > 0 %}
Prezzo scontato: € {{ product.price | nfx }}
{% endif %}
Sconto
{% if product.sale > 0 %}
{{ product.sale | round }} %
{% endif %}
Spedizioni gratuite
{% if product.shipping_cost < 0 %}
Spedizioni gratuite
{% endif %}
Varianti
Se il prodotto contiene varianti, in automatico compariranno nella pagina prodotto permettendo agli utenti di verificare la disponibilità di ciascuna.
Ogni variante, una volta selezionata, mostrerà l'immagine al posto dell'immagine principale. Viene mostrata la prima variante disponibile.
{% if product.usevariants == 1 %}
{% set varTrad = product.varsTranslations %}
{% for key,value in product.vars %}
{% set options = value.options %}
{{value.title}}
{% for option in options %}
{{option.title}}
{% endfor %}
{% endfor %}
{% endif %}
Aggiunta al carrello
{{lang('product.add.to.cart')}}{{product.data.minQuantity}}
Immagine principale
Immagini correlate
Ogni prodotto con immagini correlate, avrà una zona nella pagina prodotto con la visualizzazione delle immagini correlate.
{% set countRelatedImages = product.related | length %}
{% if countRelatedImages > 1 %}
{% for img in product.related %}
{% endfor %}
{% endif %}
Descrizioni
Il prodotto può disporre della descrizione semplice oppure avere anche una serie di tab.
{% if product.description != '' %}
{{ product.description | raw }}
{% set tabs = getItemTabDescription(product.uid) %}
{% set countTabs = tabs | length %}
{% if countTabs > 0 %}
{% for i,tab in tabs%}
{{tab.title}}
{{ tab.description | raw }}
{% endfor %}
{% endif %}
Proprietà (Filtri)
{% set countParam = product.parameters | length %}
{% if countParam > 0 %}
{% for param in product.parameters %}
{{ param.entry_key |replace({'-': " "}) }}
{{ param.entry_value }}
{% endfor %}
{% endif %}
Tags
{% set countTags = product.tags | length %}
{% if ( countTags > 0 ) and ( product.tags.0 != '' ) %}
{% for tag in product.tags %}
{{tag}}
{% endfor %}
{% endif %}
Prodotti correlati
Nella pagina prodotto possono essere visualizzati i prodotti correlati:
{% set more_items = getRelatedItems(product.uid) %}
{% for uid in more_items %}
{% set item = getCompleteItem(uid) %}
{% if item.uid > 0 %}
{% include 'product_preview.html' %}
{% endif %}
{% endfor %}
Wishlist
La funzionalità wishlist è disponibile solo per utenti che hanno effettuato l'accesso al sito:
{% if user.uid > 0%}
{% set hasWish = hasWish(product.uid) %}
{% if hasWish %}
{% set wishClass = 'fa-heart' %}
{% else %}
{% set wishClass = 'fa-heart-o' %}
{% endif %}
wishlist
{% endif %}
Sharing tool
Fa riferimento ad una modal che viene creata via javascript tramite la funzione
{% set url = 'https://'~group.friendlyURL~'/product/'~product.uid %}
Commenti