diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js index 34cf1fce863..dda494aac7e 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -95,7 +95,7 @@ $('.oe_website_sale').each(function () { $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')) ); - var $img = $(this).closest('tr.js_product, .oe_website_sale').find('span[data-oe-model^="product."][data-oe-type="image"] img, img.product_detail_img'); + var $img = $(this).closest('tr.js_product, .oe_website_sale').find('span[data-oe-model^="product."][data-oe-type="image"] img:first, img.product_detail_img'); $img.attr("src", "/website/image/product.product/" + $(this).val() + "/image"); }); @@ -129,7 +129,7 @@ $('.oe_website_sale').each(function () { } if (product_id) { - var $img = $(this).closest('tr.js_product, .oe_website_sale').find('span[data-oe-model^="product."][data-oe-type="image"] img, img.product_detail_img'); + var $img = $(this).closest('tr.js_product, .oe_website_sale').find('span[data-oe-model^="product."][data-oe-type="image"] img:first, img.product_detail_img'); $img.attr("src", "/website/image/product.product/" + product_id + "/image"); $img.parent().attr('data-oe-model', 'product.product').attr('data-oe-id', product_id) .data('oe-model', 'product.product').data('oe-id', product_id); diff --git a/addons/website_sale_options/static/src/js/website_sale.js b/addons/website_sale_options/static/src/js/website_sale.js index 72a45139b83..3d8ecee4ebb 100644 --- a/addons/website_sale_options/static/src/js/website_sale.js +++ b/addons/website_sale_options/static/src/js/website_sale.js @@ -53,7 +53,7 @@ $(document).ready(function () { $(".js_remove .js_items").addClass("hidden"); $(".js_remove .js_item").removeClass("hidden"); } else { - $(".js_remove .js_items").removeClass("hidden").text($(".js_remove .js_items").text().replace(/[0-9.,]+/, qty)); + $(".js_remove .js_items").removeClass("hidden").text($(".js_remove .js_items:first").text().replace(/[0-9.,]+/, qty)); $(".js_remove .js_item").addClass("hidden"); } }); @@ -65,5 +65,14 @@ $(document).ready(function () { }); return false; }); - + + + $('#cart_products input.js_quantity').change(function () { + var value = $(this).val(); + var $next = $(this).closest('tr').next('.optional_product'); + while($next.length) { + $next.find('.js_quantity').text(value); + $next = $next.next('.optional_product'); + } + }); }); diff --git a/addons/website_sale_options/views/templates.xml b/addons/website_sale_options/views/templates.xml index 1f0a4303e61..2963666cc8c 100644 --- a/addons/website_sale_options/views/templates.xml +++ b/addons/website_sale_options/views/templates.xml @@ -131,6 +131,7 @@ Remove from cart +