summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshan Kalola (OpenERP) <dka@tinyerp.com>2014-01-16 17:31:00 +0530
committerDarshan Kalola (OpenERP) <dka@tinyerp.com>2014-01-16 17:31:00 +0530
commit4e3bed270e75b85cfefa79f64713b45052b18c19 (patch)
tree68cb47258e0c2eeb636500d6677d5549bb645679
parent6a1eb008bf024c1ab332a56267ca1946f868b864 (diff)
[IMP]improved product template in website_sale.
bzr revid: dka@tinyerp.com-20140116120100-m305tam84zvjh0fw
-rw-r--r--addons/website_sale/static/src/js/website_sale.js8
-rw-r--r--addons/website_sale/views/website_sale.xml28
2 files changed, 25 insertions, 11 deletions
diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js
index 8015902b385..da07d635f12 100644
--- a/addons/website_sale/static/src/js/website_sale.js
+++ b/addons/website_sale/static/src/js/website_sale.js
@@ -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>'+
diff --git a/addons/website_sale/views/website_sale.xml b/addons/website_sale/views/website_sale.xml
index 422950b80d1..cf6785856bd 100644
--- a/addons/website_sale/views/website_sale.xml
+++ b/addons/website_sale/views/website_sale.xml
@@ -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='{