magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

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

Open trungto3t opened this issue 4 years ago • 13 comments

Preconditions (*)

1.Magento 2.4.2 with sample data (replicate on Magento 2.4.3) 2.PHP 7.4 3. 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

trungto3t avatar Sep 21 '21 04:09 trungto3t

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

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

: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

m2-assistant[bot] avatar Sep 21 '21 04:09 m2-assistant[bot]

@magento give me 2.4-develop instance

trungto3t avatar Sep 21 '21 04:09 trungto3t

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

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.

m2-assistant[bot] avatar Sep 21 '21 04:09 m2-assistant[bot]

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

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

trungto3t avatar Sep 21 '21 04:09 trungto3t

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:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Sep 21 '21 05:09 m2-assistant[bot]

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

ajijshekh123 avatar Sep 21 '21 05:09 ajijshekh123

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

github-jira-sync-bot avatar Sep 21 '21 05:09 github-jira-sync-bot

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

github-jira-sync-bot avatar Nov 08 '21 21:11 github-jira-sync-bot

: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.

m2-assistant[bot] avatar Nov 08 '21 21:11 m2-assistant[bot]

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.

github-jira-sync-bot avatar Nov 08 '21 21:11 github-jira-sync-bot

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

patrasq avatar Sep 22 '22 04:09 patrasq

@magento give me 2.4-develop instance

DavaGordon avatar Nov 02 '22 23:11 DavaGordon

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

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

Reproduced on 2.4.dev

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

DavaGordon avatar Nov 03 '22 00:11 DavaGordon

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).

vandijkstef avatar Jan 04 '23 15:01 vandijkstef

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

atty31 avatar Apr 25 '23 14:04 atty31

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.

engcom-Bravo avatar Jun 25 '24 05:06 engcom-Bravo

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

github-jira-sync-bot avatar Jun 25 '24 06:06 github-jira-sync-bot