[FIX] website_sale: displayed price doesn't change for 'List View of Variants' customize template

This commit is contained in:
Christophe Matthieu 2014-09-19 11:07:33 +02:00
parent 29e08a272c
commit 8afa1b6062
2 changed files with 7 additions and 1 deletions

View File

@ -90,6 +90,12 @@ $('.oe_website_sale').each(function () {
return price + (dec ? '' : '.0') + (dec%10 ? '' : '0');
}
$(oe_website_sale).on('change', 'input.js_product_change', function (ev) {
var $parent = $(this).closest('.js_product');
$parent.find(".oe_default_price:first .oe_currency_value").html( price_to_str(+$(this).data('lst_price')) );
$parent.find(".oe_price:first .oe_currency_value").html(price_to_str(+$(this).data('price')) );
});
$(oe_website_sale).on('change', 'input.js_variant_change, select.js_variant_change', function (ev) {
var $ul = $(this).parents('ul.js_add_cart_variants:first');
var $parent = $ul.closest('.js_product');

View File

@ -460,7 +460,7 @@
<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"/>
<input type="radio" name="product_id" class="js_product_change" t-att-value="variant_id.id" t-att-data-lst_price="variant_id.lst_price" t-att-data-price="variant_id.price"/>
<span t-esc="variant_id.name_get()[0][1]"/>
<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" style="white-space: nowrap;" t-field-options='{