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.
 
 
 
 
 

251 lines
14 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="watchhut_shop" name="WatchHut Shop"
inherit_id="website_sale.products">
<!-- It replaces the products header section with a custom header that -->
<!-- includes search, price list, pagination, sorting, and filter options.-->
<xpath expr="//div[@id='products_grid']" position="replace">
<div id="products_grid">
<section
t-attf-class="product col #{'o_wsale_layout_list' if layout_mode == 'list' else ''}">
<div class="container-fluid">
<div class="row list_row">
<t t-foreach="bins" t-as="tr_product">
<t t-foreach="tr_product" t-as="td_product">
<t t-if="td_product">
<t t-set="product"
t-value="td_product['product']"/>
<div class="col-12 col-sm-6 col-md-4 column all list_column">
<div class="content">
<div t-att-data-ribbon-id="td_product['ribbon'].id">
<div class="test"
id="hh">
<t t-call="website_sale.products_item">
</t>
</div>
</div>
</div>
</div>
</t>
</t>
</t>
</div>
</div>
</section>
</div>
</xpath>
<!-- WatchHut Product Pager-->
<!-- The above template adds a product search bar and a price list dropdown -->
<!-- to the product page, along with the standard pager. It also adds -->
<!-- some classes to these elements for styling purposes.-->
<xpath expr="//div[@id='products_grid']" position="before">
<div class="products_header products_pager form-inline flex-md-nowrap justify-content-end mb-4">
<t t-call="website_sale.search">
<t t-set="_classes"
t-valuef="w-100 w-md-auto mr-auto mb-2"/>
<t t-set="search" t-value="original_search or search"/>
</t>
<t t-call="website_sale.pricelist_list">
<t t-set="_classes" t-valuef="ml-3 mb-2 btn-watchhut"/>
</t>
<t t-call="website.pager"/>
</div>
</xpath>
</template>
<template id="watchhut_shop_images" name="WatchHut Shop Images"
inherit_id="website_sale.products_item">
<!-- The "watchhut_shop_images" template replaces the product image section -->
<!-- with a new card body element, containing a link to the product and a -->
<!-- hidden input field for the CSRF token. It also uses a new "image_holder" -->
<!-- variable to display the product image using a widget, centered within the card body.-->
<xpath expr="//div[hasclass('oe_product_image')]"
position="replace">
<div class="card-body p-1 oe_product_image">
<input type="hidden" name="csrf_token"
t-att-value="request.csrf_token()"/>
<a t-att-href="product_href" class="d-block h-100"
itemprop="url">
<t t-set="image_holder"
t-value="product._get_image_holder()"/>
<span t-field="image_holder.image_1920"
t-options="{'widget': 'image', 'preview_image': 'image_1920'}"
class="d-flex h-100 justify-content-center align-items-center"/>
</a>
</div>
</xpath>
</template>
<template id="watchhut_add_grid_or_list_option"
inherit_id="website_sale.products"
active="True" customize_show="True"
name="Watchhut Grid or List button">
<!-- This is a template that adds a grid or list option to a product page in the Watchhut theme. It inserts two buttons with icons -->
<!-- that allow the user to switch between a grid and a list layout for displaying the products.-->
<xpath expr="//div[hasclass('products_header')]"
position="after">
<div class="btn-group btn-group-toggle ml-3 mb-2 d-none d-sm-inline-flex o_wsale_apply_layout btn-secondary"
data-toggle="buttons">
<label t-attf-class="btn btn-light border-0 #{'active' if layout_mode != 'list' else None} fa fa-th-large o_wsale_apply_grid"
title="Grid">
<input type="radio" name="wsale_products_layout"
t-att-checked="'checked' if layout_mode != 'list' else None"/>
</label>
<label t-attf-class="btn btn-light border-0 #{'active' if layout_mode == 'list' else None} fa fa-th-list o_wsale_apply_list"
title="List">
<input type="radio" name="wsale_products_layout"
t-att-checked="'checked' if layout_mode == 'list' else None"/>
</label>
</div>
</xpath>
</template>
<template id="watchhut_product_view" name="WatchHut Product View"
inherit_id="website_sale.product">
<!-- The "watchhut_product_view" template is a customized version of the default product view -->
<!-- template for the Watch Hut website, featuring modifications to sections and elements to -->
<!-- enhance the display of product information, images, and functionality.-->
<xpath expr="//div[hasclass('justify-content-between')]"
position="replace"/>
<xpath expr="//div[hasclass('row')]" position="before">
<!-- Add a banner head -->
<section class="banner">
<div class="container">
<div class="row">
<h3 class="banner_head">
Preview
</h3>
</div>
</div>
</section>
</xpath>
<xpath expr="//div[hasclass('mt-md-4')]" position="replace">
<!-- Set product images -->
<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">
<!-- Call product_price template from website_sale-->
<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">
<label for="">Quantity</label>
<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"/>
<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-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"/>
<t t-if="combination"
t-call="sale.variants">
<t t-set="ul_class"
t-value="'flex-column'"/>
<t t-set="parent_combination"
t-value="None"/>
</t>
<t t-else="">
<ul class="d-none js_add_cart_variants"
t-att-data-attribute_exclusions="{'exclusions: []'}"/>
</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)']"
position="replace">
<a t-att-href="keep(category=0)">Shop</a>
</xpath>
</template>
</odoo>