[FIX] website_sale: change picture in function of the product selected

This commit is contained in:
Christophe Matthieu 2014-07-02 14:45:37 +02:00
parent 8914453a50
commit 21615e6b2b
1 changed files with 7 additions and 0 deletions

View File

@ -108,6 +108,13 @@ $('.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.attr("src", "/website/image?field=image&model=product.product&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);
}
$parent.find("input.js_variant_change:radio, select.js_variant_change").each(function () {
var $input = $(this);
var id = +$input.val();