Commit Graph

2638 Commits

Author SHA1 Message Date
jonathansadowski 168698cd91
Merge pull request #27589 from woocommerce/enhance-query-for-filtering-attributes-with-any-value
Enhance the query for "Any" variations in filter by attribute widget
2020-09-08 11:58:54 -05:00
Christopher Allford 39c5bc6b74 Refactored the factory to use a repository instead of an adapter so that we can expose more API functionality 2020-09-07 16:00:27 -07:00
Christopher Allford a875ecb083 Refactored the HTTP layer to be more API-agnostic
Since we're going to be adding more services and CRUD actions it makes sense for our HTTP services to be less tied to the specific REST API implementation.
2020-09-04 11:27:34 -07:00
Julia Amosova e224cd4b1b Update how disablement of the extensions download is handled in OBW test 2020-09-04 11:47:02 -04:00
Nestor Soriano 43642f7835 Enhance the query for "Any" variations in filter by attribute widget.
The new query fixes a bug where variations were being counted twice:
if a product was included in both the queries then it would be counted
differently and added; e.g. when a product had two variations,
one with "Any" attribute and other with a attribute that has a value.

The new query also optimizes performance, so that filter conditions
can be improved and better indexes can be used.
2020-09-04 11:29:50 +02:00
Julia Amosova 4ca4f37969 Update recommended business features checkbox selector in OBW test 2020-09-03 16:23:19 -04:00
Christopher Allford c75f0f8886 Renamed the `@woocommerce/factories` package to `@woocommerce/api`
With the plan now to add more CRUD actions the scope of the package has transformed into a more general API package than one just for factories.
2020-09-03 12:28:17 -07:00
Julia Amosova 552545c0ac Update number of industries in the loop from 10 to 9 2020-09-03 13:17:47 -04:00
jonathansadowski ecb25d7dc8
Merge pull request #27572 from woocommerce/update/bump-wc-admin-to-1.5.0-rc.4
Bump WooCommerce Admin to 1.5.0-rc.4; WooCommerce to 4.5.0-rc.3
2020-09-02 19:21:52 -05:00
Christopher Allford c898e1de03 Fixed failing E2E test 2020-09-02 16:14:25 -07:00
Christopher Allford f5771ebd0a Fixed failing E2E test 2020-09-02 16:13:20 -07:00
Christopher Allford b9d314e1ae Fixed another E2E test 2020-09-02 15:47:15 -07:00
Christopher Allford dde64b964f Updated lock files & fixed failing E2E test 2020-09-02 14:50:08 -07:00
Christopher Allford d3162b2f1d Updated package-lock.json files 2020-09-02 14:39:49 -07:00
Christopher Allford aee44c2935 Merge remote-tracking branch 'origin/master' into add/e2e-feedback-blockers 2020-09-02 12:47:40 -07:00
Christopher Allford 16cf8c81be Revised the default environment variables to pull the version from the latest docker image 2020-09-02 12:47:27 -07:00
jonathansadowski 53c22ba4e4
Merge pull request #27508 from woocommerce/fix/27419
Fix filter by attribute widget now working for "Any..." attributes
2020-09-02 13:32:54 -05:00
Nestor Soriano 07b62dabbd Improve the query to retrieve "Any..."-attributed variations in filtering widget
The new query doesn't need empty attribute entries in the meta table,
therefore the code that generates them and the migration to backfill
the missing existing ones have been removed.
2020-09-01 16:47:41 +02:00
Nestor Soriano 3a583feab1 Change filter by attributes widget to count products, not variations.
Right now the filter by attributes widget counts available variations
(for variation products). This is confusing since the counter shows
numbers that are higher than the actual count of products displayed.

