Extension Updates! 🔒SCA will be rolling out on September 14th, 2019. Update to PayPlans 4.0.14 now 🔥


Hi, i ned some help to configure sql query, i don't know how to reset values every time plans are renewed.

Description :
I use this app in order to add credits on a table rsdirectory_users in order to sell points that allow my users to edit content on a dedicated menu.

So in these following case it work well :
- when users are suscribing to a dedicated plan (Platine, Full) : it add 50 or 150 points on the table as expected
- when user subscription has expired : it remove credits left as waiting

But the problem is when plans are renewing automatically it does'nt resetting the table and give expected points to my users (50 ,150).
Example :
1. users has 12 points left before plan are to renewing
2. after the renewal has done, it does'nt removing the 12 points and give it 50 points instead of!!!

Here my config :

- When plan (platine) are activated :
insert into #__rsdirectory_users (user_id,credits,unlimited_credits,enable_contact_form) values ([[USER_USER_ID]] , 50 , 0 , 1)

- When plan are expired :

delete from #__rsdirectory_users where user_id = ([[USER_USER_ID]])

But i don't see know how reset the table in case of plans are renewed!
I thought that every time plans are renewing automatically this mean that in the first time it expire, then it's activated again, but it seem not to be the case.

Attachments (1)
Attachments can only be downloaded by logged in users

This section can only be seen by users with a valid subscription.
If you have a valid subscription, please login now

Your time
Stack Ideas HQ
Support is

It is currently off working hours and most of us aren't around.

Rest assured that we will get back to your issues as soon as the day starts tomorrow!