woocommerce-subscriptions-importer-exporter icon indicating copy to clipboard operation
woocommerce-subscriptions-importer-exporter copied to clipboard

Fix incorrect start_date on exported subscriptions

Open eriktdesign opened this issue 4 years ago • 3 comments

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 avatar Jul 27 '21 19:07 eriktdesign

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

eriktdesign avatar Jul 27 '21 19:07 eriktdesign

The build errors are not related to this change.

sun avatar May 05 '23 13:05 sun

The change is still correct and necessary.

sun avatar Jul 17 '23 09:07 sun