Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
87 stars 33 forks source link

[HPOS] Show Subscription status filters above list table when HPOS is enabled #372

Closed mattallan closed 1 year ago

mattallan commented 1 year ago

Fixes #370

Description

With HPOS enabled, when you view the Subscriptions List Table, the status filters above the table only show WC Order statuses and not subscription statuses:

image

Issues in this screenshot:

To fix these issues, this PR uses the views_woocommerce_page_wc-orders--shop_subscription hook to attach the subscription status filters/views.

Changes in this PR:

image

How to test this PR

  1. Enable HPOS
  2. Purchase a subscription and make sure the subscription has a non-order status like 'active'.
  3. While on trunk, visit the WooCommerce > Subscriptions table and notice the list of statuses at the top of the table says "All (0)"
  4. Check out this branch and refresh the page. You should see the status filters properly loading above the subscriptions list table.
  5. Purchase more subscriptions and change the statuses to pending-cancelled and or on-hold.
  6. Use the status (count) links to filter the subscriptions table by status.

Product impact