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

Store period in subscription (renewal) order items #10

Closed
remcotolsma opened this issue Apr 11, 2024 · 1 comment
Closed

Store period in subscription (renewal) order items #10

remcotolsma opened this issue Apr 11, 2024 · 1 comment
Assignees

Comments

@remcotolsma
Copy link
Member

remcotolsma commented Apr 11, 2024

For each subscription order item, we want to know for what period the order item is. Currently, WooCommerce Subscription does not store this information with the order items. It can possibly be derived from the order date and the interval/period settings for the subscription and/or subscription product. But a customer or administrator may also be able to manually extend a few periods in advance. This may result in a number of renewal orders on the same date, but strictly speaking the renewal orders are for consecutive periods. Ideally, you want to make it clear on payment descriptions and invoices for what period the payments are. Also in accounting you want to spread the amounts over the correct period. This was previously a challenge in the Pronamic Pay plugin and now we are also encountering this problem within the Pronamic Moneybird plugin.

In the Pronamic Pay integration we initially used code (<= v4.5.6) that determined and set the period:

https://github.com/pronamic/wp-pronamic-pay-woocommerce/blob/f21bf0b8b83e0c5682a9b3825356d8b423714e59/src/Gateway.php#L795-L825

We removed this for renewal orders in v4.5.7:

https://github.com/pronamic/wp-pronamic-pay-woocommerce/blob/f2e6b22cd44c7f4c8a4886f1ab10a5f8c038f6e9/src/Gateway.php#L739-L767

See commit:

pronamic/wp-pronamic-pay-woocommerce@05be2c3#diff-da93ebacf7f0dab5d7c471c91f0e17ae0392749606fd28497fe3391b2b42f875L812-L825

This has been removed after consultation at @pronamic HQ with @rvdsteege, because the period cannot be determined reliably at this time.


Scherm­afbeelding 2024-04-11 om 11 27 00
@remcotolsma remcotolsma self-assigned this Apr 11, 2024
@remcotolsma remcotolsma changed the title Store period in subscription (renewal) orders Store period in subscription (renewal) order items Apr 11, 2024
@remcotolsma
Copy link
Member Author

I have develop the following plugin for this: 🎉
https://github.com/pronamic/pronamic-woocommerce-subscriptions-period

It's active on our shop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant