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.
136 lines
7.7 KiB
136 lines
7.7 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<template id="watchhut_product_view" name="WatchHut Product View"
|
|
inherit_id="website_sale.product">
|
|
<!-- The template modifies the product view page on the WatchHut website. It replaces -->
|
|
<!-- certain elements and adds new sections, including a banner, preview images, product details, -->
|
|
<!-- quantity selection, and add-to-cart functionality. It also customizes the "Shop" link on the page.-->
|
|
<xpath expr="//div[hasclass('justify-content-between')]" position="replace"/>
|
|
<xpath expr="//div[hasclass('row')]" position="before">
|
|
<section class="banner">
|
|
<div class="container">
|
|
<div class="row">
|
|
<h3 class="banner_head">
|
|
Preview
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</xpath>
|
|
<xpath expr="//div[contains(@t-attf-class, 'col-lg-#{image_cols[0]}')]"
|
|
position="replace">
|
|
<section class="preview col-lg-6 col-12">
|
|
<div class="pre_wrapper">
|
|
<div class="row">
|
|
<div class="col-12 mb-4">
|
|
<div class="preview_img">
|
|
<t t-set="product_images"
|
|
t-value="product_variant._get_images() if product_variant else product._get_images()"/>
|
|
<t t-foreach="product_images"
|
|
t-as="product_image">
|
|
<span t-if="product_image"
|
|
t-field="product_image.image_1920"
|
|
t-options="{'widget': 'image'}"/>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</xpath>
|
|
<xpath expr="//div[@id='product_details']" position="replace">
|
|
<section class="preview col-lg-6 col-12">
|
|
<div class="preview_left">
|
|
<h2 itemprop="name" t-field="product.name">Product
|
|
Name
|
|
</h2>
|
|
<span itemprop="url" style="display:none;"
|
|
t-esc="product.website_url"/>
|
|
<p class="price">
|
|
<t t-call="website_sale.product_price"/>
|
|
</p>
|
|
<p t-field="product.description_sale" class="details"
|
|
placeholder="A short description that will also appear on documents."/>
|
|
<div id="product_attributes_simple">
|
|
<hr t-if="sum([(1 if len(l.value_ids)==1 else 0) for l in product.attribute_line_ids])"/>
|
|
<p class="text-muted">
|
|
<t t-set="single_value_attributes"
|
|
t-value="product.valid_product_template_attribute_line_ids._prepare_single_value_for_display()"/>
|
|
<t t-foreach="single_value_attributes"
|
|
t-as="attribute">
|
|
<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>
|
|
<br/>
|
|
</t>
|
|
</p>
|
|
</div>
|
|
<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()"/>
|
|
<div class="js_product js_main_product">
|
|
<div class="quantity" style="display: flex; align-items: center;">
|
|
<label class="mb-0" for="">Quantity</label>
|
|
<div t-attf-class="css_quantity input-group {{'d-none' if combination_info['prevent_zero_price_sale'] else 'd-inline-flex'}} me-2 mb-2 align-middle" contenteditable="false">
|
|
<a t-attf-href="#" class="btn btn-link js_add_cart_json" aria-label="Remove one" title="Remove one">
|
|
<i class="fa fa-minus"/>
|
|
</a>
|
|
<input type="text" class="form-control quantity text-center" data-min="1" name="add_qty" t-att-value="1"/>
|
|
<a t-attf-href="#" class="btn btn-link float_left js_add_cart_json" aria-label="Add one" title="Add one">
|
|
<i class="fa fa-plus"/>
|
|
</a>
|
|
</div>
|
|
</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-set="combination" t-value="combination_info['combination']"/>
|
|
</t>
|
|
</t>
|
|
<p t-if="True"
|
|
class="css_not_available_msg alert alert-warning">
|
|
This combination does not exist.
|
|
</p>
|
|
<a role="button" id="add_to_cart"
|
|
class="btn btn-add js_check_product a-submit"
|
|
href="#">Add to Cart
|
|
</a>
|
|
<div id="product_option_block"/>
|
|
</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>
|
|
<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>
|
|
</section>
|
|
</xpath>
|
|
<xpath expr="//a[@t-att-href='keep(category=0, attribute_value=0, tags=0)']"
|
|
position="replace">
|
|
<a t-att-href="keep(category=0, attribute_value=0, tags=0)">Shop</a>
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|
|
|