Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Doesn't obey the Allow Countries setting #2

Open
bluec opened this issue May 25, 2017 · 5 comments
Open

Doesn't obey the Allow Countries setting #2

bluec opened this issue May 25, 2017 · 5 comments

Comments

@bluec
Copy link
Contributor

bluec commented May 25, 2017

Currently this extension doesn't obey the list of countries defined in General -> General -> Allow Countries.

In other words, if a country is not in the allowed list it will still be considered as a valid country when processing the shipping rules. Ultimately this means it's possible for customers to choose delivery addresses outside of the Allowed Countries.

@bobbyshaw
Copy link
Member

Hi @bluec. Thanks for this. One way around this would be to use the shipping country requirements into the rules which is what we've done before.

@bluec
Copy link
Contributor Author

bluec commented May 25, 2017

Hi @bobbyshaw thanks for the response. Yes that's a workaround but it feels cumbersome especially if you have many rules that all need to exclude the same set of countries.

I am wondering about two potential solutions:

  1. A global setting "Allow Delivery To" with options "All Countries" and "Only Allowed Countries". If the latter is selected then all rules automatically use only allowed countries.
  2. A new Yes/No condition when creating the rules along the lines of "Limit to Allowed Countries?"

The first would suit my needs while the latter might give more flexibility. That said, it seems difficult to think of a situation where you'd want to limit some rules and not others.

@bobbyshaw
Copy link
Member

I think the first is more aligned with how shipping extensions are expected to work so I think that ones fair. I don't think this is that large of a change but I'll be upfront in saying I don't think we're going to rush to spend time on this. We find that this extension is mostly used for new builds of which there shouldn't be many more of on M1! We'd happily review if you happened to work on this though.

@bluec
Copy link
Contributor Author

bluec commented May 25, 2017

That's cool I am happy to have a go at the implementation; it shouldn't be too hard. Thanks for the discussion about it, I think I agree the former method is more appropriate. I'll make a PR if I come up with anything.

@bluec
Copy link
Contributor Author

bluec commented Jul 3, 2017

I've added a PR for this. Only the admin settings are required to make this work as the logic is handled automatically in the checkAvailableShipCountries method of Mage_Shipping_Model_Carrier_Abstract.

Doing this has uncovered what I think is a bug (or maybe a design?!) of Magento 1: if a shipping method has "Ship to Applicable Countries" set to "All Allowed Countries" then the shipping country is never actually validated against the list of globally allowed countries as defined in general/country/allow.

This means that if a customer is shipping to a saved address with a country that is no longer available in the globally allowed countries list then any shipping method set to "All Allowed Countries" will still be available. Presumably it also means that when the allowed countries are globally restricted and not available in the drop-down you can manipulate the form POST data and actually ship to a country that is not allowed.

Would be interested whether anyone can validate my findings here. I was testing on 1.9.3.2. It seems a pretty big bug to have gone unnoticed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants