Skip to content

Premium Analytics: port the Average order value widget#49578

Draft
nerrad wants to merge 1 commit into
update/pa-introduce-customize-dashboardfrom
add/wooa7s-1461-port-woo-widget-average-order-value
Draft

Premium Analytics: port the Average order value widget#49578
nerrad wants to merge 1 commit into
update/pa-introduce-customize-dashboardfrom
add/wooa7s-1461-port-woo-widget-average-order-value

Conversation

@nerrad

@nerrad nerrad commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #

Proposed changes

Ports the Average order value widget from next-woocommerce-analytics (woocommerce/woocommerce-analytics@develop) into the Premium Analytics customizable dashboard — the second data-driven widget, same composition shape as the average-items-per-order port (#49505):

Deviations from upstream mirror #49505: inline WidgetErrorNotice (host contract has no setError channel) and the jpa/ namespace.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

Requires pnpm ^11.5 and Node ^24.15.

  • Build: pnpm --filter @automattic/jetpack-premium-analytics build — the average-order-value widget builds and build/widgets.php registers it.
  • On a test site (WooCommerce + the wp.org woocommerce-analytics plugin active and synced):
    1. Premium Analytics page → Customize → Add widget → insert "Average order value".
    2. With order data: currency-formatted metric + comparison delta + sparkline; the Range editor in the widget settings drawer works.
    3. With an average-items-per-order instance on the same range (inserted the same day), a hard reload fires one pair of proxy/reports/orders requests serving both widgets (shared QueryClient via Premium Analytics: build the internal ui and data packages as script modules #49574).

Port the Average order value widget from next-woocommerce-analytics
(woocommerce/woocommerce-analytics@develop) into the Premium Analytics
customizable dashboard (WOOA7S-1461).

Same composition shape as the average-items-per-order port: report data
via @jetpack-premium-analytics/data (useReportOrders), rendering via the
widgets-toolkit (WidgetRoot + OrderMetricWidget, average_order_value
metric), Range editor via the fields package's ReportParamsField
(externalized script module), inline WidgetErrorNotice for the host
contract's missing setError channel.

Adds the icons and widgets-toolkit link: entries and the widgets/**
lint relaxations this widget needs (also added independently by the
average-items-per-order PR; identical lines, trivial merge).
@nerrad nerrad self-assigned this Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the add/wooa7s-1461-port-woo-widget-average-order-value branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/wooa7s-1461-port-woo-widget-average-order-value
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/wooa7s-1461-port-woo-widget-average-order-value

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

No summary data is available for parent commit 5bb6dd9, so cannot calculate coverage changes. 😴

If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, this should be updated once coverage for 5bb6dd9 is available.

Full summary · PHP report · JS report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant