Just noticed...
If I have an address that has a country of Canada for example .... and I create an order, I am limited to shipping mods based on my Country. This works fine.
If I delete Canada from the countries database, I can now checkout with any shipping mod as the limits no longer apply to my Canada address since it has been removed from the database. It is still assigned to my address book ... so all looks fine from the client's end.
Thoughts?
Delete Country Breaks Shipping Zone Limit
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
Re: Delete Country Breaks Shipping Zone Limit
Mmm? No help but my thoughts are don't delete Canada? I mean, in any context, at least think of all the beavers and bears!
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Delete Country Breaks Shipping Zone Limit
Or at least, don't delete Canada from the countries table without also deleting it from the address_book and zones_to_geo_zones tables.
From where you are now, you might see if you can delete a row from the zones_to_geo_zones table relating the non-existent country with a zone and the geo-zone that comes through in the limitation. Because the default when a shipping zone is specified is to refuse to ship. So if it is shipping, that suggests that there is an entry allowing it in zones_to_geo_zones.
If you want to block deleting the country when it has zones_to_geo_zones or address_book entries, you could add a preAction hook that checks for a delete_confirm or delete action and shows a warning if someone tries to delete a country that is still in the address_book/zones_to_geo_zones tables. I'm a bit reluctant to make the equivalent core change at this point in the 1.0.8.* series, but we could talk about it again in the 1.0.9.0 series.
From where you are now, you might see if you can delete a row from the zones_to_geo_zones table relating the non-existent country with a zone and the geo-zone that comes through in the limitation. Because the default when a shipping zone is specified is to refuse to ship. So if it is shipping, that suggests that there is an entry allowing it in zones_to_geo_zones.
If you want to block deleting the country when it has zones_to_geo_zones or address_book entries, you could add a preAction hook that checks for a delete_confirm or delete action and shows a warning if someone tries to delete a country that is still in the address_book/zones_to_geo_zones tables. I'm a bit reluctant to make the equivalent core change at this point in the 1.0.8.* series, but we could talk about it again in the 1.0.9.0 series.
- zipurman
- Builder
- Posts: 540
- Joined: Tue Oct 13, 2020 5:20 pm
- Phoenix Version: v
- Has thanked: 93 times
- Been thanked: 162 times
Re: Delete Country Breaks Shipping Zone Limit
LOL ... don't forget all the dog sleds and igloosheatherbell wrote: ↑Wed Dec 14, 2022 8:09 amMmm? No help but my thoughts are don't delete Canada? I mean, in any context, at least think of all the beavers and bears!![]()
![]()
zipurman
-----------
-----------
- zipurman
- Builder
- Posts: 540
- Joined: Tue Oct 13, 2020 5:20 pm
- Phoenix Version: v
- Has thanked: 93 times
- Been thanked: 162 times
Re: Delete Country Breaks Shipping Zone Limit
I think a better option would be to add an on/off setting for each country. That would allow countries to be disabled and then reenabled as needed. There would then need to be something added throughout to make sure that setting was adhered to
zipurman
-----------
-----------