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.
 
 
 
 
 

70 lines
4.2 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="popular_product_snippet" name="Popular Product Snippet">
<section class="most-popular o_not_editable" id="popular">
<div class="alert alert-info">
<h4>Snippet will be displayed here... Please Save to view the snippet..!</h4>
</div>
</section>
</template>
<template id="popular_snippet" name="Popular Products Snippet">
<div class="container o_not_editable" t-ignore="True">
<h2 class="f-product-heading">MOST POPULAR</h2>
<div class="f-product" t-ignore="True">
<div class="row">
<t t-foreach="website_product_ids" t-as="website_product_id">
<t t-set="product_tmpl_id"
t-value="request.env['product.template'].search([('id','=',website_product_id['product_template_id'])])"/>
<div class="col-12 col-sm-6 col-lg-3 col-md-3">
<a t-attf-href="/shop/product/#{ slug(product_tmpl_id) }">
<div class="product">
<t t-if="website_product_id['rating']">
<span t-if="website_product_id['ratings'] &gt;= 3.40"
class="rating_ribbon rating_ribbon-green">
<span>
<t t-esc="website_product_id['ratings']"/>
</span>
</span>
<span t-if="website_product_id['ratings'] &lt;= 1.70"
class="rating_ribbon rating_ribbon-red">
<span>
<t t-esc="website_product_id['ratings']"/>
</span>
</span>
<span t-if="website_product_id['ratings'] &gt;= 1.69 and website_product_id['ratings'] &lt;= 3.39"
class="rating_ribbon rating_ribbon-yellow">
<span>
<t t-esc="website_product_id['ratings']"/>
</span>
</span>
</t>
<div class="product__image">
<img t-attf-src="/web/image?model=product.template&amp;field=image_1920&amp;id=#{website_product_id['id']}"
class="img img-fluid" style="width:auto; height:inherit;"/>
</div>
<div class="product-details">
<div class="product__title">
<span t-if="website_product_id" t-esc="website_product_id['display_name']"/>
</div>
<div class="product__price">
<span t-if="website_product_id"
t-esc="website_product_id['list_price']"
t-options="{'widget': 'monetary', 'display_currency': website.currency_id}"/>
</div>
</div>
</div>
</a>
</div>
</t>
</div>
</div>
</div>
</template>
<template id="most_popular" inherit_id="website.snippets" name="Popular Snippet">
<xpath expr="//div[@id='snippet_structure']/div[hasclass('o_panel_body')]" position="inside">
<t t-snippet="theme_silon.popular_product_snippet"
t-thumbnail="/theme_silon/static/src/img/snippets/most_popular_block.jpg"/>
</xpath>
</template>
</odoo>