If the merchant had onboarded, it would include base screen which mentioned that subscriptions will be listed here and a link to create a product. See screenshot below.
This PR moves the base screen to subscriptions core so that all subscription-core client products (WooPayments and Woo Subscriptions) have the updated empty state screen.
Note
This will require a set of accompanying changes in Woo Payments that this version of core is merged into to ensure no breakage.
How to test this PR
Warning
When testing this PR beware that the function used to determine whether to display the empty state (ie do subscriptions exist) uses a caching system and so it's suggested that if you flip between having and not having subscriptions that you clear the cache or bypass it in cache_and_get().
Make sure you have WC Subscriptions plugin active.
Delete all your subscriptions.
If you'd prefer to keep them, you can do a bulk post type update and restore it after testing.
Go to the WooCommerce > Subscriptions screen.
On trunk you'll see an empty list with simple html elements (p and a tags).
On this branch you should see the new empty state screen.
The button should take you to the edit product page.
Purchase a subscription.
Go to the subscriptions admin list table.
You should see the subscription you just purchased listed.
Filter the list table by searching for an dummy string - we want to test 0 results.
You should just see the "No subscriptions found." text.
This PR deprecates the old hook woocommerce_subscriptions_not_found_label. This hook used to filter the plain text "No Subscriptions found", however it was being used by WooPayments to also return full HTML content. Given the name ("label"), it no longer makes sense for it to exist in that form. I've deprecated it, still call it but have replaced it with a new hook woocommerce_subscriptions_not_found_html.
To test the deprecation you can enable WooPayments, disable WC Subscriptions and reload the WooCommerce > Subscriptions screen. You should see the same empty state but this deprecation warning should be shown.
woocommerce_subscriptions_not_found_label is deprecated since version 6.1.0! Use woocommerce_subscriptions_not_found_html instead.
Product impact
[x] Added changelog entry (or does not apply)
[ ] Will this PR affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
[ ] Will this PR affect WooCommerce Payments? yes/no/tbc, add issue ref
[ ] Added deprecated functions, hooks or classes to the spreadsheet
Fixes #https://github.com/woocommerce/woocommerce-subscriptions/issues/4549
Description
In WooPayments v3.4 we introduced empty state screens for the WooCommerce Subscriptions admin list table. see https://github.com/Automattic/woocommerce-payments/pull/3403
As part of that PR there were 2 variations of that screen.
This PR moves the base screen to subscriptions core so that all subscription-core client products (WooPayments and Woo Subscriptions) have the updated empty state screen.
How to test this PR
This PR deprecates the old hook
woocommerce_subscriptions_not_found_label
. This hook used to filter the plain text "No Subscriptions found", however it was being used by WooPayments to also return full HTML content. Given the name ("label"), it no longer makes sense for it to exist in that form. I've deprecated it, still call it but have replaced it with a new hookwoocommerce_subscriptions_not_found_html
.To test the deprecation you can enable WooPayments, disable WC Subscriptions and reload the WooCommerce > Subscriptions screen. You should see the same empty state but this deprecation warning should be shown.
Product impact