Commit Graph

88 Commits

Author SHA1 Message Date
Justin Shreve 49a0f0f6d2 Add `reports/downloads` REST API endpoint. (https://github.com/woocommerce/woocommerce-admin/pull/1122)
* First pass at downloads REST API

* Handle PR feedback
2018-12-21 14:57:46 -08:00
Joshua T Flowers f83b0e0615 Add product categories wc-api and breadcrumbs (https://github.com/woocommerce/woocommerce-admin/pull/1131)
* Add support for product cats in wp rest api

* Add categories to WC API

* Add category breadcrumbs component

* Increase per_page limit size for product cat API

* Use wc/v3 API to pull product categories

* Return category IDs in API

* Add categories to product reports

* Add category IDs test for REST API

* Switch to getResource instead of require for total count selector
2018-12-21 10:44:27 +08:00
Paul Sealock 46c313cdc7 REST API: Categories: optimize query by removing get_the_terms 2018-12-21 11:08:08 +13:00
Peter Fabian dff8b63271 Merge pull request woocommerce/woocommerce-admin#1010 from woocommerce/fix/845
Added /reports/coupons and /reports/coupons/stats endpoints
2018-12-19 13:55:28 +01:00
Peter Fabian 4802736a0e Switched from using coupon code filter to coupon id filter by query parameter. 2018-12-19 13:37:54 +01:00
Joshua T Flowers 08d3e2c38d Change product_gross_revenue to product_net_revenue (https://github.com/woocommerce/woocommerce-admin/pull/1105)
* Change product_gross_revenue to product_net_revenue

* Change product_gross_revenue to product_net_revenue in category data store

* Change to net_revenue in frontend category report
2018-12-19 08:56:27 +08:00
Paul Sealock 15bbbe739d Hook up Categories table to endpoint 2018-12-19 08:36:42 +13:00
Peter Fabian 85e6e8df8d Added correct cache handling. 2018-12-18 12:01:42 +08:00
Peter Fabian 6c456657e8 Changed coupon_gross_discount to amount. 2018-12-18 12:01:42 +08:00
Peter Fabian 21ac75d21e Made extended_info always appear in coupons endpoint. 2018-12-18 12:01:40 +08:00
Peter Fabian 3e45c6a82c Fixed invalid sort criterion for coupons endpoint. 2018-12-18 12:01:39 +08:00
Peter Fabian a346f13beb Added extended info. 2018-12-18 12:01:38 +08:00
Peter Fabian 5eee869a74 Added small fixes to set up coupon endpoints. 2018-12-18 12:01:38 +08:00
Peter Fabian 357b8f914a Added query classes and data stores for coupons and coupons/stats. 2018-12-18 12:01:17 +08:00
Peter Fabian e273d055ef Moved functions from orders data store to allow code reuse. 2018-12-18 12:00:33 +08:00
Joshua T Flowers 9486ab7896 Update/taxes endpoint hookup/941 (https://github.com/woocommerce/woocommerce-admin/pull/1008)
* Hook up taxes to endpoint

* Hook up tax stats endpoint

* Add default tax stat totals for empty results

* Create subtotals from intervals in API

* Change orders to orders_count to keep consistent naming
2018-12-18 10:26:46 +08:00
Allen Snook de105648be Activity Panel: Inbox: Filter update and error notes out of the inbox (https://github.com/woocommerce/woocommerce-admin/pull/893)
* Filter update and error notes out of the inbox

* Remove redundant trim().

* Fix test for admin notes API type parameter.
2018-12-11 09:00:57 +08:00
Joshua T Flowers 04d3ce6eb1 Add taxes endpoint and data store (https://github.com/woocommerce/woocommerce-admin/pull/1000)
* Add taxes endpoint and data store

* Add sorting options and normalize orderby param

* Add report taxes unit tests

* Add tax rate to response

* Add country, state, priority, and name to response

* Fix tax codes query param

* Add class comment

* Add missing  to record query

* Add comment about ambiguous column
2018-12-11 08:58:05 +08:00
Joshua T Flowers 557cec57cb Add tax stats endpoint (https://github.com/woocommerce/woocommerce-admin/pull/1019) 2018-12-11 08:55:05 +08:00
Paul Sealock 93a7472e54 REST API: Add stock info to products and variations 2018-12-11 07:19:46 +13:00
Joshua T Flowers 5d3c771d45 Trigger sync_order on order stats table when refunding (https://github.com/woocommerce/woocommerce-admin/pull/990) 2018-12-05 10:10:22 +08:00
Joshua T Flowers 755b9c94f7 Reduce order table net revenue by refund total (https://github.com/woocommerce/woocommerce-admin/pull/988)
* Reduce order table net revenue by refund total

* Use order utils to get refund total
2018-12-05 10:06:00 +08:00
Peter Fabian 1c8459244a Merge branch 'master' into fix/749
# Conflicts:
#	includes/data-stores/class-wc-admin-reports-products-data-store.php
2018-12-04 12:07:43 +01:00
Peter Fabian 670801cee8 Merge pull request woocommerce/woocommerce-admin#978 from woocommerce/fix/PHP52-compat
Fixed PHP 5.2 compatibility
2018-12-04 12:00:37 +01:00
Paul Sealock bf0e025b05 REST API: isolate extened info in /reports/products 2018-12-04 13:01:36 +13:00
Peter Fabian 15b4681d30 Updated refactored function call from variations data store. 2018-12-03 20:14:05 +01:00
Peter Fabian ef0f11182a Added missing function parameter. 2018-12-03 20:07:44 +01:00
Peter Fabian e297e5ba7f Fixed TABLE_NAME references.
To be compatible with PHP 5.2.
2018-12-03 18:01:50 +01:00
Peter Fabian 1acb9827e7 Merge branch 'master' into fix/749
# Conflicts:
#	includes/data-stores/class-wc-admin-reports-products-data-store.php
2018-12-03 16:21:04 +01:00
Peter Fabian b8dff97e00 Fixed PHP 5.2 compatibility. 2018-12-03 14:44:43 +01:00
Peter Fabian 6e68247701 Merge pull request woocommerce/woocommerce-admin#953 from woocommerce/fix/740
Added support for ordering by product name in products endpoint.
2018-12-03 11:56:28 +01:00
Paul Sealock 516062975b try/variations-endpoint 2018-12-03 12:02:58 +13:00
Paul Sealock 164a67144b try/variations-endpoint 2018-12-03 11:49:37 +13:00
Peter Fabian 8b80de9bc2 Added support for ordering by product name in products endpoint. 2018-11-28 15:14:34 +01:00
Peter Fabian e6cca3c083 Replaced code_includes/_excludes with coupon_* as agreed. 2018-11-28 10:53:11 +01:00
Peter Fabian eff3a97573 Added time clause to WHERE subquery and fixed product selection. 2018-11-27 21:41:52 +01:00
Peter Fabian bc29615454 Removed unnecessary SQL conditions. 2018-11-27 21:40:13 +01:00
Peter Fabian c1af1da752 Updated structure of SQL queries for coupons and products.
As there can be multiple couopns and products assigned to one order, it requires different handling to what was initially implemented.
2018-11-27 16:34:12 +01:00
Peter Fabian 8e5709ce26 Updated get_unique_products to be more versatile and support running in other contexts.
In some cases of advanced filters, it produced incorrect SQL code.
Additionally, split of where clause to time clause and rest needed to be reflected here, too.
2018-11-27 16:32:42 +01:00
Peter Fabian 32e30ac274 Made sync of order stats table run also on clean_post_cache.
Otherwise, some changes in master data for orders would not be reflected, as save_post action is skipped if order is updated while the save_post action is running.
2018-11-27 16:29:21 +01:00
Peter Fabian 216b7c94ca Updated structure for includes/excludes coupons and products subqueries.
As there can be multiple coupons and products assigned to one order, it needs to ba handled differently when constructing SQL query.
2018-11-27 16:26:50 +01:00
Peter Fabian 7dd611f4d4 Added table name to time period sql params.
Without this, the subquery could not be used in some contexts, as the column name was ambiguous.
2018-11-27 16:23:40 +01:00
Peter Fabian db9d6e03e7 Added spaces around operator. 2018-11-16 18:22:40 +01:00
Peter Fabian c1cf221773 Fixed typos. 2018-11-16 18:02:19 +01:00
Peter Fabian 26debd77c3 WIP on advanced filters.
Plus fixing bugs:
- fixed tests
- fixed schema definition to reflect response data
- split WHERE SQL clause into time constraints and rest
2018-11-16 17:51:33 +01:00
Peter Fabian 46923de3d2 Removed superfluous unsets. 2018-11-16 12:37:15 +01:00
Peter Fabian 7c6d0dc314 Handled case where match parameter is missing. 2018-11-16 12:32:13 +01:00
Peter Fabian ea766b83ca Renamed method to better reflect its purpose.
Plus added conversion of count as string to integer.
2018-11-16 12:30:00 +01:00
Peter Fabian 16d5265aed Merge branch 'master' into fix/749 2018-11-16 12:16:50 +01:00
Peter Fabian ba09fea35d Updated filters subqueries to correctly handle no filter case. 2018-11-16 12:12:47 +01:00