- 🇬🇧United Kingdom farse
I am looking on how to do this as well. Are the knock-on affects far and wide if this route is taken?
I'm running a subscription site and using Commerce License Role to allow users to purchase a user role which provides access to the system.
On expiry, emails are sent to the users reminding them that they should renew their subscription. What I want to happen is that the system can find any existing licenses and renew them for the required amount of time rather then issuing a new license.
I've been keeping an eye on https://www.drupal.org/node/2193305 → but that thread has gone down the route of changing the dates on a newly purchased license so it extends the existing membership. I want to explore the use case above and thought that it deserves a thread of it's won distinct from https://www.drupal.org/node/2193305 → .
My initial problem is, I have no idea where to even start. It seems that a license is created when the product is added to the cart, and the status of that license is changed when payment is confirmed.
Is the correct approach here to find the existing license when the product is added, then associate the existing license with the order? Is there an issue with that license then being associated with two orders?
Would we also need further logic when payment is confirmed to decide when the expiry date is, so to call renew() on the existing license with the purchased amount of time to add to the existing license.
Essentially I don't want any new license created at all and any guidance on where I should look would be very much appreciated.
Active
1.3
Documentation
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I am looking on how to do this as well. Are the knock-on affects far and wide if this route is taken?