-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Current behavior
When you have e.g. 1 shipping method, and it has only allowed countries, when switching to a country that doesn't have any shipping methods, thee previous methods do not go away.
Expected behavior
There would be no shipping methods to choose from.
Steps to reproduce the issue
(Using Magento 2).
Set a shipping method to have Only Specific Countries
Choose The Specific country in Vue Storefront checkout
Choose a country that is not in the specified list
Repository
Can you handle fixing this bug by yourself?
- YES
- [] NO
Which Release Cycle state this refers to? Info for developer.
Pick one option.
- [x ] This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from
developbranch and create Pull Request2. Feature / Improvementback todevelop. - This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from
releasebranch and create Pull Request3. Stabilisation fixback torelease. - This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from
hotfixormasterbranch and create Pull Request4. Hotfixback tohotfix.
Additional information
I checked the current master branch, the issue is still there, in this line of code:
core/modules/cart/store/actions/methodsActions.ts
The updateShippingMethods needs to be change from:
async updateShippingMethods ({ dispatch }, { shippingMethods }) { if (shippingMethods.length > 0) { const newShippingMethods = shippingMethods.map(method => ({ ...method, is_server_method: true })) await dispatch('checkout/replaceShippingMethods', newShippingMethods, { root: true }) } },
to
async updateShippingMethods ({ dispatch }, { shippingMethods }) { const newShippingMethods = shippingMethods.map(method => ({ ...method, is_server_method: true })) await dispatch('checkout/replaceShippingMethods', newShippingMethods, { root: true }) },
This is only a bug report, I won't make a PR for this. Maybe someone in the community wants to make one!: )