This commit changes the query used by the widget so that instead
of counting variations it returns the parent product ids, and then
counts the distinct values. This also covers the case of products
where some of the variations have concrete values and some have
"Any..." values.
2020-08-31 12:22:33 +02:00
Ron Rennick 0b85ee58f8 update package-lock.json 2020-08-28 11:06:25 -03:00
Ron Rennick 17ee223e71 update package-lock.json 2020-08-28 11:03:28 -03:00
Ron Rennick 8fe3bcb90e rebase to current master 2020-08-28 10:59:43 -03:00
Claudio Sanches 085b4b53fa
Merge pull request #27487 from woocommerce/update/choice-of-words
Improve choice of words
2020-08-27 19:30:54 -03:00
Nestor Soriano 1113201f8b Update meta 'attribute_' values when variation attributes are added or removed.
When a new variation attribute is added, the corresponding 'attribute_'
meta entries are added for all variations with an empty value;
and when an existing variation attribute is removed, the existing
'attribute_' meta entries are deleted for all variations.

This is necessary for the filter by attribute widget to work properly
when variations exist with a value of "Any..." for attributes.
2020-08-27 16:10:41 +02:00
Nestor Soriano a75da34a45 Fix filter by attribute widget now working for "Any..." attributes
When a variation product has an attribute with a value of "Any...",
and there's a filter by attribute widget for that attribute, then
that product won't be included in the counts displayed in the widget
(and if the count ends up being zero, the attribute won't be shown
in the widget).

This happens before since Woo 4.4, this widget works by looking at
entries in the term relationships table for varitions too
(used to do so for simple products and for "main" variable products
only), see PR #26260; but there are no such entries for
"Any..." attributes.

