Skip to content
Snippets Groups Projects
Commit 69b18768 authored by Uku Lagle's avatar Uku Lagle
Browse files

[FIX] website_sale_wishlist, js: add to cart qty


The selector used for finding the qty field is simply 'qty', which is useless
in most cases.

While there is actually no quantity input in a wishlist template, it could be
leveraged by extension modules.

Support for same markup as found in product page seems appropriate:
input[name="add_qty"]

closes odoo/odoo#33224

Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
parent e6163972
Branches
Tags
No related merge requests found
......@@ -138,7 +138,7 @@ var ProductWishlist = Widget.extend({
// can be hidden if empty
$('#my_cart').removeClass('hidden');
website_sale_utils.animate_clone($('#my_cart'), tr, 25, 40);
return this.add_to_cart(product, tr.find('qty').val() || 1);
return this.add_to_cart(product, tr.find('input[name="add_qty"]').val() || 1);
},
wishlist_mv: function(e){
var tr = $(e.currentTarget).parents('tr');
......@@ -146,7 +146,7 @@ var ProductWishlist = Widget.extend({
$('#my_cart').removeClass('hidden');
website_sale_utils.animate_clone($('#my_cart'), tr, 25, 40);
var adding_deffered = this.add_to_cart(product, tr.find('qty').val() || 1);
var adding_deffered = this.add_to_cart(product, tr.find('input[name="add_qty"]').val() || 1);
this.wishlist_rm(e, adding_deffered);
return adding_deffered;
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment