I would like to have a continent condition on "Order address component comparision" as shown in screenshot. I already did a patch for this. I'm uploading it on first comment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rcodina’s picture

Status: Active » Needs review
FileSize
1.78 KB

I upload the patch, Please, test it.

rszrama’s picture

Status: Needs review » Closed (won't fix)

Sorry, this patch adds a dependency on data from a module we don't currently have a dependency on. Your best bet will be to put the code into a custom module you use on that site or make it general enough to publish on drupal.org on its own.

rcodina’s picture

Status: Closed (won't fix) » Needs review

I don't agree with you.

1) Countries database table ships with drupal's core. So this isn't a reason for this patch to be rejected.

2) The best site to put this is in the source code of this module. A standalone module for this is not recommended because a module must have at least 120 lines of code. Check out this.

3) I think this is a basic feature for Drupal Commerce. Why is not included?

rszrama’s picture

Status: Needs review » Closed (won't fix)

No, that table is not part of Drupal core. There are innumerable "basic" features of Commerce that people propose for core inclusion, but in this case it simply isn't necessary. My recommendation from above stands, especially since the data source you're querying doesn't exist outside of the Countries module.

rcodina’s picture

1) Why it's so bad to add a dependency to countries module? Wouldn't be a good solution to add an "if" checking if country module is enabled? This module is enabled by default in every drupal.

2) If there are innumerable "basic" features that people propose and get rejected, aren't you affraid that most of them leave Drupal Commerce? Not all people has php/js/css/mysql knowledge.

rszrama’s picture

No, Drupal Commerce continues to grow despite the rejection of feature requests, and in large part it's because we do focus on providing a core framework and encouraging people to extend it - such as with integration modules into third party modules like Countries. That said, in Commerce 2.x, this particular question will be irrelevant, as we add a dependency on a complete addressing library: https://github.com/commerceguys/addressing