Skip to content
Open
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2011 Adobe
* All Rights Reserved.
*/

define([
'jquery',
'jquery-ui-modules/widget'
], function ($) {
'use strict';

$.widget('mage.addToWishlist', {
options: {
Expand All @@ -16,7 +15,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'
Expand Down Expand Up @@ -293,9 +292,15 @@ define([
* @private
*/
_validateWishlistQty: function (event) {
var element = $(this.options.qtyInfo);
var element = $(this.options.qtyInfo), isValid = true;

if (!(element.validation() && element.validation('isValid'))) {
$(element).each(function () {
if (!($(this).validation() && $(this).validation('isValid'))) {
isValid = false;
}
});

if (!isValid) {
event.preventDefault();
event.stopPropagation();

Expand Down