From 1749a31ce6d616ee84ce0004f846d6c1cc0aec4c Mon Sep 17 00:00:00 2001 From: "serhii.tkachenko" Date: Wed, 12 Oct 2022 16:33:20 +0300 Subject: [PATCH] fix(payment): PAYPAL-1720 made initial product details data update if the form is valid on page load --- CHANGELOG.md | 1 + assets/js/theme/common/product-details.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eabcf4f9b..212f1f04ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated PayPal Accelerated Checkout default button styles [#2268](https://github.com/bigcommerce/cornerstone/pull/2268) - Add logic to collect Product Details data and send it to the BC App stencil template through custom event [#2270](https://github.com/bigcommerce/cornerstone/pull/2270) - Allow quantity of "0" in cart to remove item [#2266](https://github.com/bigcommerce/cornerstone/pull/2266) +- Fix the issue with getting product details data if the product details form is valid on page load [#2271](https://github.com/bigcommerce/cornerstone/pull/2271) ## 6.6.1 (09-14-2022) diff --git a/assets/js/theme/common/product-details.js b/assets/js/theme/common/product-details.js index 6c86874373..801176f504 100644 --- a/assets/js/theme/common/product-details.js +++ b/assets/js/theme/common/product-details.js @@ -28,7 +28,9 @@ export default class ProductDetails extends ProductDetailsBase { const $form = $('form[data-cart-item-add]', $scope); - if (!$form[0].checkValidity()) { + if ($form[0].checkValidity()) { + this.updateProductDetailsData(); + } else { this.toggleWalletButtonsVisibility(false); }