From 0ff26cf7cdb29bc525462b281d2253889a65b1f4 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Fri, 22 May 2015 11:33:38 +0200 Subject: [PATCH] [FIX] website_sale: quick add in the cart If the product to quick add in the cart has several variants, the button cart redirects the user to the page of this product. If "attribute_value_ids" is not in the DOM when clicking on the button cart, the product is immediately added in the cart. Closes #6714 opw:639897 --- addons/website_sale/views/templates.xml | 7 ++++++- addons/website_sale_options/static/src/js/website_sale.js | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 3665c1dbc3c..d4dd628102d 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -116,7 +116,12 @@ 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 55085e300ea..8f1407c068a 100644 --- a/addons/website_sale_options/static/src/js/website_sale.js +++ b/addons/website_sale_options/static/src/js/website_sale.js @@ -1,4 +1,7 @@ $(document).ready(function () { + if(! $("ul.js_add_cart_variants[data-attribute_value_ids]").length){ + return; + } $('.oe_website_sale #add_to_cart, .oe_website_sale #products_grid .a-submit') .off('click') .removeClass('a-submit')