You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
297 lines
17 KiB
297 lines
17 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<template id="voltro_product_view" name="Voltro Product View"
|
|
inherit_id="website_sale.product">
|
|
<xpath expr="//div[@id='product_detail_main']" position="replace">
|
|
<div class="row" id="product_detail_main"
|
|
data-name="Product Page"
|
|
t-att-data-image_width="website.product_page_image_width"
|
|
t-att-data-image_layout="website.product_page_image_layout">
|
|
<t t-set="image_cols"
|
|
t-value="website._get_product_page_proportions()"/>
|
|
<div t-attf-class="col-lg-#{image_cols[0]} mt-lg-4 o_wsale_product_images position-relative"
|
|
t-if="website.product_page_image_width != 'none'">
|
|
<t t-call="website_sale.shop_product_images"/>
|
|
</div>
|
|
<div t-attf-class="col-lg-#{image_cols[1]} mt-md-4"
|
|
id="product_details">
|
|
<t t-set="base_url"
|
|
t-value="product.get_base_url()"/>
|
|
<div class="name_wrapper">
|
|
<div class="name">
|
|
<h1 itemprop="name" t-field="product.name">Product
|
|
Name
|
|
</h1>
|
|
<span itemprop="url" style="display:none;"
|
|
t-esc="base_url + product.website_url"/>
|
|
<span itemprop="image" style="display:none;"
|
|
t-esc="base_url + website.image_url(product, 'image_1920')"/>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<t t-call="website_sale.product_price"/>
|
|
<small t-if="combination_info['base_unit_price']"
|
|
class="ms-1 text-muted o_base_unit_price_wrapper d-none"
|
|
groups="website_sale.group_show_uom_price">
|
|
<t t-call='website_sale.base_unit_price'/>
|
|
</small>
|
|
</div>
|
|
|
|
<t t-if="is_view_active('website_sale.product_comment')">
|
|
<a href="#o_product_page_reviews"
|
|
class="o_product_page_reviews_link text-decoration-none">
|
|
<t t-call="portal_rating.rating_widget_stars_static">
|
|
<t t-set="rating_avg"
|
|
t-value="product.rating_avg"/>
|
|
<t t-set="trans_text_plural">%s
|
|
reviews
|
|
</t>
|
|
<t t-set="trans_text_singular">%s
|
|
review
|
|
</t>
|
|
<t t-set="rating_count"
|
|
t-value="(trans_text_plural if product.rating_count > 1 else trans_text_singular) % product.rating_count"/>
|
|
</t>
|
|
</a>
|
|
</t>
|
|
<t t-if="product.description_sale">
|
|
<p t-field="product.description_sale"
|
|
class="text-muted my-2"
|
|
placeholder="A short description that will also appear on documents."/>
|
|
</t>
|
|
<div t-field="product.description_ecommerce"
|
|
class="oe_structure"
|
|
placeholder="A detailed, formatted description to promote your product on this page. Use '/' to discover more features."/>
|
|
<form t-if="product._is_add_to_cart_possible()"
|
|
action="/shop/cart/update" method="POST">
|
|
<input type="hidden" name="csrf_token"
|
|
t-att-value="request.csrf_token()"
|
|
t-nocache="The csrf token must always be up to date."/>
|
|
<div class="js_product js_main_product mb-3">
|
|
<div class="d-none">
|
|
<t t-call="website_sale.product_price"/>
|
|
<small t-if="combination_info['base_unit_price']"
|
|
class="ms-1 text-muted o_base_unit_price_wrapper d-none"
|
|
groups="website_sale.group_show_uom_price">
|
|
<t t-call='website_sale.base_unit_price'/>
|
|
</small>
|
|
</div>
|
|
<t t-placeholder="select">
|
|
<input type="hidden"
|
|
class="product_id"
|
|
name="product_id"
|
|
t-att-value="product_variant.id"/>
|
|
<input type="hidden"
|
|
class="product_template_id"
|
|
name="product_template_id"
|
|
t-att-value="product.id"/>
|
|
<input t-if="product.public_categ_ids.ids"
|
|
type="hidden"
|
|
class="product_category_id"
|
|
name="product_category_id"
|
|
t-att-value="product.public_categ_ids.ids[0]"/>
|
|
<t t-call="website_sale.variants">
|
|
<t t-set="ul_class"
|
|
t-valuef="flex-column"/>
|
|
<t t-set="parent_combination"
|
|
t-value="None"/>
|
|
</t>
|
|
</t>
|
|
<p t-if="True"
|
|
class="css_not_available_msg alert alert-warning">
|
|
This combination does not exist.
|
|
</p>
|
|
<div id="o_wsale_cta_wrapper"
|
|
class="flex-wrap align-items-center">
|
|
<t t-set="hasQuantities"
|
|
t-value="false"/>
|
|
<t t-set="hasBuyNow"
|
|
t-value="false"/>
|
|
<t t-set="ctaSizeBig"
|
|
t-value="not hasQuantities or not hasBuyNow"/>
|
|
<div id="add_to_cart_wrap"
|
|
style="width: 100%;gap: 1rem;"
|
|
t-attf-class="{{'d-none' if combination_info['prevent_zero_price_sale'] else 'd-inline-flex'}} align-items-center mb-2 me-auto">
|
|
<a role="button"
|
|
id="add_to_cart"
|
|
t-attf-class="btn btn-primary js_check_product a-submit flex-grow-1 #{'btn-lg' if ctaSizeBig else ''}"
|
|
href="#">
|
|
<i class="fa fa-shopping-cart me-2"/>
|
|
<span style="font-weight: bold">
|
|
Add To Cart
|
|
</span>
|
|
</a>
|
|
|
|
<div class="css_quantity input-group"
|
|
contenteditable="false">
|
|
<div class="input-group-prepend">
|
|
<a t-attf-href="#"
|
|
class="btn btn-minus js_add_cart_json"
|
|
aria-label="Remove one"
|
|
title="Remove one">
|
|
<i class="fa fa-minus"/>
|
|
</a>
|
|
</div>
|
|
<input type="text"
|
|
class="form-control input-number"
|
|
data-min="1"
|
|
name="add_qty"
|
|
t-att-value="add_qty or 1"
|
|
style="border: 0px;"/>
|
|
<div class="input-group-append">
|
|
<a t-attf-href="#"
|
|
class="btn btn-minus float_left js_add_cart_json"
|
|
aria-label="Add one"
|
|
title="Add one">
|
|
<i class="fa fa-plus"/>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<t t-if="product.product_highlights">
|
|
<div class="label">Highlights</div>
|
|
<p t-field="product.product_highlights"
|
|
class="text-muted my-2"
|
|
placeholder="A short description that will also appear on documents."/>
|
|
</t>
|
|
<div id="product_option_block"
|
|
class="d-flex flex-wrap w-100"/>
|
|
</div>
|
|
<div id="contact_us_wrapper"
|
|
t-attf-class="{{'d-flex' if combination_info['prevent_zero_price_sale'] else 'd-none'}} oe_structure oe_structure_solo #{_div_classes}">
|
|
<section class="s_text_block"
|
|
data-snippet="s_text_block"
|
|
data-name="Text">
|
|
<div class="container">
|
|
<a t-att-href="website.contact_us_button_url"
|
|
class="btn btn-primary btn_cta">
|
|
Contact Us
|
|
</a>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<t t-if="is_view_active('website_sale.product_tags')"
|
|
t-call="website_sale.product_tags">
|
|
<t t-set="all_product_tags"
|
|
t-value="product_variant.all_product_tag_ids"/>
|
|
</t>
|
|
</div>
|
|
</form>
|
|
<p t-elif="not product.active"
|
|
class="alert alert-warning">This product is
|
|
no longer available.
|
|
</p>
|
|
<p t-else="" class="alert alert-warning">This
|
|
product has no valid combination.
|
|
</p>
|
|
<div id="product_attributes_simple">
|
|
<t t-set="single_value_attributes"
|
|
t-value="product.valid_product_template_attribute_line_ids._prepare_single_value_for_display()"/>
|
|
<table t-attf-class="table table-sm text-muted {{'' if single_value_attributes else 'd-none'}}">
|
|
<t t-foreach="single_value_attributes"
|
|
t-as="attribute">
|
|
<tr>
|
|
<td>
|
|
<span t-field="attribute.name"/>
|
|
:
|
|
<t t-foreach="single_value_attributes[attribute]"
|
|
t-as="ptal">
|
|
<span t-field="ptal.product_template_value_ids._only_active().name"/>
|
|
<t t-if="not ptal_last">
|
|
,
|
|
</t>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
</t>
|
|
</table>
|
|
</div>
|
|
<t t-set="product_documents"
|
|
t-value="product.sudo().product_document_ids.filtered(lambda doc: doc.shown_on_product_page)"/>
|
|
<div id="product_documents" class="my-2"
|
|
t-if="product_documents">
|
|
<h5>Documents</h5>
|
|
<t t-foreach="product_documents"
|
|
t-as="document_sudo">
|
|
<t t-set="attachment_sudo"
|
|
t-value="document_sudo.ir_attachment_id"/>
|
|
<t t-set="target"
|
|
t-value="attachment_sudo.type == 'url' and '_blank' or '_self'"/>
|
|
<t t-set="icon"
|
|
t-value="attachment_sudo.type == 'url' and 'fa-link' or 'fa-download'"/>
|
|
<div>
|
|
<a t-att-href="'/shop/' + slug(product) + '/document/' + str(document_sudo.id)"
|
|
t-att-target="target">
|
|
<i t-att-class="'fa ' + icon"/>
|
|
<t t-out="attachment_sudo.name"/>
|
|
</a>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
<div id="o_product_terms_and_share"
|
|
class="d-flex justify-content-between flex-column flex-md-row align-items-md-end mb-3">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</xpath>
|
|
</template>
|
|
|
|
|
|
<!-- Main carousel template inheritance -->
|
|
<template id="voltro_product_carousel"
|
|
inherit_id="website_sale.shop_product_carousel"
|
|
name="Voltro Product Carousel">
|
|
|
|
<!-- Replace the carousel-inner conditionally -->
|
|
<xpath expr="//div[hasclass('carousel-inner')]" position="replace">
|
|
<!-- Check if there's only one image -->
|
|
<t t-if="len(product_images) == 1">
|
|
<!-- Keep original single image layout -->
|
|
<div class="carousel-inner h-100">
|
|
<t t-set="image_classes"
|
|
t-value="'d-flex align-items-center justify-content-center h-100'"/>
|
|
<t t-foreach="product_images" t-as="product_image">
|
|
<div t-attf-class="carousel-item h-100 text-center#{' active' if product_image_first else ''}">
|
|
<t t-call="website_sale.shop_product_image"/>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
</t>
|
|
<!-- Use new grid layout for multiple images -->
|
|
<t t-else="">
|
|
<t t-set="image_classes"
|
|
t-value="'d-flex align-items-center justify-content-center h-100'"/>
|
|
<div class="carousel-inner h-100">
|
|
<!-- Group images in sets of 4 -->
|
|
<t t-foreach="range(0, len(product_images), 4)"
|
|
t-as="group_index">
|
|
<div t-attf-class="carousel-item h-100 text-center#{' active' if group_index == 0 else ''}">
|
|
<div class="container voltro_product_images">
|
|
<div class="row row-cols-2 g-2">
|
|
<t t-foreach="product_images[group_index:min(group_index + 4, len(product_images))]"
|
|
t-as="product_image">
|
|
<div class="col">
|
|
<div t-field="product_image.image_1920"
|
|
t-att-class="image_classes + ' oe_unmovable'"
|
|
t-options='{"widget": "image", "preview_image": "image_1024", "class": "oe_unmovable product_detail_img", "alt-field": "name", "zoom": "image_1920"}'/>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
<a class="carousel-control-prev" href="#o-carousel-product"
|
|
role="button" data-bs-slide="prev" title="Previous">
|
|
<span class="fa fa-chevron-left fa-2x text-black oe_unmovable"
|
|
role="img" aria-label="Previous"/>
|
|
</a>
|
|
<a class="carousel-control-next" href="#o-carousel-product"
|
|
role="button" data-bs-slide="next" title="Next">
|
|
<span class="fa fa-chevron-right fa-2x text-black oe_unmovable"
|
|
role="img" aria-label="Next"/>
|
|
</a>
|
|
</t>
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|