Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | add_continent_address_comp_comparison-2346601-1.patch | 1.78 KB | rcodina |
continent_comparison.png | 100.22 KB | rcodina |
Comments
Comment #1
rcodina CreditAttribution: rcodina commentedI upload the patch, Please, test it.
Comment #2
rszrama CreditAttribution: rszrama commentedSorry, 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.
Comment #3
rcodina CreditAttribution: rcodina commentedI 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?
Comment #4
rszrama CreditAttribution: rszrama commentedNo, 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.
Comment #5
rcodina CreditAttribution: rcodina commented1) 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.
Comment #6
rszrama CreditAttribution: rszrama commentedNo, 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