Commit Graph

55 Commits

Author SHA1 Message Date
Josh Betz 73d51a8770 Allow billing email to be empty
Allows passing `null` for the billing email to clear it. This means the
email must either be a string that is a valid email address or a null
value.

Since it is possible to clear the email address for an order in a
similar way via the admin-ajax endpoints, this is meant to provide
consistency with the wp-admin experience.
2021-09-30 08:16:09 -05:00
Vedanshu Jain dd876b6d8a
Merge pull request #29835 from woocommerce/fix/29124-magic-arg
Test for the presence of 3 or more args (not 2 or more). | #29124
2021-05-20 22:13:38 +05:30
barryhughes 7ea5c7501f Test for the presence of 3 or more args (not 2 or more). | #29124 2021-05-05 11:43:14 -07:00
Nestor Soriano 7f2c2d8b72
Add logging for errors during the execution of a debug tool. 2021-04-29 11:20:25 +02:00
Nestor Soriano 10adec6b88
Improvements in the engine behind the debug tools page.
Two new optional keys have been added to the tool definition array:

- 'disabled': when true the tool button will appear disabled.
- 'needs_refresh': when running a tool, by default the tool definitions
  are retrieved first, then the selected tool is executed,
  then the definitions previously retrieved are rendered.
  When this key is true the tool definitions are retrieved again
  after execution, useful for cases where the tool description
  or button enable/disable state changes after the tool execution.

Also now if a tool execution throws an exception a notice will be
shown with the execption message, previously the exception
was unhandled.
2021-04-28 10:24:23 +02:00
Nestor Soriano bad3df3e23
Fix code sniffer errors 2021-04-28 09:36:10 +02:00
Néstor Soriano 17224d0ab1
Merge pull request #29345 from woocommerce/hw/low-stock-threshold-for-variations
Low stock threshold for variations
2021-03-17 08:59:32 +01:00
Peter Fabian 8bfa97d633 Use null rather than empty string to signify unset value. 2021-03-15 12:37:39 +01:00
Peter Fabian b48a389264 Add support for low stock amount to REST API v3. Ref #27371. 2021-03-11 16:21:43 +01:00
roykho cb0b92750b
Extract recount terms logic into own function closes #25375 2021-03-04 09:06:03 -08:00
Nestor Soriano fae00e2bdf Make the refunds creation REST API behave more as documented
- Allow the list of line items to be a non-associative array
  where each item is identified by an "id" field
- Same for taxes inside line items, specify amount to refund in
  a "refund_total" key as in the case of line items
- Allow "quantity" keys as synonyms of "qty"

