[IMP]improved template view in website_sale.

bzr revid: dka@tinyerp.com-20140117073308-wcyg4q60aj187wek
This commit is contained in:
Darshan Kalola (OpenERP) 2014-01-17 13:03:08 +05:30
parent 21c54c95a2
commit f75f2eccef
2 changed files with 11 additions and 4 deletions

View File

@ -71,7 +71,13 @@ $(document).ready(function () {
}
$price.html($variant_price.data("price"));
});
$('form.js_add_cart_json label:first').trigger('mouseup');
//Trigger mouseup event of the checked radio button.
$('form.js_add_cart_json label input.variant_radio').each(function() {
if (this.checked) {
$(this).parent().trigger('mouseup');
}
});
$(".js_slider").each(function() {
var $slide = $(this);
var $slider = $('<div>'+

View File

@ -302,17 +302,18 @@
<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.price == min([x.price for x in product.product_variant_ids])"/>
<input class="variant_radio" type="radio" name="product_id" t-att-value="variant_id.id" t-att-checked="variant_id.price == min([x.price for x in product.product_variant_ids])"/>
<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-esc="variant_id.price_extra" t-field-options='{
<t t-esc="variant_id.price_extra > 0 and '+' or ''"/>
<span t-esc="variant_id.price_extra" t-field-options='{
"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-esc="variant_id.lst_price"
t-field-options='{
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"