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

wpsc_get_terms_category_sort_filter() produces many request if you have a lot of terms. #1389

Closed
benhuson opened this Issue Jun 3, 2014 · 4 comments

Comments

Projects
None yet
3 participants
@benhuson
Copy link
Member

commented Jun 3, 2014

The offending line is 46 in https://github.com/wp-e-commerce/WP-e-Commerce/blob/8e0a4dbe5b470bf959d838afa9ac5ba4cc50a16f/wpsc-includes/category.functions.php:

$term_order = ( $term->taxonomy == 'wpsc_product_category' ) ? wpsc_get_meta( $term->term_id, 'sort_order', 'wpsc_category' ) : null;

This gets meta for each term as they are looped through.

It might be better if we able to get all meta values from an array of terms in one query perhaps so they are cached, rather than many requests?

@JeffPyeBrook

This comment has been minimized.

Copy link
Contributor

commented Jun 3, 2014

Might be better to turn on the caching for the wpsc_get_meta and related calls?

@JustinSainton

This comment has been minimized.

Copy link
Member

commented Sep 21, 2014

I like your approach, @benhuson. Happy to take a PR for that.

@JustinSainton JustinSainton added this to the 3.9.0 milestone Sep 21, 2014

@JustinSainton JustinSainton changed the title wpsc_get_terms_category_sort_filter() prodcues many request if you have a lot of terms. wpsc_get_terms_category_sort_filter() produces many request if you have a lot of terms. Oct 15, 2014

@JustinSainton JustinSainton modified the milestones: 4.0, 3.9.0 Oct 15, 2014

@JustinSainton

This comment has been minimized.

Copy link
Member

commented Jun 12, 2015

Related: #1894

@JustinSainton JustinSainton modified the milestones: 4.1, 4.0 Jun 12, 2015

@benhuson

This comment has been minimized.

Copy link
Member Author

commented Jun 18, 2015

So, now we should be able to resolve this using the new wpsc_update_meta_cache(),

See Country meta for an example:
845e287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.