Also calculate "amount" automatically if missing and when all the
line items and taxes have a valid "refund_total" key.
2021-02-11 09:51:13 +01:00
Claudio Sanches ea54d5ad5f
Merge pull request #28679 from woocommerce/fix/woocommerce-gutenberg-products-block-issues-3565
Show correct WooCommerce pages status if they are using blocks vs shortcode.
2021-01-18 19:26:34 -03:00
budzanowski f9cbc0ccac Remove filters that we don't need yet. 2021-01-14 10:24:39 +01:00
budzanowski 1cf09eb063 Simplify. 2021-01-06 15:30:13 +01:00
budzanowski d5babd800a Review refactor. 2021-01-06 15:28:51 +01:00
vedanshujain 27b22d3aaa Move the logic to set stock_status from V2 to V3. 2021-01-06 17:55:56 +05:30
budzanowski 29837c42ff Refactor. 2021-01-06 11:33:28 +01:00
vedanshujain 2ae6c5b543 Also fetch dependencies for fields which are computed from other fields. 2021-01-06 15:09:50 +05:30
vedanshujain 0d43aecebd Also fetch in_stock when stock_status requested in V2.
When called from V3, controller calls V2s get_product_data method, where stock_status was did not existed and was renamed. In V3 controller, we compute it based on V2 in_stock field.
2021-01-06 14:14:59 +05:30
budzanowski 325f72afe1 Merge branch 'master' into fix/woocommerce-gutenberg-products-block-issues-3565 2021-01-06 09:01:17 +01:00
vedanshujain 3a7e3fda34 Use `!empty` for consistency with other usages. 2021-01-05 16:37:39 +05:30
vedanshujain 80f5d35311 Apply coding standards w.r.t PR #28677 2021-01-05 13:47:16 +05:30
budzanowski c81df313b2 Add block information for woocommerce pages report. 2020-12-28 16:19:51 +01:00
vedanshujain 818e24d5c5 Add protection around `func_get_arg` method for backward compatibility.
We are using func_get_arg method to receive argument in a backward compatible way since we cannot modify function signature to add more params even with default params. Earlier I was hoping to use DI to create another child class with modified signature and load it depending upon where we are executing from, however since we had to revert DI, we add this workaround to unblock #27735.
2020-12-28 14:10:22 +05:30
vedanshujain 089994c618 Dont fetch optional fields unless asked to improve performance 2020-12-18 14:40:20 +05:30
vedanshujain 04f948951a Fetch product attrs only when needed 2020-12-18 14:40:20 +05:30
vedanshujain 54dd5550e5 Pass request in backward compatible way 2020-12-18 14:40:20 +05:30
vedanshujain 2e65b8cec4 Fetch expensive fields only when required for performance 2020-12-18 14:40:20 +05:30
Claudio Sanches e8b2a9adab Display *-product_<cat|tag> template overrides in Status page 2020-11-23 20:12:38 -03:00
vedanshujain 62ae94d93e Add shipping, tax and fee lines to refund response for better information. 2020-11-11 18:47:48 +05:30
Shiki 94ecfcab34 Orders API: Add parent_name to schema 2020-10-26 13:28:04 -03:00
Shiki 48d595ed71 Orders API: Reorganize and place parent_name in a separate section 2020-10-26 13:28:04 -03:00
Shiki 52739ba9ee Orders API: Add parent_name to line_items for variable products 2020-10-26 13:28:04 -03:00
Claudio Sanches 7d1ff1a655
Merge pull request #27310 from woocommerce/fix/27215
Fix deleting a tax class via WP CLI.
2020-10-14 14:00:33 -03:00
vedanshujain c01f32a390 Use default value if formatted value is not available 2020-10-14 14:51:19 +05:30
vedanshujain 8e12de5d3c Merge branch 'fix/api/229-unit-test' of https://github.com/shiki/woocommerce into fix/api/229 2020-10-14 13:53:03 +05:30
Claudio Sanches e655b44717 Fixed coding standards 2020-10-13 22:32:32 +05:30
Shiki 2e165e7558 Orders: Make display_key and _value meta available for v3 and v3
This resolves the intentionally failing
WC_Tests_API_Orders_V2::test_get_item_with_line_items_meta_data.
2020-10-13 22:32:31 +05:30
Shiki a3f46e5526 Schema: Make display_key and *_value available for v3 and v2
This is just the schema and the actual functionality isn't implemented yet.
2020-10-13 22:32:30 +05:30
Shiki b9ae830da5 Fix formatting in Orders V2 unit test 2020-10-13 22:32:30 +05:30
Ron Rennick 24ec59cf26 fix merge conflict 2020-10-07 15:19:05 -03:00
Claudio Sanches 70c7adfeb7 Fixed usage of package tag in REST API and templates 2020-09-17 11:56:08 -03:00
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
Ron Rennick 1ae1b3e4e6 Merge branch 'master' into fix/27215 2020-08-28 11:38:37 -03:00
Shiki 2e366ef76b Orders: Make display_key and _value meta available for v3 and v3
This resolves the intentionally failing
WC_Tests_API_Orders_V2::test_get_item_with_line_items_meta_data.
2020-08-26 23:46:07 +05:30
Shiki 35ed2df4fb Schema: Make display_key and *_value available for v3 and v2
This is just the schema and the actual functionality isn't implemented yet.
2020-08-26 23:46:07 +05:30
Shiki 5ab863e649 Fix formatting in Orders V2 unit test 2020-08-26 23:46:07 +05:30
Ron Rennick 2fd12604ef move update to v2 controller 2020-08-13 09:32:01 -03:00
vedanshujain 3dd508fd35 Address review comments 2020-08-13 16:36:27 +05:30