You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Performance improvements: rendering the Subscription Relationship column and checking if order is a renewal, switch etc. (#732)
* Introduce new function to check if an order is a subscription parent order
* Refactor our wcs_order_contains_x() functions to be more performant
* Update render_contains_subscription_column_content() to accept order object and call more performant contains functions
* Add changelog entry
* Replace count(wcs_get_subscriptions_for_order()) with new is_parent_order() function
* Dont render the inefficient parent order distinction on orders list table
* Move checking for parent order as the final elseif as it's the most resource intensive query
* Call wcs_is_order() before passing the order to get_related_subscription_ids()
* Introduce new wrapper for WCS_Related_Order_Store get_related_subscription_ids()
* Use new wcs_get_subscription_ids_for_order() in order contains functions
* Update wcs_get_subscriptions_for_order() to use new get_related_subscription_ids() wrapper
* Add support for fetching parent order types as well
* Add unit tests
* Fix unit tests to match expected array returned (ids in DESC order)
* Order by IDs
* Always query for parent order relations if parent is passed - don't make false assumptions
* Add support for fetching subscription IDs for any order type
* add default behaviour details to docblock
* Add unit tests for a realistic resubscribe case
* Sort the returned array of subscription IDs
* Ensure backwards compatibility with filter hooks passing WC order objects
* Update changelog
* Rename wcs_is_parent_order() to wcs_order_contains_parent() for consistency
* @param WC_Order $order The order to get the subscription IDs for.
86
+
* @param string|array $order_types The order types to get the subscription IDs for. Defaults to 'any' which will return all subscription IDs linked to the order.
0 commit comments