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

Shipping method don't reload by default country when first reload page #34135

Open trungto3t opened 3 years ago

trungto3t commented 3 years ago

Preconditions (*)

1.Magento 2.4.2 with sample data (replicate on Magento 2.4.3) 2.PHP 7.4

  1. Local enviroment.

Steps to reproduce (*)

1.Set United Kingdom to default country General->general->Country Options -> default country 2.Set shipping method free shipping for special countries United Kingdom 3.Add any product to cart. 4.Go to checkout page (Guest checkout,just open the checkout page, haven't filled in any fields)

Expected result (*)

  1. Shipping address country display United Kingdom 2.Shipping method apprear free shipping method

Actual result (*)

  1. Shipping address country display United Kingdom 2.Shipping method not apprear free shipping method

https://www.loom.com/share/3eb9cabfd8fe45d58f119d241d780c77 window.checkoutConfig.defaultCountryId was set by field https://i.imgur.com/JLs78qm.png https://i.imgur.com/T4Wim5p.png not General->general->Country Options -> default country

m2-assistant[bot] commented 3 years ago

Hi @trungto3t. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

trungto3t commented 3 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 3 years ago

Hi @trungto3t. Thank you for your request. I'm working on Magento instance for you.

m2-assistant[bot] commented 3 years ago

Hi @trungto3t! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

magento-deployment-service[bot] commented 3 years ago

Hi @trungto3t, here is your Magento Instance: https://f243b9c0f9ae3b48969f9df1aac23955-2-4-develop.instances.magento-community.engineering Admin access: https://f243b9c0f9ae3b48969f9df1aac23955-2-4-develop.instances.magento-community.engineering/admin_7bbb Login: 13ce1b4e Password: 5f03e6b2c98f

trungto3t commented 3 years ago

@magento i replicate issue on 2.4-develop instance https://www.loom.com/share/b8001e439def4505bcd1f4d375080c0e

m2-assistant[bot] commented 3 years ago

Hi @ajijshekh123. 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:

ajijshekh123 commented 3 years ago

Hi @trungto3t, The issue is reproduced to the below steps:

  1. Set up the default country "United Kingdom" on Admin > Stores > General > Country Options > United Kingdom

image

image

  1. On the Front end, Add Bag product to the cart
  2. Click on the Mini cart icon, Navigate the Checkout page
  3. For the first time "Free Shipping" method is not showing on Shipping methods block

image

  1. Once the user changes the other country and again select the "United Kingdom" default country > "FREE SHIPPING" METHOD IS SHOWING ON SHIPPING METHOD BLOCK (CHECKOUT PAGE)

image

image

Thanks

github-jira-sync-bot commented 3 years ago

:x: Something went wrong. Cannot create Jira issue.

github-jira-sync-bot commented 2 years ago

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-1673 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 years ago

:white_check_mark: Confirmed by @sdzhepa. Thank you for verifying the issue.
Issue Available: @sdzhepa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

github-jira-sync-bot commented 2 years ago

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

patrasq commented 2 years ago

Hi, any update on this? 2.4 instance, same behavior.

DavaGordon commented 1 year ago

@magento give me 2.4-develop instance

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

Hi @DavaGordon. Thank you for your request. I'm working on Magento instance for you.

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

Hi @DavaGordon, here is your Magento Instance: https://4c16aa837a9c698b3d498332bd36d65a.instances.magento-community.engineering Admin access: https://4c16aa837a9c698b3d498332bd36d65a.instances.magento-community.engineering/admin_d3c1 Login: d7afbe0a Password: 8ae9f0ce8e7e

DavaGordon commented 1 year ago

Reproduced on 2.4.dev

Issue present if Ship to Applicable Countries set to Specific Country.

vandijkstef commented 1 year ago

Same issue here. Basic summary, the first call of estimate-shipping-methods contains the wrong country_id (which is likely the global default?) For me that is 'NL' so the initial payload is:

{
    "address": {
        "street": [],
        "country_id": "NL",
        "postcode": null
    }
}

Yet, I'm on a store view that has the default country set to GB. The country field is showing 'GB', not 'NL'.

After only changing the postcode, it realises it's mistake and fetches the estimate-shipping-methods correctly, giving me the following payload

{
    "street": [],
    "city": "",
    "region": "",
    "country_id": "GB",
    "postcode": "123 ab",
    "firstname": "",
    "lastname": "",
    "vat_id": "",
    "company": "",
    "telephone": ""
}

So, I assume the order of the execution is wrong here; It likely fetches the shipping methods as soon as possible, then updates the form according to the defaults, then attaches the field listeners (or the field listeners are bypassed/not triggered at all by the way the fields are updated).

atty31 commented 1 year ago

I got the same behaviour . Is there any update on this issue ?

engcom-Bravo commented 3 months ago

Hi @trungto3t,

Thanks for your reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.kindly refer the screenshots.

Screenshot 2024-06-25 at 10 50 17

Checkout (1)

Shipping address country display United Kingdom Shipping method not appear free shipping method

Hence Confirming the issue.

Thanks.

github-jira-sync-bot commented 3 months ago

:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-1673