From 1f21bccb4369b784d99c11b0677e7cff104de7cc Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Wed, 12 Oct 2016 11:22:14 +0300 Subject: [PATCH 01/16] MAGETWO-59573: Braintree JS error on checkout after applying 100% discount coupon with free shipping enabled --- .../view/frontend/web/js/view/payment/method-renderer/paypal.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js index 184260c39e954..075a1fdaf1fc1 100644 --- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js +++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js @@ -98,7 +98,6 @@ define([ quote.totals.subscribe(function () { if (self.grandTotalAmount !== quote.totals()['base_grand_total']) { self.grandTotalAmount = quote.totals()['base_grand_total']; - self.reInitPayPal(); } }); From 4d89955ed19884df308fbecedb612b782bf0a88d Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Wed, 12 Oct 2016 12:34:22 +0300 Subject: [PATCH 02/16] MAGETWO-57682: [GitHub] Checkout Agreement validation is broken on payment method change #6224 --- .../web/js/model/agreement-validator.js | 24 ++++--------------- .../checkout/checkout-agreements.html | 7 +++--- lib/web/mage/validation.js | 12 +++++++--- 3 files changed, 16 insertions(+), 27 deletions(-) diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js index 3d030a62eb425..2fa3c2cddd3d5 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js +++ b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js @@ -12,9 +12,8 @@ define( function ($) { 'use strict'; var checkoutConfig = window.checkoutConfig, - agreementsConfig = checkoutConfig ? checkoutConfig.checkoutAgreements : {}; - - var agreementsInputPath = '.payment-method._active div.checkout-agreements input'; + agreementsConfig = checkoutConfig ? checkoutConfig.checkoutAgreements : {}, + agreementsInputPath = '.payment-method._active div.checkout-agreements input'; return { /** @@ -23,26 +22,11 @@ define( * @returns {boolean} */ validate: function() { - if (!agreementsConfig.isEnabled) { - return true; - } - - if ($(agreementsInputPath).length == 0) { + if (!agreementsConfig.isEnabled || $(agreementsInputPath).length == 0) { return true; } - return $('#co-payment-form').validate({ - errorClass: 'mage-error', - errorElement: 'div', - meta: 'validate', - errorPlacement: function (error, element) { - var errorPlacement = element; - if (element.is(':checkbox') || element.is(':radio')) { - errorPlacement = element.siblings('label').last(); - } - errorPlacement.after(error); - } - }).element(agreementsInputPath); + return $.validator.validateSingleElement(agreementsInputPath, {errorElement: 'div'}); } } } diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/web/template/checkout/checkout-agreements.html b/app/code/Magento/CheckoutAgreements/view/frontend/web/template/checkout/checkout-agreements.html index bb7d5de636ce5..7d8ef43084f32 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/web/template/checkout/checkout-agreements.html +++ b/app/code/Magento/CheckoutAgreements/view/frontend/web/template/checkout/checkout-agreements.html @@ -8,14 +8,13 @@
-
- + + }"/>