Automattic / woocommerce-subscriptions-core

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

Add the 'contains_subscription' column to the Orders admin page when HPOS is enabled #497

Closed a-danae closed 1 year ago

a-danae commented 1 year ago

Fixes #499 Fixes #469

Description

This PR includes the "contains_subscription" column to the Orders list admin page when HPOS is enabled.

image

How to test this PR

  1. Go to WooCommerce -> Settings -> Advanced -> Features. /wp-admin/admin.php?page=wc-settings&tab=advanced&section=features
  2. Under Experimental features, select "High performance order storage (new)", enable "Keep the posts and orders tables in sync (compatibility mode)", and save
  3. As a shopper, get the following if you don't have them already:
    • A subscription
    • A renewal for the subscription
    • A resubscribed subscription
    • An order with a non-subscription product
  4. Go to WooCommerce -> Orders. /wp-admin/admin.php?page=wc-orders
  5. Confirm that the column has the same behavior as when HPOS is disabled:
    • There's a column between the "Status" and "Total" columns
    • Its title is the subscription icon and has "Subscription Relationship" tooltip
    • The value in this column for each row matches the order type (Subscription, renewal, resubscription, regular order)

Regression tests

Product impact

a-danae commented 1 year ago

We'll also need to include WC_Subscriptions_Order::add_contains_subscription_hidden_field for HPOS. Planning to handle it in a separate PR to keep them small and easy to test.

Update: GH issue for this https://github.com/Automattic/woocommerce-subscriptions-core/issues/500