Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Countries, currencies and regions infrastructure update #1865

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JeffPyeBrook
Copy link
Contributor

Update countries, regions and currencies to be PHP code based rather than from the database.

  • Allows internationalization of country, region and currency information
  • Fully backwards compatible with
  • Eliminates a significant amount of data being read from the database at startup
  • Removes several hundred lines of code from what we have to maintain
  • also improves speed and lowers memory footprint

This early PR is being made available so that the peer review can start now while work is being completed

…than from the database.

Allows internationalization of country, region and currency information
Eliminates a significant amount of data being read from the database at startup
Removes several hundred lines of code from what we have to maintain
and also improves speed and lowers memory footprint
@JeffPyeBrook
Copy link
Contributor Author

Items in progress

  • Integration testing
  • Comparison and data management routine to pick up changes to core country data ( visibility already works )
  • Additional filters for plugin integrators

@JeffPyeBrook
Copy link
Contributor Author

@leewillis77 @JustinSainton this is working in my test environment, i'll keep working on it, but it is reviewable in its current state

@@ -0,0 +1,193 @@
<?php
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JustinSainton @leewillis77 I would like this file to contain our outward facing procedural api for countries/regions/currency operations. Dev's certainly can go right at the class interface for the WPSC_Countries class, but that class has a fair amount of complexity because of some backwards compatibility requirements.

For most simple operations that a plugin or theme might want to do this file seem to be the API we should promote, in combinatiuon with the WPSC_Country and WPSC_Region objects that the functions within the file return

Use documented API function for countires operation rather than static class method
* */
function wpec_taxes_get_country_information( $columns = false, $where = array(), $order_by = false ) {
//check for all-markets
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JustinSainton this removal needs to be reviewed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me.

@JustinSainton
Copy link
Member

I'd like to see this in 4.0. Are all unit tests still passing and is this merge-ready?


/* Get country name and symbol */
$currency_type = get_option( 'currency_type' );
$country = new WPSC_Country( $currency_type );
$country = wpsc_get_currency_type_country_object();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a massive fan of ending function names in data types, e.g. WPSC_Countries::get_countries_array() or this, wpsc_get_currency_type_country_object(). Seems to me it'd be better to just be wpsc_get_currency_type_country?

JustinSainton added a commit that referenced this pull request Jun 14, 2015
* Adds price, title, image, description, currency metadata.
* There is ample opportunity for additional data for themes/plugins.
* We added a currency code function to the product helper file. This will likely move if and when #1865 lands.

Fixes #59
@JustinSainton JustinSainton modified the milestones: 4.1, 4.0 Jul 2, 2015
@JustinSainton
Copy link
Member

@JeffPyeBrook What's your bandwidth like for this for the 4.1 cycle?

@JeffPyeBrook
Copy link
Contributor Author

i'm around

@JustinSainton
Copy link
Member

Yay! What's your sense on the ETA for the work here?

@JeffPyeBrook
Copy link
Contributor Author

i'll have to take a look and see what is left to be done, my vague recollection was that it was substantially done. i would guess that the code is in some of my production configurations and has been for a while?

@JustinSainton
Copy link
Member

@JeffPyeBrook Let me know if you have an ETA on this - if we can get all the unit tests passing, comments addressed, and PR rebased, it would be great to get this in 4.0.

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

Successfully merging this pull request may close these issues.

2 participants