EN IT
Open2b version 7.8

Products

Below are documented:

In addition to these, on the product.html and share.html pages you can also use the variables common to all pages.

product.html

Page with the details of a product.

var (

    // Accessory products.
    accessories []Product

    // Number of columns used to display accessory products.
    accessoriesColumns int

    // All breadcrumbs, one for each main product department, from
    // the main one to the deepest.
    allBreadcrumbs [][]Breadcrumb

    // Product attributes.
    attributes []Attribute

    // Departments from the main one to the deepest where the product is located.
    breadcrumbs []Breadcrumb

    // Button to add the product to the cart.
    buttonAddToCart html

    // Button to add the product to the wish list.
    buttonAddToWhishList html

    // Product code.
    code string

    // Product department.
    department LinkedText

    // Discount compared to the list price.
    discount Discount

    // EAN-13 code of the primary SKU.
    ean string

    // Downloadable attachments.
    files []ProductFile

    // Product identifier.
    id int

    // Wide image.
    image ProductImage

    // Indicates whether it is available and can be ordered.
    isAvailable bool

    // ISBN-13 code of the primary SKU.
    isbn string

    // Indicates whether the price is discounted.
    isDiscounted bool

    // Indicates whether it is for sale.
    isForSale bool

    // Indicates whether stock quantity is greater than zero. If the product
    // has multiple SKUs, it is always false.
    isInStock bool

    // Indicates whether it is new.
    isNewRelease bool

    // Indicates whether it is available for pre-order.
    isPreOrder bool

    // Product SKUs.
    items []Item

    // List price.
    listPrice Price

    // Long description.
    longDescription html

    // The <meta property="og:image"> tag that tells sites like Facebook
    // which image to use for sharing.
    // Insert between <head> and </head>.
    metaOGImage html

    // Message informing the customer that they can request a quote for
    // the product with a minimum quantity.
    minQuoteMessage html

    // Additional description.
    moreDescription html

    // Product name.
    name string

    // Tax percentage.
    percentTax Decimal

    // Message informing the customer that the product is available for pre-order.
    preOrderMessage string

    // Sale price.
    price Price

    // Producer.
    producer Producer

    // Message informing the customer that the product is on promotion.
    promotionMessage html

    // Time information about the promotion validity.
    promotionValidity PromotionValidity

    // Field to specify the quantity to add to the cart.
    quantity html

    // Review rating from 0.0 to 5.0.
    reviewRating Decimal

    // Reviews.
    reviews []Review

    // Total number of reviews.
    reviewsCount int

    // Estimated shipping date. Usable only if the product has no variants
    // and has a single SKU. If the product is in stock, the date is the
    // next day; otherwise days equal to supplier restocking days are added.
    shippingDate string

    // Short description.
    shortDescription html

    // Similar products.
    similar []Product

    // Number of columns used to display similar products.
    similarColumns int

    // Social sharing.
    socialSharing html

    // Informs the customer of any errors when adding the product to the cart.
    statusMessage html

    // Product image thumbnails.
    thumbnails Thumbnails

    // UPC code of the primary SKU.
    upc string

    // Product URL in the current language.
    url string

    // Variants.
    variants []Variant

)

search.html

Allows performing an advanced product search and viewing the results.


var (

    // Search path. Includes the filters applied in the search.
    breadcrumbs []Breadcrumb

    // Number of columns used to display products.
    columns int

    // Page content.
    content html

    // Total number of products that match the search criteria.
    count int

    // Department to search in. Displayed as a <select> element.
    department html

    // Indicates whether the search was performed.
    hasBeenExecuted bool

    // Keywords to search for. Displayed as an <input> element.
    keywords html

    // Page image.
    image AlignedImage

    // Producer to search in. Displayed as a <select> element.
    producer html

    // Pagination, lets you move to the next products.
    pagination Pagination

    // Products resulting from the search.
    products []Product

    // Menu to choose product sorting. Displayed as a
    // <select> element.
    sortBy html

)

new-releases.html

Displays all new products.


var (

    // Number of columns used to display products.
    columns int
    
    // Page content.
    content html
    
    // Total number of new products.
    count int

    // Page image.
    image AlignedImage
    
    // Pagination, lets you move to the next products.
    pagination Pagination
    
    // New products.
    products []Product
    
    // Menu to choose product sorting. Displayed as a
    // <select> element.
    sortBy html

)

collection.html

Page for an additional collection with the products it includes.


var (

    // Number of columns used to display products.
    columns int

    // Total number of products.
    count int

    // Description.
    description html

    // Collection identifier.
    id int

    // Wide image.
    largeImage Image

    // Pagination, lets you move to the next products.
    pagination Pagination

    // Products.
    products []Product

    // Small image.
    smallImage Image

    // Summary.
    summary html

    // Menu to choose product sorting. Displayed as a
    // <select> element.
    sortBy html

)

share.html

Allows sharing a product or promotion via email.

var (

    // Button to send the email.
    buttonSend html

    // Page content.
    content html
    
    // Message to write in the email. It can only be written by customers
    // who are logged in.
    message html
    
    // Page image.
    image AlignedImage
    
    // Email recipients.
    recipients html

    // Sender email address.
    senderEmail html
    
    // Sender name.
    senderName html
    
    // Product or promotion image.
    shareImage Image
    
    // Product or promotion name.
    shareName string
    
    // Message indicating the outcome of sending the email or any errors.
    statusMessage html

)

products variable

The products variable (of type []Product) is used on the index.html, department.html, producer.html, search.html, new-releases.html, wish-list.html and product.html pages to display products.

{% for product in products %} ... {% end for %}

The products shown depend on the page where the variable is used. For example, in department.html it shows department products, while in wish-list.html it shows the customer's wish list products.