[FIX] website_sale: Updating price on Optional Products

When changing the quantity of a product in Optional Products modal
in the shop, the price was not updated according to the pricelist.

opw:726686
This commit is contained in:
Goffin Simon
2017-04-06 17:37:19 +02:00
parent 01add1fe15
commit c8a434306f
2 changed files with 5 additions and 3 deletions
@@ -276,8 +276,10 @@ $('.oe_website_sale').each(function () {
var $ul = $(ev.target).closest('.js_add_cart_variants');
var $parent = $ul.closest('.js_product');
var $product_id = $parent.find('input.product_id').first();
var $price = $parent.find(".oe_price:first .oe_currency_value");
var $default_price = $parent.find(".oe_default_price:first .oe_currency_value");
var $price = $parent.find(".oe_price:first .oe_currency_value")
.add($('#product_confirmation').find(".oe_price"));
var $default_price = $parent.find(".oe_default_price:first .oe_currency_value")
.add($('#product_confirmation').find(".oe_default_price:first .oe_currency_value"));
var $optional_price = $parent.find(".oe_optional:first .oe_currency_value");
var variant_ids = $ul.data("attribute_value_ids");
var values = [];
@@ -55,7 +55,7 @@
</div>
</td>
<td>
<span t-attf-class="text-danger oe_default_price" t-att-style="'' if (compute_currency(product.lst_price) - product.price) &gt; 0.1 else 'display: none;'" style="text-decoration: line-through; white-space: nowrap;"
<span t-attf-class="text-danger oe_default_price" style="text-decoration: line-through; white-space: nowrap;"
t-field="product.lst_price"
t-field-options='{
"widget": "monetary",