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.
137 lines
7.3 KiB
137 lines
7.3 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<template id="watchhut_shop" name="WatchHut Shop"
|
|
inherit_id="website_sale.products">
|
|
<!-- The template modifies the shop page on the WatchHut website. It replaces -->
|
|
<!-- the products header section with a customized version that includes search functionality,-->
|
|
<!-- price list options, pagination, category navigation, grid/list view option, sorting, -->
|
|
<!-- and filter options. It enhances the user experience and provides additional features -->
|
|
<!-- for browsing and selecting products.-->
|
|
<xpath expr="//div[hasclass('products_header')]" position="replace">
|
|
<div class="products_header products_pager btn-toolbar flex-nowrap align-items-center justify-content-between mb-3">
|
|
<t t-call="website_sale.search">
|
|
<t t-set="search" t-value="original_search or search"/>
|
|
<t t-set="_form_classes"
|
|
t-valuef="d-lg-inline {{'d-inline' if not category else 'd-none'}}"/>
|
|
</t>
|
|
<t t-call="website_sale.pricelist_list" t-cache="pricelist">
|
|
<t t-set="_classes"
|
|
t-valuef="d-none d-lg-inline ms-3 btn-watchhut"/>
|
|
</t>
|
|
<t t-call="website.pager"/>
|
|
<div t-if="category"
|
|
class="d-flex align-items-center d-lg-none me-auto">
|
|
<t t-if="not category.parent_id" t-set="backUrl"
|
|
t-valuef="/shop"/>
|
|
<t t-else="" t-set="backUrl"
|
|
t-value="keep('/shop/category/' + slug(category.parent_id), category=0)"/>
|
|
<a t-attf-class="btn btn-{{navClass}} me-2"
|
|
t-att-href="category.parent_id and keep('/shop/category/' + slug(category.parent_id), category=0) or '/shop'">
|
|
<i class="fa fa-angle-left"/>
|
|
</a>
|
|
<h4 t-out="category.name" class="mb-0 me-auto"/>
|
|
</div>
|
|
<t t-if="is_view_active('website_sale.add_grid_or_list_option')"
|
|
t-call="website_sale.add_grid_or_list_option">
|
|
<t t-set="_classes" t-valuef="d-flex ms-3"/>
|
|
</t>
|
|
<t t-if="is_view_active('website_sale.sort')"
|
|
t-call="website_sale.sort">
|
|
<t t-set="_classes"
|
|
t-valuef="d-none d-lg-inline-block ms-3 btn-watchhut"/>
|
|
</t>
|
|
<button t-if="is_view_active('website_sale.sort') or opt_wsale_categories or opt_wsale_attributes or opt_wsale_attributes_top"
|
|
t-attf-class="btn btn-{{navClass}} position-relative ms-3 {{not opt_wsale_attributes_top and 'd-lg-none'}}"
|
|
data-bs-toggle="offcanvas"
|
|
data-bs-target="#o_wsale_offcanvas">
|
|
<i class="fa fa-sliders"/>
|
|
<span t-if="isFilteringByPrice or attrib_set"
|
|
t-attf-class="position-absolute top-0 start-100 translate-middle badge border border-{{navClass}} rounded-circle bg-danger p-1">
|
|
<span class="visually-hidden">filters active</span>
|
|
</span>
|
|
</button>
|
|
</div>
|
|
</xpath>
|
|
</template>
|
|
<!--Template inherited product_item and changed product image styles-->
|
|
<template id="watchhut_shop_images" name="WatchHut Shop Images"
|
|
inherit_id="website_sale.products_item">
|
|
<xpath expr="//div[hasclass('oe_product_image')]"
|
|
position="replace">
|
|
<div class="card-body p-1 oe_product_image overflow-hidden">
|
|
<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()"/>
|
|
<div class="fix_height">
|
|
<div class="img_wrapper">
|
|
<span t-field="image_holder.image_1920"
|
|
t-options="{'widget': 'image', 'preview_image': 'image_1920'}"
|
|
class="h-100 "/>
|
|
</div>
|
|
</div>
|
|
<t t-set="bg_color"
|
|
t-value="td_product['ribbon'].bg_color"/>
|
|
<t t-set="text_color"
|
|
t-value="td_product['ribbon'].text_color"/>
|
|
<t t-set="bg_class"
|
|
t-value="td_product['ribbon']._get_position_class()"/>
|
|
<span
|
|
t-attf-class="o_ribbon o_not_editable #{bg_class}"
|
|
t-attf-style="#{text_color and ('color: %s;' % text_color)} #{bg_color and 'background-color:' + bg_color}"
|
|
t-out="td_product['ribbon'].name or ''"
|
|
/>
|
|
</a>
|
|
|
|
</div>
|
|
</xpath>
|
|
</template>
|
|
<!--Template added Shop title in the website shop-->
|
|
<template id="watchhut_shop_title" name="WatchHut Shop Title"
|
|
inherit_id="theme_watchhut.watchhut_shop">
|
|
<xpath expr="//div[hasclass('o_wsale_products_main_row')]" position="before">
|
|
<section class="shop">
|
|
<section class="banner">
|
|
<div class="container">
|
|
<div class="row">
|
|
<h3 class="banner_head">
|
|
Shop
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
</xpath>
|
|
</template>
|
|
<!--Template inherited website sort and added changes to website shop pricelist dropdown-->
|
|
<template id="watchhut_pricelist_button"
|
|
name="Watchhut Pricelist Button"
|
|
inherit_id="website_sale.sort">
|
|
<xpath expr="//div[contains(@t-attf-class, 'o_sortby_dropdown')]"
|
|
position="replace">
|
|
<div t-attf-class="o_sortby_dropdown dropdown dropdown_sorty_by ms-lg-3 {{_classes}}">
|
|
<a role="button" href="#"
|
|
t-attf-class="dropdown-toggle btn btn-{{navClass}}"
|
|
data-bs-toggle="dropdown">
|
|
<span class="d-none d-lg-inline">
|
|
<t t-if="isSortingBy" t-out="isSortingBy[0][1]"/>
|
|
<span t-else="1"
|
|
t-field="website.shop_default_sort"/>
|
|
</span>
|
|
<i class="fa fa-sort-amount-asc d-lg-none"/>
|
|
</a>
|
|
<div class="dropdown-menu dropdown-menu-end" role="menu">
|
|
<t t-foreach="website_sale_sortable" t-as="sortby">
|
|
<a role="menuitem" rel="noindex,nofollow"
|
|
t-att-href="keep('/shop', order=sortby[0])"
|
|
class="dropdown-item">
|
|
<span t-out="sortby[1]"/>
|
|
</a>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|
|
|