woocommerce/plugins/woocommerce-admin
Gan Eng Chin 48f2a4c5ad
Display "Origin" column in Orders table in Orders Analytics (#46424)
* Display channel column in Orders Analytics UI.

* Set $data to false to not use cache.

For development purpose.

* Get channel info from order meta and put into extended_info.

* Set channel in order item level.

* Replace channel with get_origin_label in extended_info.

* Remove unnneeded channel in orders_data.

* Display origin instead of channel in table.

* Fix lint errors.

* Query order meta table based on HPOS.

* Remove code for development purpose.

* Add changelog.

* Fix code comment.

* Guard against null values.

`_wc_order_attribution_utm_source` can be null when the order is created via web admin.

* Set default origin label to "Unknown".

This default is the same as found in `output_origin_column` function in plugins/woocommerce/src/Internal/Orders/OrderAttributionController.php.

* Support server side report download.

This is needed when there are more than 25 records in the Orders Analytics report.

* Fix failed test.

* Fix lint error.

* Simplify code.

We loop through $orders_data instead of $order_attributions data. This is because $order_attributions may not have attributions data for some orders.

By looping through $orders_data, it would automatically cater for "Unknown" data from get_origin_label function call, and we don't need to specify "Unknown" as default value for origin.

* Change "channel" to "attribution" object in controller.

This is because we need more than one piece of information, so we need it to be an object with properties like `origin`, `device` etc.

Co-authored-by: Kader Ibrahim S <kader.ibrahim.s@a8c.com>

* Change `origin` string to `attribution` array in Orders DataStore.

Co-authored-by: Kader Ibrahim S <kader.ibrahim.s@a8c.com>

* Change origin string to attribution object.

* Fix indexing after changing from origin string to attribution object.

* Change from origin string to attribution object in table.js.

* Simplify code.

To make code shorter and easier to read, instead of long horizontal code.

* Fix lint errors.

* Fix failed test.

* Fix lint error.

* Fix retrieving origin in CSV export.

* Use $wpdb->postmeta; cosmetic change.

Co-authored-by: Kader Ibrahim S <kader.ibrahim.s@a8c.com>

* Cosmetic change.

Co-authored-by: Kader Ibrahim S <kader.ibrahim.s@a8c.com>

* Sanitize order IDs by using absint.

Co-authored-by: Kader Ibrahim S <kader.ibrahim.s@a8c.com>

---------

Co-authored-by: Kader Ibrahim S <kader.ibrahim.s@a8c.com>
2024-04-18 16:16:26 +00:00
..
bin add/lys xstate scaffolding (#45548) 2024-03-18 15:44:32 +08:00
changelog add/explat experiment name validation (#44535) 2024-02-15 12:35:23 +08:00
client Display "Origin" column in Orders table in Orders Analytics (#46424) 2024-04-18 16:16:26 +00:00
docs Update Woo.com references to WooCommerce.com (#46259) 2024-04-09 09:50:15 +01:00
.browserslistrc
.distignore Create E2E package (https://github.com/woocommerce/woocommerce-admin/pull/7084) 2021-07-13 16:38:05 -03:00
.eslintignore Ignore core js packages from woo admin's eslint 2022-03-29 16:07:09 +08:00
.eslintrc.js fix ESLint configuration regarding import path aliases (#43421) 2024-01-11 16:40:38 +01:00
.gitattributes Switch to pnpm (https://github.com/woocommerce/woocommerce-admin/pull/8349) 2022-03-04 12:01:16 +08:00
.gitignore Enable Typescript checking on ./client folder (https://github.com/woocommerce/woocommerce-admin/pull/8372) 2022-03-01 12:19:07 +08:00
.npmrc Switch to pnpm (https://github.com/woocommerce/woocommerce-admin/pull/8349) 2022-03-04 12:01:16 +08:00
.prettierrc.js Update @wordpress/eslint-plugin dependency to latest version. (https://github.com/woocommerce/woocommerce-admin/pull/5856) 2021-01-26 13:24:28 +13:00
.stylelintignore CSS Linting: Exclude Storybook CSS (https://github.com/woocommerce/woocommerce-admin/pull/6785) 2021-04-13 10:03:44 +12:00
README.md Fix link to e2e tests documentation from WooCommerce Admin directory (#41631) 2023-11-27 09:53:22 +01:00
babel.config.js Remove redundant deps on e2e in wc-admin (#39746) 2023-08-16 12:15:03 +12:00
composer.json Fix Component Project Changelog Checking (#42794) 2023-12-13 15:41:11 -08:00
composer.lock Fix Component Project Changelog Checking (#42794) 2023-12-13 15:41:11 -08:00
package.json Update the monorepo to node v20 (#45148) 2024-04-12 13:49:55 -03:00
stylelint.config.js Stylelint: Update config to double quotes (#45607) 2024-03-26 10:41:34 -03:00
tsconfig.json Move product-editor CES-related components and utilities (#37131) 2023-03-28 13:38:08 -04:00
unminify.js Improve webpack cache-busting version parameter by using file contents hash (#44838) 2024-02-27 08:07:53 +00:00
webpack.config.js Add notice to connect to woocommerce.com in wc settings and marketplace (#45536) 2024-04-17 10:13:24 +00:00

README.md

WooCommerce Admin

This is a javascript-driven, React-based admin interface for WooCommerce.

Development

Please refer to the WooCommerce Admin Development.

End-to-end tests

Please refer to the WooCommerce End to End Tests.

Common Issues

If you're encountering any issue setting things up, chances are we have been there too. Please have a look at our wiki for a list of common problems.