Commit Graph

228 Commits

Author SHA1 Message Date
Ron Rennick 625857e9e1 add rating count to order by rating clause 2020-07-06 11:19:17 -03:00
Rodrigo Primo 62d6b05b58 Fix Generic.Formatting.MultipleStatementAlignment violations
This commit fixes all violations of the Generic.Formatting.MultipleStatementAlignment sniff automatically using phpcbf.
2019-12-20 14:21:08 -03:00
Rodrigo Primo f06ad5d78a Replace removed WordPress.Security.NonceVerification.NoNonceVerification
WordPress Coding Standard 2.0 removed the sniff
WordPress.Security.NonceVerification.NoNonceVerification:

```
The WordPress.Security.NonceVerification sniff used the same error code for both an error as well as a warning.
The old error code NoNonceVerification is no longer used.
The error now uses the Missing error code, while the warning now uses the Recommended error code.
```

(from
d45f5e5cf3/CHANGELOG.md (200-rc1---2018-12-31))

This commit updates WooCommerce code and replaces all instances where WordPress.Security.NonceVerification.NoNonceVerification verification was used with either WordPress.Security.NonceVerification.Missing or
WordPress.Security.NonceVerification.Recommended. In a few cases WordPress.Security.NonceVerification.NoNonceVerification was used but was not needed, so instead of replacing the sniff, the line was removed. In two other cases, I removed other unrelated sniffs that were not needed.
2019-12-13 17:45:32 -03:00
Nathan Dawson 4d25b058c1 Refine static homepage check to exclude blog archive queries. Fixes #24582 2019-09-24 23:41:57 +02:00
Claudio Sanches 15aa298585
Merge pull request #23159 from woocommerce/fix/23157
If orderby is used on static homepage, force query to be a page query
2019-05-22 21:17:01 -03:00
Mike Jolley 5c07e38641 Array handling 2019-04-23 11:53:07 +01:00
Mike Jolley 0a61912a31 If orderby is used on static homepage, force page 2019-03-27 16:38:18 +00:00
Mike Jolley 122eeda7ff Avoid step rounding on query 2019-03-07 13:01:45 +00:00
Mike Jolley e7bb5a8f41 Merge branch 'master' into experiment/product-sorting-index 2019-03-07 12:49:25 +00:00
Mike Jolley e1ff1bfae9 Update from master 2019-03-06 12:37:24 +00:00
Mike Jolley 3309276e82 Renamed table to wc_product_meta_lookup 2019-02-15 12:37:45 +00:00
Mike Jolley 7b6558e1df Correct table names and updater 2019-02-12 14:04:22 +00:00
Mike Jolley 95369b98a6 Price filter with new table 2019-02-11 15:45:30 +00:00
Mike Jolley fed9631a1e Rating and sales sorting on new table 2019-02-11 15:04:05 +00:00
Mike Jolley 47b37c7104 Queries 2019-02-11 14:42:54 +00:00
Ron Rennick e1213f8432 remove the WP main query check 2019-02-01 09:49:31 -04:00
Ron Rennick 9855a18036 phpcs sniff fixes for class-wc-query.php 2019-01-31 11:18:19 -04:00
Ron Rennick f5f020e6f4 add logic for $main_query parameter in get_meta_query 2019-01-31 11:15:14 -04:00
Mike Jolley b8e60e44c0 Handle tax in price filter specific query
Co-Authored-By: Gerhard Potgieter <kloon@users.noreply.github.com>
2019-01-23 19:39:46 +00:00
Mike Jolley ed95fe2cd3
Merge pull request #22066 from Prospress/fix/22065
add is_array check to catalog ordering orderby
2019-01-22 16:25:20 +00:00
Sabuj Kundu f329cb2d75
Add $orderby and $order params to filter woocommerce_get_catalog_ordering_args
Filter woocommerce_get_catalog_ordering_args  has only one single argument $args, anyone filter this needs to detect the $orderby and $order value again which is already coded in the method where this filter returns. I hope adding two extra param $orderby and $order will make developer's life easier to hook this filter.
2018-12-18 11:07:18 +06:00
Ron Rennick 3e014ffe62 add is_array check to catalog ordering orderby 2018-11-28 08:51:05 -04:00
Ron Rennick 64621c5b36 fix phpcs sniffs in class-wc-query.php 2018-11-28 08:50:25 -04:00
David Garcia Watkins d4484f3a4b The orderby=ID argument needs to be uppercase. 2018-09-27 19:51:10 +02:00
Rodrigo Primo f175e62286
Merge pull request #20549 from woocommerce/update/improve-layered-nav-performance
Improve WC_Query::get_layered_nav_chosen_attributes() performance
2018-06-25 09:35:21 -03:00
Rodrigo Primo c1960167f4 Fix: display products on sub-subcategories when sorting parent category by price
The algorithm to add a list of product categories to the query that order products of a given category by price was including only first level sub-categories since PR #20391. This was happening because `get_terms()` when called with the argument `parent` will only return direct children. To fix this and get all children for a given product category, it was necessary to replace `parent` with the argument `child_of`. See #20554 for a more detailed description of the issue that this commit fixes.
2018-06-19 15:47:43 -03:00
Rodrigo Primo 5f6b0df7b2 PHPCS fixes 2018-06-19 15:46:33 -03:00
Rodrigo Primo 7a7130c9d0 Improve WC_Query::get_layered_nav_chosen_attributes() performance
This commits improves the performance of the method WC_Query::get_layered_nav_chosen_attributes() when a site has a significant number of product attributes. Instead of looping over all existent product attributes to find which have been passed in the request, the new code loops over all the request parameters and checks which are valid product attributes.