This commit fixes that by extending the SQL query used by the widget
to look for variations that have empty attribute values in the meta
table too.
2020-08-27 10:59:15 +02:00
Claudio Sanches c4ccc38780 Fixed use __DIR__ for relative paths 2020-08-26 18:46:44 -03:00
Claudio Sanches 5240682f38 Improve choice of words 2020-08-25 18:03:03 -03:00
Claudio Sanches a133e56ebd Fixed unit tests 2020-08-25 16:13:49 -03:00
Ron Rennick 81dae70033 phpcs fixes 2020-08-25 15:41:31 -03:00
Ron Rennick de79f1a3cd update unit tests for included Paypal gate name change 2020-08-25 15:36:50 -03:00
Ron Rennick 074b2b86c6 update package-lock.json 2020-08-21 13:39:33 -03:00
Ron Rennick 7a14368982 add small tweaks/checks for edge cases 2020-08-21 13:25:30 -03:00
Tam Mullen b41bd5139d Updating e2e test for OBW changes 2020-08-21 16:03:02 +01:00
Ron Rennick 51afe3207a
Merge pull request #27023 from HikeMike/add/hidden-form-field
"Hidden" field type added to woocommerce_form_field() #26468
2020-08-20 11:48:26 -03:00
Claudio Sanches 47aaac8600 Introduced wc_asort_by_locale() function 2020-08-19 20:22:18 -03:00
Claudio Sanches b5221ab479 Added unit tests for changes in wc_ascii_uasort_comparison 2020-08-19 19:00:18 -03:00
Claudio Sanches 98d5f52de2 Merge branch 'master' into add/woorelease-support 2020-08-19 12:10:15 -03:00
Ron Rennick dfdf4e9d18 update e2e config parsing to support no port 2020-08-19 09:57:14 -03:00
Christopher Allford 358db5dc3e Removed the internals of the Container pending package conflict resolution
Since reverting the PR at this point would be a mess I've gone ahead and removed the internals of the container. We should aim to keep the class since it's now part of our public API but it won't work as expected anymore. This is fine for now since we don't actually have anything in it!
2020-08-18 20:39:48 -07:00
Claudio Sanches 9773675b8d Merge branch 'master' into add/woorelease-support 2020-08-18 17:59:47 -03:00
Claudio Sanches e102ec3d83 Merge branch 'master' into fix/25133 2020-08-17 14:59:49 -03:00
Néstor Soriano f1ed7005f9
Merge pull request #26232 from woocommerce/update/e2e-test-utils
Update/e2e test utils
2020-08-17 15:26:13 +02:00
Claudio Sanches bb0c4406de
Merge pull request #27314 from woocommerce/add/unit-tests-27108
Added unit tests for #27244
2020-08-14 15:32:02 -03:00
Ron Rennick 45391c4b18 update unit test for account page being automatically created 2020-08-14 10:36:16 -03:00
Ron Rennick f0ad8a01be merge current master 2020-08-13 14:33:07 -03:00
Vedanshu Jain a887cd7369
Merge pull request #27318 from woocommerce/fix/27282
Change data-type from mixed to composite and date-time to string on the fly for REST API
2020-08-13 21:25:11 +05:30
vedanshujain 7fa6510c1a Add a explicit test for null as well 2020-08-13 16:52:16 +05:30
vedanshujain dd9b9cfae2 Add test for update in date-time field 2020-08-13 16:32:00 +05:30
vedanshujain 4294e06f7a Add test for variation v2 controller for complex meta object 2020-08-13 15:46:31 +05:30
vedanshujain 9f680aa120 Add test for null meta value as well 2020-08-13 14:17:28 +05:30
vedanshujain 826fdde721 Add unit tests for checking that updating complex meta is possible 2020-08-13 13:27:00 +05:30
Néstor Soriano 4c636b1d5c
Merge pull request #27303 from woocommerce/fix/travis-coding-standards-test
Fix coding standards test on Travis
2020-08-13 09:19:13 +02:00
Claudio Sanches 1839feae91 Added unit tests for #27244 2020-08-12 18:50:25 -03:00
Christopher Allford 7340c9af44
Merge pull request #27171 from woocommerce/fix/25543
Added the parent's SKU to product searches for variations
2020-08-12 12:58:00 -07:00
Claudio Sanches 1699b34295 Use npm run build:core 2020-08-12 16:53:06 -03:00
Christopher Allford 7071c6dc0c
Merge pull request #27228 from woocommerce/feature/container-injection-change
Dependency Injection should use method injection instead of constructor injection
2020-08-12 12:41:48 -07:00
Claudio Sanches 521ad8c3ff Update all dependencies of woocommerce-sniffs 2020-08-11 20:42:42 -03:00
Claudio Sanches 7fdf209713 Check if PHPCS is installed before trying to install a new copy 2020-08-11 20:08:28 -03:00
Claudio Sanches 29bc98816e
Merge pull request #27143 from woocommerce/fix/26876
Fix "Hide shipping costs until an address is entered"
2020-08-11 20:06:17 -03:00
Ron Rennick 4ba2e0267f remove unused local test-e2e.json 2020-08-11 09:53:34 -03:00
Tam Mullen 9ad9ff2df8 Fixing import path 2020-08-11 12:26:53 +01:00
Tam Mullen c8365213c3 Fixing import path. 2020-08-11 00:34:57 +01:00
Tam Mullen ed525087ac Addressing comments. 2020-08-10 21:27:20 +01:00
Tam Mullen b2262f1cf7 Updating exports for completeOnboardingWizard function. 2020-08-10 21:26:11 +01:00
Tam Mullen 2bc918d353 Updating e2e-utils formatting. 2020-08-10 21:26:10 +01:00
Tam Mullen cdaefa332e Updating e2e-utils formatting. 2020-08-10 21:26:10 +01:00
Tam Mullen 4544190462 Updating e2e-utils dependencies. 2020-08-10 21:26:10 +01:00
Tam Mullen ead4b93a7d Adding e2e-utils README 2020-08-10 21:26:10 +01:00
Tam Mullen da1916c663 Updating product test dependencies 2020-08-10 21:26:10 +01:00
Tam Mullen 43c55e2c6a Converting e2e-utils to package. 2020-08-10 21:26:10 +01:00
Ron Rennick 0b0595ab4c
Merge pull request #27048 from vallter2/postcode-bih
Add postcode validation for Bosnia and Herzegovina
2020-08-10 16:24:06 -03:00
Ron Rennick c14ce54752 fix e2e docker:ssh command to work in any repo 2020-08-10 14:54:10 -03:00
Christopher Allford 116e11565a
Merge pull request #27262 from woocommerce/fix/unit-tests-coding-standards
Fixed packages required to run code sniffer on unit tests
2020-08-10 06:57:05 -07:00
Christopher Allford 12397aec0e Added `_with` suffix to `StringUtil` methods for clarity 2020-08-07 16:45:35 -07:00
Christopher Allford 13a3b80cb6 Removed classes accidentally added back by merge from master 2020-08-07 16:45:09 -07:00
Christopher Allford eb65252ba8 Merge branch 'master' into feature/container-injection-change 2020-08-07 14:35:44 -07:00
Christopher Allford 081f0d9133 Settled on an injection method of `init`
1. Since our code style dictates that these be `final` methods, we shouldn't be concerned about overlap.
2. There is precedent for `init` methods as requirements before using class instances.
2020-08-07 14:28:29 -07:00
Claudio Sanches 02cf0dfaed
Merge pull request #27239 from woocommerce/fix/package-tag
Fix usage of "package" tag in file headers
2020-08-07 13:37:24 -03:00
Claudio Sanches 17f9883f00 Changed | to \ 2020-08-07 13:36:41 -03:00
Claudio Sanches 48732ee0dd Fixed package tag 2020-08-07 13:35:15 -03:00
Claudio Sanches 3fd42a0fd5 Fixed packages required to run code sniffer on unit tests 2020-08-07 13:28:41 -03:00
Ron Rennick 6aa52c8499 remove duplicate readme text 2020-08-07 13:04:36 -03:00
Ron Rennick db76c8ac2d merge package config with factories changes 2020-08-07 10:53:51 -03:00
Néstor Soriano 76cf1e4e93
Merge pull request #27140 from woocommerce/fix/23790
Always sanitize coupon code to prevent inconsistent between admins and shop owners
2020-08-07 12:42:02 +02:00
Néstor Soriano a13a0d2187
Merge pull request #27179 from woocommerce/fix/26741
Release coupon holds when status it updated to cancelled regardless of recorded coupons
2020-08-07 11:27:45 +02:00
Christopher Allford 154c812fc0 Renamed the `StringUtility` to `StringUtil` to make it easier to work with 2020-08-06 12:35:51 -07:00
Claudio Sanches 9eae43c0d4
Merge pull request #27240 from woocommerce/dependabot/npm_and_yarn/tests/e2e/factories/lodash-4.17.19
Bump lodash from 4.17.15 to 4.17.19 in /tests/e2e/factories
2020-08-06 15:50:26 -03:00
vedanshujain 2f76e52fa7 Skip test for < 5.3 as feature is not supported. 2020-08-06 14:34:02 +05:30
vedanshujain 55a9687e6d Make api included structure more linear. 2020-08-06 14:34:02 +05:30
vedanshujain cfe357cfb2 Fix UT to add predefined values to run tests in isolation. 2020-08-06 14:34:02 +05:30
vedanshujain 222852dea6 Merge branch 'master' of https://github.com/woocommerce/woocommerce 2020-08-06 14:06:29 +05:30
Christopher Allford 39376abfd2 Added a requirement that `container_init` methods be marked `final` when registering using reflection 2020-08-05 22:34:00 -07:00
Christopher Allford ff6e30f1c1 Renamed `set_internal_dependencies` to `container_init` 2020-08-05 22:20:13 -07:00
Christopher Allford cbbfed4989 Replaced the rest of the constructor injection references 2020-08-05 21:28:06 -07:00
dependabot[bot] 089df498d3
Bump lodash from 4.17.15 to 4.17.19 in /tests/e2e/factories
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-05 23:04:18 +00:00
Christopher Allford 8e8698a3f6 Fixed test that used PHPUnit function from newer version 2020-08-05 15:43:08 -07:00
Christopher Allford 678705cdd4 Merge branch 'master' into package/e2e-factories/product 2020-08-05 14:00:05 -07:00
Ron Rennick 0ca4ce27c5 update e2e readmes 2020-08-05 16:58:38 -03:00
Ron Rennick 7f04d800e9 keep browser reset at end of setup 2020-08-05 15:01:43 -03:00
Claudio Sanches 3632714885 Removed package tag from src 2020-08-05 14:23:50 -03:00
Claudio Sanches a50552af75 Use only WooCommerce as package name 2020-08-05 14:11:20 -03:00
Claudio Sanches d48f1d4e2e Fixed package tag usage 2020-08-05 13:36:24 -03:00
Ron Rennick 7799c1bcf0 merge master 2020-08-05 10:33:16 -03:00
Tam Mullen 5a410c02a6 Fix e2e OBW test to not untick physical products in product type list 2020-08-05 12:49:42 +01:00
Christopher Allford d178c7ff01 Replaced constructor injection with method injection
Since we need to maintain backwards compatibility for class constructors we should settle on using method injection instead of constructor injection. I've replaced the `Definition` class we're using with one that doesn't support constructor arguments and added a check for auto_arg addition. Note that we don't check for method existence in the extended container. This is because reflection is unnecessarily expensive and we should avoid it if at all possible.
2020-08-04 20:37:28 -07:00
Ron Rennick 52d67cead1 move trash posts/products from sequencer to local config 2020-08-04 19:55:13 -03:00
Ron Rennick 14c9154fcb use consistent MySQL configuration values 2020-08-04 16:17:00 -03:00
vedanshujain 1ada7d8b26 Merge branch 'master' of https://github.com/woocommerce/woocommerce 2020-08-04 18:22:41 +05:30
Nestor Soriano 200599f8e0 Add unit tests for the type of the value returned by 'get_available_variations' 2020-08-03 16:30:54 +02:00
Nestor Soriano 71fccd6a07 Fix: pagination controls not displaying in products list.
This bug was introduced in #26260. The sequence is:

