With HPOS enabled & data synchronization disabled, calling wcs_get_subscription_orders( 'ids', 'parent' ) will return an empty array due to this function querying for post_parent from the posts table.
In this PR I'm replacing the following query with code that alters the query based on whether HPOS is enabled.
$order_ids = array_merge( $order_ids, $wpdb->get_col(
"SELECT DISTINCT post_parent FROM {$wpdb->posts}
WHERE post_type = 'shop_subscription'
AND post_parent <> 0"
) );
Note - This function not working as expected doesn't impact WC Subscriptions as we don't use this with HPOS enabled.
How to test this PR
Enable HPOS on your store and turn off data syncing
Fixes #422
Description
With HPOS enabled & data synchronization disabled, calling
wcs_get_subscription_orders( 'ids', 'parent' )
will return an empty array due to this function querying forpost_parent
from the posts table.In this PR I'm replacing the following query with code that alters the query based on whether HPOS is enabled.
How to test this PR
trunk
, this will return an empty array.Product impact