On a test site with 2000 product attributes, the old version of WC_Query::get_layered_nav_chosen_attributes() was responsible for 25% of the shop page generation time. With the new version, the amount that this method contributes to the page generation time is negligible.

Related #20262
2018-06-15 14:39:56 -03:00
Rodrigo Primo 35d5bf31dd phpcs fixes 2018-06-15 14:26:47 -03:00
Mike Jolley f356269e6f
Merge pull request #20391 from smazur/master
fix order by price clauses when search within terms
2018-06-05 13:52:30 +01:00
Mike Jolley f065580b24
align 2018-06-05 13:51:37 +01:00
Stanislav Mazur 6fdd71ce8f fix order by price clauses when search within terms 2018-06-05 14:01:08 +03:00
Mike Jolley 5172694a3a
Merge pull request #19477 from woocommerce/fix/infinite-scroll
Infinite scroll compatibility
2018-04-05 10:46:44 +01:00
Rodrigo Primo a02b77bedc Use minimum price to order variable products on term archives
Commit 12d7bf7 added a specific query to order products by price from low to high on term archives (see #17690 and #16694 for more details), but, probably due to a copy and paste error, it changed the behavior when dealing with variable products. Instead of using the smallest variation price of each variable product, it was using the highest variation price. This commit changes this new query to use the smallest variation price of each variable product. This way ordering by price from low to high on term archives will again behave in the same way that on the shop page when dealing with variable products.
2018-03-23 16:15:37 -03:00
claudiulodro 62d88892bf Check query var for orderby 2018-03-23 08:30:02 -07:00
Mike Jolley a826d4d91f Better method of removing product query after it runs. 2018-03-21 17:41:14 +00:00
Mike Jolley b037c965cb Set default order if empty 2018-03-21 17:24:00 +00:00
Mike Jolley 9c42735386 temp fix; comment out lines 2018-03-21 16:41:22 +00:00
Claudio Sanches cf06e58906 Fixed includes/class-wc-query.php PHPCS violations 2018-03-21 00:13:22 -03:00
Mike Jolley 2ed9691c14 Fix shop on homepage with unsupported themes 2018-02-01 11:15:46 +00:00
Caleb Burks 2b4a756438 Update docs. 2017-12-25 02:16:10 -06:00
Claudiu Lodromanean 204a990976
Merge pull request #18173 from woocommerce/fix/18168
Add ID orderby fallback for when prices are the same across multiple products.
2017-12-14 09:16:37 -08:00
Mike Jolley 1df3af081c Add ID orderby fallback for when prices are the same across multiple products. 2017-12-14 14:17:20 +00:00
Shiva Poudel 3353505be5 Tweak - Duplicate relevance orderby for catalog 2017-12-14 15:37:12 +05:45
Mike Jolley 8dcffa660e Normalise get_query_results names and add new param for pagination 2017-12-06 13:13:43 +00:00
claudiulodro d60456cc73 Resolve conflicts and bring up to date with master 2017-12-04 13:56:59 -08:00
Gerhard Potgieter f1479b07d5 Exclude add-to-cart param from get_pagenum_link function. paginate_links calls this function even though we pass a base url to it. 2017-11-29 10:52:55 +02:00
Claudio Sanches 9681a331e9 Fixed coding standards 2017-11-20 20:19:09 -02:00
Claudio Sanches 5a858eb2b1 Use WC_Query->get_query_vars() instead of WC_Query->query_vars
Closes #17733
2017-11-20 14:40:56 -02:00
Mike Jolley e9bbb3a10f phpcs 2017-11-15 10:21:38 +00:00