1. WC_Query::adjust_posts_count runs, to handle found_posts filter,
   this indirectly executes wc_setup_loop.
2. At this point $GLOBALS['wp_query']->max_num_pages hasn't been set
   yet, and has a value of 0. Thus the loop variable total_pages
   is set to 0.
3. Later wc_setup_loop runs again and this time
   $GLOBALS['wp_query']->max_num_pages is already set, but since
   the loop variable total_pages already exists, it keeps its
   value of 0.
4. The pagination controls never show if total_pages is less than 2.

The fix consists of hooking into the_posts to set the value of
total_pages again, at that point $GLOBALS['wp_query']->max_num_pages
is already set.
2020-07-31 16:40:25 +02:00
Claudio Sanches 825d57dd41 Merge branch 'master' into fix/23790 2020-07-30 17:33:50 -03:00
Claudio Sanches 48974f29f1 Fixed unit tests for WC_Notes_Run_Db_Update 2020-07-30 17:00:11 -03:00
Claudio Sanches 1cd84d6446 Merge branch 'master' into fix/23790 2020-07-30 16:46:01 -03:00
Claudio Sanches 608fc8620d
Merge pull request #27172 from woocommerce/fix/27168
Let user stay in the same page after clicking to update WooCommerce
2020-07-30 15:48:27 -03:00
Jonathan Sadowski 163e10253a Release coupon holds when status it updated to cancelled regardless of recorded coupons 2020-07-30 10:35:23 -05:00
Néstor Soriano e44154bf6e
Update tests/legacy/unit-tests/util/class-wc-tests-wc-query.php
Fix small coding standards issue.

Co-authored-by: Claudio Sanches <contato@claudiosanches.com>
2020-07-30 16:17:05 +02:00
vedanshujain 3a63d75e0f Merge branch 'master' of https://github.com/woocommerce/woocommerce 2020-07-30 17:55:11 +05:30
Nestor Soriano 86c88f1750 Fix: incorrect adjustment of post count in WC_Query.
PR #26260 introduced a handler for 'found_posts' filter in WC_Query
class in order to adjust the count depending on the visibility
of variation products. However the handler incorrectly assumed
that the filter was triggered only when listing products, when
actually it's also triggered for any post type e.g. pages.
In these cases the post count was set to zero, which caused bugs.

Now the handler starts with the originally supplied posts count,
and only decrements it when a post is a product AND is not visible.
2020-07-30 09:32:28 +02:00
Claudio Sanches 3c1132e274 Added unit tests for wc_get_current_admin_url() 2020-07-29 21:02:52 -03:00
Christopher Allford 78bff3b2da Added the parent's SKU to product searches for variations
Since the parent's SKU is used when the variation does not have one, we should fall back when searching for consistency.
2020-07-29 16:53:36 -07:00
Ron Rennick ba942aa32f expose getAppRoot, getTestConfig in package 2020-07-29 20:03:29 -03:00
Ron Rennick 09a594443d restore non-dev puppeteer config, move test config to sequencer 2020-07-29 18:57:59 -03:00
Ron Rennick d4620b5351 merge master 2020-07-29 15:25:11 -03:00
Ron Rennick 1e365733b4 add local puppeteer config support 2020-07-29 15:13:22 -03:00
Néstor Soriano 0f134ca6a2
Merge pull request #27054 from woocommerce/fix/27036
add/update correct deprecated notices on existing deprecations
2020-07-29 15:20:24 +02:00
Ron Rennick d9e9faaa44 use @automattic/puppeteer-utils 2020-07-28 16:29:19 -03:00
Claudio Sanches 119b5d6568
Merge branch 'master' into fix/23790 2020-07-28 13:07:17 -03:00
Ron Rennick e78beaf569 move jest/puppeteer related packages to environment package 2020-07-28 12:00:46 -03:00
Nestor Soriano 681401850a Adjustments in the items count calculation on the nav filtering widget.
The calculations are now consistent with the change made to the
visibility of the variable products when using one or multiple filters.
2020-07-28 09:01:55 +02:00
Nestor Soriano 29843b9396 Change in the logic of is_visible_core for variable products
Now, if there are filters present the logic is as follows:

- For multiple filtering values of the same attribute:
  the product is visible if there's at least one variation
  that has one of the filtering values associated to the attribute,
  or if there's at least one variation having the attribute
  with a value of "Any".

- For filtering by more than one attribute:
  the product is visible if there's at least one variation that
  is visible for ALL the attributes according to the above rule.

Note that this is irrespective of the type of logic configured for
the filter (OR or AND).
2020-07-28 09:01:52 +02:00
Nestor Soriano 3fefe84a51 Fix: WC_Query()::adjust_posts_count failing when posts list is null. 2020-07-28 08:55:55 +02:00
Nestor Soriano 9142e27a19 Adjustments in WC_Query::adjust_posts_count
Two adjustments were needed:

- Adjust the count even when there's no nav filtering in the query.
  This is necessary to present the proper products count.
  even when the woocommerce_product_is_visible filter is used.
- Account for the case where $GLOBALS['wp_query']->posts
  returns objects instead of ids (for example when viewing
  a product page).
2020-07-28 08:55:55 +02:00
Nestor Soriano 9de1306c21 Fix counters in nav filtering widgets for variable products.
After the change that registers variation attributes as terms
(in addition to reigstering them as post meta) it is now time
to modify the get_filtered_term_product_counts methods in
WC_Widget_Layered_Nav so that it works consistently for both
variable and non-variable products. The logic for the counters
is now as follows:

with OR operator:
- Simple products: count the attributes of all visible products
  (unchanged behavior).
- Variable products: count attributes corresponding to
  visible variations.

with AND operator:
- Simple products: count the attributes of visible products but only
  for products that have all the selected (unchanged behavior).
- Variable products: find all the products for which all the variations
  corresponding to the selected attributes exist and are visible,
  then count the attributes corresponding to the visible variations
  of those products.

A product is "visible" if it's published, not excluded for catalog,
and has stock. Additionally, a variable product will not be considered
visible if the parent product is not.
2020-07-28 08:55:55 +02:00
Nestor Soriano 9c6c0d73d8 Record attribute terms for product variations in wp_term_relationships.
Product attributes are currently recorded as terms in
wp_term_relationships (product attributes are actually taxonomies).
In the case of variable products this is true for the main product,
but not for the variations. The attributes used to define variations
are stored as post meta, but nothing is recorded in the term
relationships table.

This is a problem when using the layered nav filtering plugin,
since the attribute counters displayed are calculated based solely
on the contents of the term relationships table. Adding meta queries
would be really messy (especially when the widget is configured
with AND operator) and would probably also hurt performance.

