[IMP]improved product template in website_sale.

bzr revid: dka@tinyerp.com-20140116120100-m305tam84zvjh0fw
This commit is contained in:
Darshan Kalola (OpenERP)
2014-01-16 17:31:00 +05:30
parent 6a1eb008bf
commit 4e3bed270e
2 changed files with 25 additions and 11 deletions
@@ -65,13 +65,13 @@ $(document).ready(function () {
ev.preventDefault();
var $label = $(ev.currentTarget);
var $price = $label.parent("form").find(".oe_price .oe_currency_value");
if (!$price.data("price")) {
$price.data("price", parseFloat($price.text()));
var $variant_price = $label.find(".oe_variant_price .oe_currency_value");
if (!$variant_price.data("price")) {
$variant_price.data("price", parseFloat($variant_price.text()));
}
$price.html($price.data("price")+parseFloat($label.find(".badge span").text() || 0));
$price.html($variant_price.data("price"));
});
$(".js_slider").each(function() {
var $slide = $(this);
var $slider = $('<div>'+
+21 -7
View File
@@ -299,27 +299,41 @@
<input type="hidden" t-if="len(product.product_variant_ids) == 1" name="product_id" t-att-value="product.product_variant_ids[0].id"/>
<t t-if="len(product.product_variant_ids) &gt; 1">
<label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="variant_id">
<input type="radio" name="product_id" t-att-value="variant_id.id" t-att-checked="variant_id == product.product_variant_ids[0] or None"/>
<input type="radio" name="product_id" t-att-value="variant_id.id" t-att-checked="variant_id == product.product_variant_ids[0]"/>
<t t-esc="variant_id.variants or ''">Standard</t>
<span class="badge" t-if="variant_id.price_extra">
<t t-esc="variant_id.price_extra > 0 and '+' or ''"/><span t-field="variant_id.price_extra" t-field-options='{
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"
}'/>
</span>
<span t-if = "variant_id.lst_price != variant_id.price">
<span class="oe_variant_lst_price text-danger" style="text-decoration: line-through;"
t-field="variant_id.lst_price"
t-field-options='{
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"
}'/>
</span>
<b class="oe_variant_price"
style="display: none;"
t-field="variant_id.price"
t-field-options='{
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"
}'/>
</label>
</t>
<div class="product_price mt16" t-if="product.product_variant_ids">
<h4>
<t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
<t t-if="len(product.product_variant_ids) &lt; 2 and product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
<span class="text-danger" style="text-decoration: line-through;"
t-field="product.product_variant_ids[0].lst_price"
t-field-options='{
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"
}'/><br/>
</t>
</t>
<h4>
<b class="oe_price"
t-field="product.product_variant_ids[0].price"
t-field-options='{