magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.3k forks source link

unnecessary loader on Checkout when no fields are filled in. #37838

Closed leonhelmus closed 1 year ago

leonhelmus commented 1 year ago

Preconditions and environment

Steps to reproduce

  1. Add a product to the cart go as a guest user
  2. Go to the cart
  3. Go to the checkout
  4. Select a shipping method, but don't add anything to other fields like (email, street, zipcode, etc.)
  5. click on "next"

Expected result

Validation is triggered and nothing more.

Actual result

Validation is triggered and also some rest apis are triggered like:

Additional information

This patch resolved my issue:

diff --git a/vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js b/vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js
--- a/vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js
+++ b/vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js  (date 1691056962379)
@@ -335,7 +335,7 @@
                     );
                 }

-                if (emailValidationResult &&
+                if (!emailValidationResult ||
                     this.source.get('params.invalid') ||
                     !quote.shippingMethod()['method_code'] ||
                     !quote.shippingMethod()['carrier_code']

With this patch it will now also check when email is not filled in and now only triggers validation instead of all other things as well.

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @leonhelmus. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 1 year ago

Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


engcom-Dash commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Dash, here is your Magento Instance: https://44a0bd8c0f2d7640ac12f8f06717a370.instances-prod.magento-community.engineering Admin access: https://44a0bd8c0f2d7640ac12f8f06717a370.instances-prod.magento-community.engineering/admin_7126 Login: 6331c4e2 Password: 0382af9a4cf6

engcom-Dash commented 1 year ago

Hi @leonhelmus ,

Verified the issue in 2.4-develop instance and the issue is not reproducible,Kindly provide more details to confirm this issue and kindly recheck the behaviour in 2.4-develop instance. Kindly refer below screenshots:

Screenshot 2023-08-03 at 6 09 35 PM
leonhelmus commented 1 year ago

@engcom-Dash It does add a loader for the shipping methods. if you do not fill in email and other fields.

When looking here: image

you see it continues while it should stop at this part:

                if (emailValidationResult &&
                    this.source.get('params.invalid') ||
                    !quote.shippingMethod()['method_code'] ||
                    !quote.shippingMethod()['carrier_code']
                ) {
                    this.focusInvalid();

                    return false;
                }

but since the email is not valid it will not trigger the return false. i would think it should not go beyond the if condition while now it does. Please check the following file and use a js debugger of the browser on line 348 of file Magento_Checkout/js/view/shipping

This additional part and requests should not be needed when validation is false.

engcom-Dash commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Dash, here is your Magento Instance: https://44a0bd8c0f2d7640ac12f8f06717a370.instances-prod.magento-community.engineering Admin access: https://44a0bd8c0f2d7640ac12f8f06717a370.instances-prod.magento-community.engineering/admin_f815 Login: e6d9d655 Password: 79fee7e1c892

engcom-Dash commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @engcom-Dash, here is your Magento Instance: https://44a0bd8c0f2d7640ac12f8f06717a370.instances-prod.magento-community.engineering Admin access: https://44a0bd8c0f2d7640ac12f8f06717a370.instances-prod.magento-community.engineering/admin_ed16 Login: 7f0f1e8b Password: 5ce4a45a200f

engcom-Dash commented 1 year ago

Hi @leonhelmus , Verified the issue in 2.4-develop instance and the issue is not reproducible,Kindly refer the below video reference:

https://github.com/magento/magento2/assets/60198592/7c9eaf96-0c14-48a7-8cb0-018667e1e59d

engcom-Dash commented 1 year ago

Hi @leonhelmus ,

We have noticed that this issue has not been updated since long time.
Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.