From 0e9ff101f251d7c49ddafbc849a9caf2396ff880 Mon Sep 17 00:00:00 2001 From: Mohamed Azarudeen Date: Fri, 20 Dec 2024 10:33:30 +0530 Subject: [PATCH 1/3] Wishlist validation added for gropued product --- .../view/frontend/web/js/add-to-wishlist.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js index 7b3b0c9ea0b51..24b70a7d1f40d 100644 --- a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js +++ b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js @@ -1,6 +1,6 @@ /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2011 Adobe + * All Rights Reserved. */ define([ @@ -16,7 +16,7 @@ define([ groupedInfo: '#super-product-table input', downloadableInfo: '#downloadable-links-list input', customOptionsInfo: '.product-custom-option', - qtyInfo: '#qty', + qtyInfo: 'input.qty', actionElement: '[data-action="add-to-wishlist"]', productListWrapper: '.product-item-info', productPageWrapper: '.product-info-main' @@ -293,9 +293,14 @@ define([ * @private */ _validateWishlistQty: function (event) { - var element = $(this.options.qtyInfo); + var element = $(this.options.qtyInfo), isValid = true; + $(element).each(function () { + if (!($(this).validation() && $(this).validation('isValid'))) { + isValid = false; + } + }) - if (!(element.validation() && element.validation('isValid'))) { + if (!isValid) { event.preventDefault(); event.stopPropagation(); From a4f98d61be4bc4119471700001479c37d88163e5 Mon Sep 17 00:00:00 2001 From: Mohamed Azarudeen Date: Tue, 10 Jun 2025 21:27:35 +0530 Subject: [PATCH 2/3] Static test case failures fix --- .../Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js index 24b70a7d1f40d..e07ff337d5f1f 100644 --- a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js +++ b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js @@ -7,7 +7,6 @@ define([ 'jquery', 'jquery-ui-modules/widget' ], function ($) { - 'use strict'; $.widget('mage.addToWishlist', { options: { @@ -294,11 +293,12 @@ define([ */ _validateWishlistQty: function (event) { var element = $(this.options.qtyInfo), isValid = true; + $(element).each(function () { if (!($(this).validation() && $(this).validation('isValid'))) { isValid = false; } - }) + }); if (!isValid) { event.preventDefault(); From 3c54ebc3bc7fd50956f8855498b59b788f6067d9 Mon Sep 17 00:00:00 2001 From: engcom-Charlie Date: Thu, 3 Jul 2025 16:09:15 +0530 Subject: [PATCH 3/3] Fixing the static tests --- .../Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js index e07ff337d5f1f..80bd793769997 100644 --- a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js +++ b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js @@ -7,6 +7,7 @@ define([ 'jquery', 'jquery-ui-modules/widget' ], function ($) { + 'use strict'; $.widget('mage.addToWishlist', { options: {