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

Use trial end date from trial_end_pre_cancellation meta for subscriptions pending cancellation. #24

Merged
merged 1 commit into from Nov 4, 2022

Conversation

rvdsteege
Copy link
Member

When a WooCommerce subscription is marked for cancellation (either by the user through the account or an admin manually changing the subscription status to 'Pending cancellation'), WooCommerce Subscriptions updates the trial end date meta to 0 and moves the current trial end date value to the trial_end_pre_cancellation meta:

https://github.com/pronamic/woocommerce-subscriptions/blob/50b02db3314ce937e9a670b4215fa4cced7652cf/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php#L444-L468

This PR resolves the fatal error from issue #14 in the subscription updater by using the trial end date from trial_end_pre_cancellation meta if the trial_end meta is empty.

@rvdsteege rvdsteege added the bug label Nov 4, 2022
@rvdsteege rvdsteege linked an issue Nov 4, 2022 that may be closed by this pull request
@remcotolsma remcotolsma merged commit 5ccffae into develop Nov 4, 2022
@remcotolsma remcotolsma deleted the 14-fatal-error-subscription-cancel branch November 4, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

Fatal error while cancelling subscription
2 participants