Commit Graph

20408 Commits

Author SHA1 Message Date
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 53351fcc2f Update wc_product_attribute_uasort_comparison to accept null entries
When set_attributes is used on WC_Product to remove existing attributes
the wc_product_attribute_uasort_comparison ends up being called
with a null argument, and this breaks tests in PHP 7.4 since
null is used as an array. This commit modifies the function so that
if null is passed no array access is attempted.
2020-08-31 16:49:29 +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
Nestor Soriano 602f58a7a9 Add data migration to backfill missing attributes meta for variations.
The previous commit fixes a bug that causes the "attribute_" metadata
with an empty value to not be created when a new variation attribute
is added to the product (so that all variations have the attribute
with a value of "Any..."). This commit adds a data migration to
backfill the missing metadata for existing variations.
2020-08-28 09:38:16 +02: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
jonathansadowski 209ea6a8bb
Merge pull request #27448 from haydenw/fix-27436
Fix #27436
2020-08-25 09:18:07 -05:00
jonathansadowski 68d1641e5c
Merge pull request #27468 from woocommerce/fix/27467
Rename built-in PayPal payment method to PayPal Standard
2020-08-25 08:42:11 -05:00
Ron Rennick 41a7caae05
Merge pull request #27449 from haydenw/fix-27413
Fix #27413
2020-08-25 10:29:45 -03:00
Ron Rennick bdb1451f2b
Merge pull request #27441 from Rahmon/patch-1
Ensure that the return of get_the_terms is not a WP error
2020-08-25 10:13:45 -03:00
Brent Shepherd a2e2d63265 Rename PayPal to PayPal Standard
In the admin area, not the front-end of the site.

Fixes #27467
2020-08-25 12:25:44 +10:00
Hayden Whiteman 3fca3caf1d Fix #27413 2020-08-22 19:35:13 +12:00
Hayden Whiteman 201db0ca9e Fix #27436 2020-08-22 17:22:45 +12:00
Daniel Morell 252128026f
Fixed $columns type in docblock 2020-08-21 12:55:28 -05:00
Ramon 7610e1311e
Ensure that the return of get_the_terms is not a WP error 2020-08-21 14:07:26 -03:00
Claudio Sanches af357e9177 Updated priority of admin_body_class filter 2020-08-20 13:18:23 -03: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
Peter Fabian 14d5025cae
Merge pull request #27395 from woocommerce/fix/container-conflict
Removed internals of DI Container
2020-08-19 13:37:48 +02:00
Nestor Soriano c37771521a Remove call_function, call_static, get_instance_of from class-woocommerce.php 2020-08-19 12:08:54 +02:00
Vedanshu Jain 134875988f
Merge pull request #27396 from woocommerce/fix/4.4.0
Add protection to run adjust methods only if product query.
2020-08-19 15:28:04 +05:30
vedanshujain ae361ed06f Add protection to run adjust methods only if product query. 2020-08-19 13:31:57 +05:30
Christopher Allford 82df4b3303 Removed the contents of the WC() global container helpers 2020-08-18 20:45:34 -07:00
Jonathan Sadowski 6bafef2041 Foreign key check 2020-08-18 13:44:29 -05:00
Claudio Sanches 37291abc54 Added since tag in new filters introduced in 4.5 2020-08-17 18:01:41 -03:00
Claudio Sanches e102ec3d83 Merge branch 'master' into fix/25133 2020-08-17 14:59:49 -03:00
Claudio Sanches 5c4d42b9de
Merge pull request #27059 from masteradhoc/masteradhoc-postcode-liechtenstein
add postcode validation for country liechtenstein
2020-08-14 15:40:30 -03:00
jonathansadowski 4fd7f55357
Merge pull request #26928 from khosroblog/master
get_review_count_for_product return all comments count not only 'review' types !!!
2020-08-14 13:40:01 -05:00
Claudio Sanches fdf5fe8614
Merge pull request #27323 from woocommerce/fix/27288
switch to site locale before translating refund reason
2020-08-14 15:30:56 -03:00
Néstor Soriano f8ea11a607
Merge pull request #27145 from woocommerce/fix/26006
Fixed "virtual" and "downlodable" pointers on product walkthrough
2020-08-14 08:55:53 +02: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
Ron Rennick 38d358490b switch to site locale before translating refund reason 2020-08-13 10:32:19 -03:00
vedanshujain 4b1ebea800 Also allow null for date-time for BW 2020-08-13 16:49:44 +05:30
vedanshujain 3dd508fd35 Address review comments 2020-08-13 16:36:27 +05:30
vedanshujain a4691dc3f3 Set type to mixed to be compatible with 5.4.
This prop was missed in an earlier commit.
2020-08-13 15:47:18 +05:30
vedanshujain 5c0be2a715 Give preference to null data-type over others 2020-08-13 14:17:48 +05:30
vedanshujain 147c9baf4f Change `mixed` data type to composite for compatibility with 5.5 2020-08-13 13:30:39 +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 070e3896cf Restored pointers position 2020-08-12 21:46:36 -03:00
jonathansadowski 0125eca73c
Merge pull request #27244 from jgreys/fix/27108
Fix Japan zip code format issue #27108
2020-08-12 16:56:48 -05: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
vedanshujain 083e529668 Revert "Fix compatibility for WP 5.5"
This reverts commit cc96f6bbd1.
2020-08-12 19:31:40 +05:30
Claudio Sanches 6f6a84199f
Merge branch 'master' into fix/26006 2020-08-11 20:17:31 -03:00
Claudio Sanches df4aa12f21 Fixed coding standards to make trigger a test on Travis 2020-08-11 20:11:07 -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 8a1b8d6a3d
Merge pull request #26439 from kevinruscoe/add-additional-stock-cart-filter-messages
Add additional cart filters for stock actions
2020-08-10 16:34:24 -03: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
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 def2ef499c Master is 4.5.0 now 2020-08-07 12:55:51 -03:00
Néstor Soriano 459dd3fbf2
Merge pull request #27251 from woocommerce/fix/27226
Added woocommerce_order_item_quantity filter to ReserveStock::reserve_stock_for_order
2020-08-07 16:11:43 +02: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