Skip to content

Commit 696a64e

Browse files
committed
Merge remote-tracking branch 'mpi/MAGETWO-53144' into MPI-PR-3005
2 parents b2ecbdc + b539bc3 commit 696a64e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ define(
1414
var checkoutConfig = window.checkoutConfig,
1515
agreementsConfig = checkoutConfig ? checkoutConfig.checkoutAgreements : {};
1616

17+
var agreementsInputPath = '.payment-method._active div.checkout-agreements input';
18+
1719
return {
1820
/**
1921
* Validate checkout agreements
@@ -25,6 +27,10 @@ define(
2527
return true;
2628
}
2729

30+
if ($(agreementsInputPath).length == 0) {
31+
return true;
32+
}
33+
2834
return $('#co-payment-form').validate({
2935
errorClass: 'mage-error',
3036
errorElement: 'div',
@@ -36,7 +42,7 @@ define(
3642
}
3743
errorPlacement.after(error);
3844
}
39-
}).element('.payment-method._active div.checkout-agreements input');
45+
}).element(agreementsInputPath);
4046
}
4147
}
4248
}

0 commit comments

Comments
 (0)