This commit adds a change to store the attributes for variations
as term relationships, additionally to storing them as post meta.
Terms are stored on variation creation, and updated/deleted together
with the variation as appropriate. "Any" variations (stored in meta
as empty values) are not stored as terms.

Additionally, a database upgrade is included in order to backfill
terms for already existing products.
2020-07-28 08:55:55 +02:00
Nestor Soriano e1265bfa25 Refactor WC_Helper_Product by extracting duplicated code to methods.
The new methods are create_product_variation_object and
create_product_attribute_object, they are public.
2020-07-28 08:55:55 +02:00
Nestor Soriano 50e8f27bc7 Fix visibility of variable products with layered nav filtering.
The layered nav filtering doesn't work well with variable products
when some variations have stock and other don't. When a term is
selected in the widget, a variable product having no stock for
the variation corresponding to that term but having stock for
other variations will be displayed, but it shouldn't.

This commit fixes that by introducing two changes:

- A new override of "is_visible" for WC_Product_Variable that
  looks at the supplied filters, compares them against the corresponding
  available variations and calculates the visibility based on
  the query type (OR or AND).

- A hook on the "found_posts" filter in WC_Query, that adjusts
  the posts count based on the found products visibility
  when there are filters available; this is needed to sync the
  "displaying X posts" messages and the paging when variable
  products are hidden due to stock status.

Additionally, the visibility calculated in "found_posts" is cached
as loop variables so that it isn't calculated again when actually
displaying the products.
2020-07-28 08:55:52 +02:00
Nestor Soriano c27283dffe Fix code sniffer errors in some files.
Fixed files:

includes/abstracts/abstract-wc-product.php
includes/class-wc-query.php
includes/wc-template-functions.php
includes/widgets/class-wc-widget-layered-nav.php
templates/loop/result-count.php
tests/unit-tests/util/class-wc-tests-wc-query.php
2020-07-28 08:47:29 +02:00
Christopher Allford 578b205b4e
Merge pull request #27123 from woocommerce/feature/jetpack-autoloader-upgrade
Upgraded Jetpack Autoloader to 2.0
2020-07-27 23:35:53 -07:00
Claudio Sanches de383971eb Reset all after test 2020-07-27 22:07:46 -03:00
Claudio Sanches 2043954ceb
Fixed class name 2020-07-27 21:53:28 -03:00
Claudio Sanches 0f091406df Test WC_Cart::show_shipping() 2020-07-27 21:52:33 -03:00
Christopher Allford 1868cd8aaa Adjusting the shipping task order in the E2E test for setup tasks 2020-07-27 15:18:27 -07:00
Christopher Allford edf1932ee9 Adjusted the OBW test for changes in WC-Admin 1.4.0 2020-07-27 14:38:43 -07:00
Claudio Sanches 4048d19a39 Added unit tests for coupon code sanitization 2020-07-27 17:44:04 -03:00
Christopher Allford ddc1f87f8d
Update README.md
Changed `npm install` suggestion to better suggest saving the dependencies as devDependencies
2020-07-27 13:30:39 -07:00
Matt Harrison e696ac7824
Queue all webhooks on shutdown.
It is possible for a later duplicate webhook to be fired too early if
the same webhook triggers in one request more than once with the updated
changes from the second one missing if it happens too quickly.
This queues all webhook to be register on shutdown instead of just
syncronous ones to make sure all data from the request is updated first
before the webhook gets queued.
2020-07-27 12:11:40 -04:00
Nestor Soriano cc118c0c10 Fixed the number of product types in the onboarding E2E test 2020-07-27 16:49:32 +02:00
Christopher Allford 4123d048e0 Fixed the number of industries in the onboarding E2E test 2020-07-27 07:08:54 -07:00
Claudio Sanches 7bd34e3545
Merge branch 'master' into fix/25843 2020-07-24 17:04:28 -03:00
Ron Rennick aca91f587d update version script to work in both desktop and Travis, add fallback versions 2020-07-24 17:02:33 -03:00