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.
 
 
 
 
 

109 lines
7.8 KiB

<odoo>
<template id="product_extended_view" inherit_id="website_sale.products">
<xpath expr="//t[@t-call='website.layout']" position="inside">
<t t-foreach="products" t-as="product">
<div class="modal fade product_view" t-att-id="'product_view'+str(product.id)">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<a href="#" data-dismiss="modal" class="class pull-right"><span class="fa fa-close"></span></a>
<h3 class="modal-title"><span t-field="product.name"/></h3>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6 product_img">
<img class="img img-responsive" t-attf-src="/website/image/product.template/{{product.id}}/image/200x200" t-att-alt="product.name"/>
</div>
<div class="col-md-6 product_content">
<div class="col-sm-12 col-lg-12" id="product_details">
<h4>Product Id: <span t-esc="product.default_code"></span></h4><br/>
<div class="rating hidden-sm rating_ext">
<t t-set="rating" t-value="0"/>
<t t-set="count" t-value="0"/>
<t t-foreach="request.env['rating.rating'].sudo().search([('res_id', '=', product.id)])" t-as="r">
<t t-set="rating" t-value="rating + r.rating"/>
<t t-set="count" t-value="count + 1"/>
</t>
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating/count > 0 else 'fa fa-star'"/>
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating/count > 1 else 'fa fa-star'"/>
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating/count > 2 else 'fa fa-star'"/>
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating/count > 3 else 'fa fa-star'"/>
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating/count > 4 else 'fa fa-star'"/>
</div>
<h3 itemprop="name" t-field="product.name">Product Name</h3>
<span itemprop="url" style="display:none;" t-esc="'/shop/product/%s' % slug(product)" />
<t t-call="website_sale.product_price" />
<p t-if="len(product.product_variant_ids) &gt; 1" class="css_not_available_msg bg-danger" style="padding: 15px;">Product not available</p>
<a id="add_to_cart" class="btn btn-primary btn-lg mt8 js_check_product a-submit" t-att-href="'/shop/product/%s' % (slug(product))">Add to Cart</a>
<hr></hr>
<div t-if="product.inventory_availability == 'never'" class="alert alert-success">
<span class="fa fa-check" />
<span>In Stock</span>
</div>
<div t-if="product.inventory_availability == 'custom'" class="alert alert-warning">
<span t-field="product.custom_message" />
</div>
<hr t-if="product.description_sale" />
<div>
<p t-field="product.description_sale" class="text-muted" />
</div>
<hr />
<p class="text-muted">
30-day money-back guarantee<br />
Free Shipping in U.S.<br />
Buy now, get in 2 days
</p>
</div>
</div>
</div>
<div class="container mt32" t-if="product.alternative_product_ids">
<h3>Alternative Products:</h3>
<div class="row mt16" style="">
<t t-foreach="product.alternative_product_ids" t-as="alt_product">
<div class="col-md-2 thumbnail" style="width: 170px; height:130px; float:left; display:inline; margin-right: 10px; overflow:hidden;">
<div class="mt16 text-center" style="height: 100%;">
<div t-field="alt_product.image_small" t-options="{'widget': 'image', 'class': 'img-rounded shadow o_alternative_product' }" />
<h5>
<a t-attf-href="/shop/product/#{ slug(alt_product) }" style="display: block">
<span t-att-title="alt_product.name" t-field="alt_product.name" style="display: block;" />
</a>
</h5>
</div>
</div>
</t>
</div>
</div>
<t t-set="head">
<!-- Facebook and linkedin sharing data -->
<meta property="og:type" content="website" />
<meta property="og:url" t-att-content="request.httprequest.url" />
<meta property="og:image" t-attf-content="#{request.httprequest.url_root}web/image/product.template/#{product.id}/image" />
<meta property="og:description" t-att-content="product.description_sale" />
<!-- Twitter sharing data -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" t-attf-content="@#{res_company.name}" />
<meta name="twitter:title" t-att-content="product.name" />
<meta name="twitter:description" t-att-content="product.description_sale" />
<meta name="twitter:image" t-attf-content="#{request.httprequest.url_root}web/image/product.template/#{product.id}/image" />
</t>
</div>
</div>
</div>
</div>
</t>
</xpath>
</template>
<template id="products_item_extended" inherit_id="website_sale.products_item">
<xpath expr="//div[@class='product_price']" position="inside">
<button type="button" class="btn btn-xs"
data-toggle="modal"
style="background: transparent;"
t-att-data-target="'#product_view'+str(product.id)">
<i class="fa fa-search-plus" style="color: #337ab7;"/>
</button>
</xpath>
</template>
</odoo>