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.
 
 
 
 
 

48 lines
2.8 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="popular_product_snippet" name="Popular Product Snippet">
<section class="most-populor" id="populor">
</section>
</template>
<template id="popular_snippet" name="Popular Products Snippet">
<div class="container" t-ignore="True">
<h2 class="f-product-heading">MOST POPULOR</h2>
</div>
<div class="f-product" t-ignore="True">
<div class="container">
<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">
<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:auto;"/>
<!-- <div t-field="product_tmpl_id.image_1920" t-options='{"widget": "image", "preview_image": "image_256", "class": "d-block"}'/>-->
</div>
<div class="product-detials">
<div class="product__title">
<span t-if="website_product_id" t-esc="website_product_id['display_name']"/>
</div>
<t t-if="website_product_id['rating']" t-raw="website_product_id['rating']"/>
<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>