Commit Graph

37557 Commits

Author SHA1 Message Date
Shiki ac4cba3fab Orders API: Fix regression in `meta_data` `display_*` values
Previously, we were using the `$formatted_meta_data` to build the final array.
However, this does not consider the fact that
`WC_Order_Item->get_formatted_meta_data` can exclude `meta_data` from the
result. There would be less `meta_data` objects return than the previous
implementation.

This fixes the issue by using the `$data['meta_data']` value as the main list of
meta data and only using `$formatted_meta_data` to optionally apply the
`display_key` and `display_value` properties.
2020-09-01 14:38:28 -06:00
Shiki 398076627a Orders API: Fix mismatched domain error 2020-09-01 14:37:55 -06:00
Shiki d6600d8338 Version3/orders.php: Re-add assertion for `meta_data` 2020-09-01 14:29:38 -06:00
Shiki 5651befdd9 Version3/orders.php: Remove assertion for `meta_data`
The new meta_data output will include keys like `display_key` and
`display_value`. The assertion will be re-added in a later commit.
2020-09-01 14:22:38 -06:00
Shiki 64bd1e0fd5 Fix formatting errors in orders.php 2020-09-01 14:21:14 -06:00
pjv ff9a3f2e1e Add before set stock action
Add product and variation `before_set_stock` actions to allow 3rd party plugins to snapshot a product’s stock quantity before it is updated.
2020-09-01 14:37:02 -05:00
Jonathan Sadowski 456851c827 Bump wc-admin to 1.5.0-rc.3 2020-09-01 13:50:02 -05:00
jonathansadowski 86f8788525
Merge pull request #27509 from woocommerce/fix/creating-variations-for-numeric-attributes
Fix "Create variations from all attributes" for numeric attribute values
2020-09-01 13:40:52 -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
GREYS c0092bad34 Fixes spelling country's region Biscay #27538 2020-09-01 22:44:34 +09:00
KoolPal 4fc66caadb
Updated - Added postcode validation for India
Updated from incorrect PR #27517
Postcode in India consists of 6 digit number.
Reference:
https://en.wikipedia.org/wiki/Postal_Index_Number
https://en.m.wikipedia.org/wiki/Address#India

Popular eCommerce sites in India use the same logic for Postcode:
Amazon India (https://www.amazon.in) & FlipKart (https://www.flipkart.com)

P.S. Please review as I am not very confident at a PR.
2020-09-01 11:21:06 +05:30
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
Julià Mestieri b209b2bec3 fixup! Added PR feedback. 2020-08-31 08:28:30 +02:00
Kevin Hagerty 69758c38da
Define a background-color for the H1 in the header
To prevent the email client from setting something different.
2020-08-30 11:28:23 -04:00
Kevin Hagerty a18d80fb60
Merge pull request #1 from woocommerce/master
updating my fork
2020-08-30 11:25:47 -04:00
KoolPal 3f28df9150
Renamed Postcode / ZIP to Pin code & renamed State / County to State for India
Renamed Postcode / ZIP to Pin code & renamed State / County to State for India

Reference: https://en.m.wikipedia.org/wiki/Address#India
2020-08-29 14:19:33 +05:30
Claudio Sanches 5f1d2a8a2c
Merge pull request #27387 from woocommerce/fix/27385-twenty-twenty-notices
Fixes to notice styles in Twenty Twenty
2020-08-28 17:24:33 -03:00
Claudio Sanches 09630202e7
Merge pull request #27459 from jgreys/fix/27360
Fix white space character #27360
2020-08-28 17:23:12 -03:00
Ron Rennick bbdafb5cb1
Merge pull request #26196 from fitimvata/master
Add filter woocommerce_cart_item_required_stock_is_not_enough
2020-08-28 15:34:46 -03:00
Ron Rennick af162d8bed
Updated `@since` for the filter 2020-08-28 15:33:43 -03:00
Ron Rennick 00e38b51ef
Merge pull request #26327 from sandeshjangam/patch-1
New after order details action added
2020-08-28 15:27:17 -03:00
Ron Rennick 38190e2dcd
Merge branch 'master' into patch-1 2020-08-28 15:26:56 -03:00
Ron Rennick 122de48325
Update template version 2020-08-28 15:25:26 -03:00
Ron Rennick d998c6334d
Merge pull request #26976 from JoryHogeveen/patch-1
Public access to WC_Install::get_core_capabilities()
2020-08-28 15:12:51 -03:00
Kathy Daring 0db54ecec3 Add woocommerce_product_has_options filter 2020-08-28 12:01:11 -06:00
Ron Rennick a88cb8ab8e
Merge pull request #27437 from georgejipa/master
Remove the second occurrence of woocommerce_add_{$notice_type} filter
2020-08-28 14:10:43 -03:00
Ron Rennick cd579e3798
update phpcs rule 2020-08-28 13:56:25 -03:00
Ron Rennick 1ae1b3e4e6 Merge branch 'master' into fix/27215 2020-08-28 11:38:37 -03:00
Ron Rennick e49527cf9d apply changes from feedback 2020-08-28 11:34:32 -03: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
jonathansadowski 00dca53b8c
Merge pull request #27500 from woocommerce/update/readme-2
Readme Tweaks & Screenshot updates
2020-08-28 08:56:47 -05:00
Laurence Bahiirwa 5187c412bd
PHPCS Fix 2020-08-28 16:48:28 +03:00
Laurence Bahiirwa 76c4e1d0fc
Fix Spacing and missing bracket
- [x] Fix Spacing to project tab delimiter
- [x] Add missing bracket after the conflict merge.
2020-08-28 16:10:00 +03:00
Nestor Soriano d691692dcd Fix: "Create variations from all attributes" on numeric attribute values
When "Create variations from all attributes" is used to create
variations it generates term relationship entries for all the generated
variations, however that doesn't happen when the term can be interpreted
as a numeric value. This is because in that case product->get_attributes
returns the attribute values as numbers, but the code that generates
the term relationships expect those to always be strings.
When manually adding a given variation this doesn't happen.

The fix is to simply strval-ize the value before using it, but it might
be worth investigating why this is happening.
2020-08-28 11:49:31 +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
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
Gerhard 2b1458c1b5 Add new storefront screenshots 2020-08-27 12:35:35 +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
Julià Mestieri 12be6f3c96 Fixed code standard error. 2020-08-27 09:33:56 +02:00
Julià Mestieri 83434deb42 Added PR feedback. 2020-08-27 09:05:33 +02:00
GREYS 5c648e92df Add KR locale info 2020-08-27 10:40:49 +09:00
GREYS 3070ccf1a9 Add 27 Egypt regions 2020-08-27 09:39:32 +09:00
Romario fefc6193be Replace 'DIRECTORY_SEPARATOR' with '/' 2020-08-26 17:02:07 -05:00
Claudio Sanches c4ccc38780 Fixed use __DIR__ for relative paths 2020-08-26 18:46:44 -03:00
Romario 67a178f4f7 Replace 'DIRECTORY_SEPARATOR' with '/' 2020-08-26 15:50:34 -05:00
Romario 3b90d99d44
Change 'dirname( __FILE__ )' to '__DIR__ ' and include '/'
Co-authored-by: Claudio Sanches <contato@claudiosanches.com>
2020-08-26 14:58:22 -05:00