Commit Graph

24 Commits

Author SHA1 Message Date
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
vedanshujain 3a7e3fda34 Use `!empty` for consistency with other usages. 2021-01-05 16:37:39 +05:30
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
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
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
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
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
vedanshujain 083e529668 Revert "Fix compatibility for WP 5.5"
This reverts commit cc96f6bbd1.
2020-08-12 19:31:40 +05:30
vedanshujain 1966b0ba9a Changed textdomain since API is merged into core now. 2020-08-06 18:18:18 +05:30
vedanshujain cc96f6bbd1 Fix compatibility for WP 5.5 2020-08-06 14:34:03 +05:30
vedanshujain 55a9687e6d Make api included structure more linear. 2020-08-06 14:34:02 +05:30