Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect start_date on exported subscriptions #246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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