Country and State not showing in the checkout page for magento 2.4.2



Can someone help me to solve this issue? Thanks!

1 Answer 1

  1. We need to find like if the address is present in the database table or not for that customer, address.phtml is one file you can check and in database you can check the address related table of that customer.
  2. Once the customer got logged in then try to check the address, and also check manage address area, where you may see the address without country (may be country or state is optional in form so not provided at the time of making address), so try to edit the address to provide country and state and then check again by ordering again, it will be visible ..
  3. Future step for permanent correction - you need to make that optional field of country and state as required by using some jQuery code, you need to see code in this file address.phtml.
  • Thank for your help. But please note, with default theme (Luma) then it working normal, because in theme using module Ajax Cart make them not show, do you know what solution? May 7, 2021 at 2:23
  • can you share me your ajax code, actually generally what happens we pass url and data into ajax but sometimes we forget to pass some variable that hold the information of country and state.. so you may also keep them in hidden field and check by using inspect element and in your ajax code in data: check what all variable you are passing, console.log data before actually using data in ajax, please try and till what level we are having these variable that is related to country and state. Also check for spelling mistake in mapping of data from html to javascript. I hope it will help. May 7, 2021 at 4:39
  • Hi there, this is link download module, can you install and check it: drive.google.com/file/d/1axVx_CI40HxjImXS450D8cnBAryzogSg/… Thanks! May 7, 2021 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.