With HPOS enabled, no warning is shown when deleting a subscription parent order. This warning is shown when HPOS is disabled.
To Reproduce
Go to WooCommerce -> Settings -> Advanced -> Features. /wp-admin/admin.php?page=wc-settings&tab=advanced§ion=features
Under Experimental features, select "High performance order storage (new)", enable "Keep the posts and orders tables in sync (compatibility mode)", and save
As a shopper, purchase a subscription if you don't have one already purchased
Go to WooCommerce -> Orders. /wp-admin/admin.php?page=wc-orders
Check off the checkbox for the parent order of the subscription -> Select "Move to trash" in bulk actions -> Click on "Apply"
Notice the order is moved to trash. Instead, an alert dialog should show up (see the video under "Expected behavior" below)
[ ] Does this issue affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
[ ] Does this issue affect WooCommerce Payments? yes/no/tbc, add issue ref
Additional context
This is related to the WC_Subscriptions_Order::add_contains_subscription_hidden_field method. It's hooked to the manage_shop_order_posts_custom_column action which doesn't run for HPOS. It should probably be hooked to the woocommerce_shop_order_list_table_custom_column hook for HPOS.
Describe the bug
With HPOS enabled, no warning is shown when deleting a subscription parent order. This warning is shown when HPOS is disabled.
To Reproduce
wp-admin/admin.php?page=wc-settings&tab=advanced§ion=features
/wp-admin/admin.php?page=wc-orders
Expected behavior
I'd expect the warning to appear when deleting a subscription parent order. Just as it's shown when HPOS is disabled: https://github.com/Automattic/woocommerce-subscriptions-core/assets/41606954/da274b8d-c04a-435c-9a7e-5643b6e5b5f6
Actual behavior
The order is moved to the trash with no warning.
https://github.com/Automattic/woocommerce-subscriptions-core/assets/41606954/466b2d87-cee2-4177-9708-e8edde606854
Product impact
Additional context
This is related to the
WC_Subscriptions_Order::add_contains_subscription_hidden_field
method. It's hooked to themanage_shop_order_posts_custom_column
action which doesn't run for HPOS. It should probably be hooked to thewoocommerce_shop_order_list_table_custom_column
hook for HPOS.