Skip to content

Conversation

@eriktdesign
Copy link

Exporting subscriptions that were previously imported is returning incorrect values for the start_date column, with the returned value being the date the subscriptions were imported rather than the start date of the subscription.

This basic PR changes the call to WC_Subscription::get_date() to use 'start' as the $date_type parameter instead of 'date_created', which doesn't even appear to be a valid $date_type.

Does this perhaps need to fall back to 'date_created' if the value of 'start' is empty?

Exporting subscriptions that were previously imported is returning incorrect values for the `start_date` column, with the returned value being the date the subscriptions were imported rather than the start date of the subscription. 

This basic PR changes the call to `WC_Subscription::get_date()` to use `'start'` as the `$date_type` parameter instead of `'date_created'`, which doesn't even appear to be a valid `$date_type`.

Does this perhaps need to fall back to `'date_created'` if the value of `'start'` is empty?
@eriktdesign
Copy link
Author

See https://docs.woocommerce.com/document/subscriptions/develop/functions/#section-3 for docs on WC_Subscription::get_date()

Copy link

@sun sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌 This is correct. A subscription may not necessarily start immediately when it is created.

@sun
Copy link

sun commented May 5, 2023

The build errors are not related to this change.

@sun
Copy link

sun commented Jul 17, 2023

The change is still correct and necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants