[FIX] website_sale_options: only one optional product is added to the cart and the quantity of the optional product don't change in the cart when we click on more or less. Fix the number of items displayed in the modal options.
This commit is contained in:
parent
7ce3961693
commit
d8e67d647f
|
@ -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_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')) );
|
$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");
|
$img.attr("src", "/website/image/product.product/" + $(this).val() + "/image");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ $('.oe_website_sale').each(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (product_id) {
|
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.attr("src", "/website/image/product.product/" + product_id + "/image");
|
||||||
$img.parent().attr('data-oe-model', 'product.product').attr('data-oe-id', product_id)
|
$img.parent().attr('data-oe-model', 'product.product').attr('data-oe-id', product_id)
|
||||||
.data('oe-model', 'product.product').data('oe-id', product_id);
|
.data('oe-model', 'product.product').data('oe-id', product_id);
|
||||||
|
|
|
@ -53,7 +53,7 @@ $(document).ready(function () {
|
||||||
$(".js_remove .js_items").addClass("hidden");
|
$(".js_remove .js_items").addClass("hidden");
|
||||||
$(".js_remove .js_item").removeClass("hidden");
|
$(".js_remove .js_item").removeClass("hidden");
|
||||||
} else {
|
} 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");
|
$(".js_remove .js_item").addClass("hidden");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -65,5 +65,14 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
return false;
|
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');
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -131,6 +131,7 @@
|
||||||
<a href="#" class="js_remove"><small>Remove from cart</small></a>
|
<a href="#" class="js_remove"><small>Remove from cart</small></a>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
<t t-set="option_inc" t-value="option_inc+1"/>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in New Issue