From 0b34903388fef6832cd38dfb18d87c3f0e915d32 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 3 Dec 2015 12:00:00 +0100 Subject: [PATCH] [IMP] website_sale: no change in behavior but allow other comportment for new ecommerce designs Allow toupdate the order content in js on an other page that the cart. An allow to use table instead of only div. --- addons/website_sale/static/src/js/website_sale.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js index 63244327949..21ae29a7d97 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -52,7 +52,7 @@ $('.oe_website_sale').each(function () { $(ev.currentTarget).parents(".thumbnail").toggleClass("disabled"); }); - $(oe_website_sale).find(".oe_cart input.js_quantity").on("change", function () { + $(oe_website_sale).find("input.js_quantity[data-product-id]").on("change", function () { var $input = $(this); if ($input.data('update_change')) { return; @@ -126,7 +126,7 @@ $('.oe_website_sale').each(function () { ev.preventDefault(); var $link = $(ev.currentTarget); var $input = $link.parent().find("input"); - var product_id = +$input.closest('div:has(input[name="product_id"])').find('input[name="product_id"]').val(); + var product_id = +$input.closest('*:has(input[name="product_id"])').find('input[name="product_id"]').val(); var min = parseFloat($input.data("min") || 0); var max = parseFloat($input.data("max") || Infinity); var quantity = ($link.has(".fa-minus").length ? -1 : 1) + parseFloat($input.val(),10);