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.
83 lines
5.2 KiB
83 lines
5.2 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<template id="classic_store_trending" inherit_id="website.snippets" name="Trending">
|
|
<xpath expr="//div[@id='snippet_structure']/div[hasclass('o_panel_body')]"
|
|
position="inside">
|
|
<t t-snippet="theme_classic_store.s_classic_store_trending"
|
|
t-thumbnail="/theme_classic_store/static/src/images/snippets/trending-products.jpg"/>
|
|
</xpath>
|
|
</template>
|
|
|
|
<template id="s_classic_store_trending" name="Trending">
|
|
<section class="trending">
|
|
<div class="container">
|
|
<div class="top_heading text-center">
|
|
<h3 class="">Trending Products</h3>
|
|
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas, magnam.</p>
|
|
<div class="bottom_line"/>
|
|
</div>
|
|
<t t-if="trending_products">
|
|
<div class="trending_body">
|
|
<div class="row">
|
|
|
|
<div class="owl-carousel">
|
|
|
|
<t t-foreach="trending_products" t-as="tp">
|
|
<div>
|
|
<div class="card h-100">
|
|
<img t-attf-src="/web/image?model=product.template&field=image_1920&id=#{tp['id']}" class="img img-responsive img-fluid"
|
|
style="width:auto; height: 320px;"/>
|
|
<div class="card-body">
|
|
<a t-attf-href="/shop/product/#{slug(tp)}">
|
|
<h5 class="card-title"><t t-esc="tp.name"/></h5>
|
|
</a>
|
|
<ul class="list-group list-group-flush" style="display:block;">
|
|
<li class="list-group-item">
|
|
<a t-attf-href="/shop/category/#{slug(tp.public_categ_ids)}">
|
|
<span class="far fa-folder-open"></span><t t-esc="tp.public_categ_ids.name"/>
|
|
</a>
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
|
<a href="#">
|
|
<t t-esc="tp.list_price" t-options="{'widget': 'monetary', 'display_currency': website.currency_id}"/>
|
|
</a>
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
|
<t t-set="rating_avg" t-value="tp.rating_avg"/>
|
|
<t t-set="rating_avg" t-value="round(rating_avg * 100) / 100"/>
|
|
<t t-set="val_decimal" t-value="round(rating_avg % 1, 1)"/>
|
|
<t t-set="val_integer" t-value="int(rating_avg)"/>
|
|
<t t-set="empty_star" t-value="5 - (val_integer+1) if val_decimal else 5 - val_integer"/>
|
|
<div class="o_website_rating_static" t-att-style="inline_mode and 'display:inline'" t-att-title="rating_avg">
|
|
<t t-foreach="range(0, val_integer)" t-as="num">
|
|
<i class="fa fa-star" style="font-size:18px;" role="img"></i>
|
|
</t>
|
|
<t t-if="val_decimal">
|
|
<i class="fa fa-star-half-o" style="font-size:18px;" role="img"></i>
|
|
</t>
|
|
<t t-foreach="range(0, empty_star)" t-as="num">
|
|
<i class="fa fa-star text-black-25" style="font-size:18px;" role="img"></i>
|
|
</t>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
<t t-else="">
|
|
<div class="top_heading text-center">
|
|
<p>Please configure Trending Products in the Classic Store Configuration.</p>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
</section>
|
|
</template>
|
|
</odoo>
|