So, I am trying to setup some SQL actions, and yes I know how MySQL works. Yes, I have also tested the Queries in phpmyadmin and they work just fine.
However, when subscribing / unsubscribing via the backend through an administrator, it would seem the SQL Actions are never executed. The only thing that is executed is CB Fields.
One, I use CB Fields to set two fields. One field is set to Active, and the other field is set to the name of the Subscription plan.
The problem is, CB Fields does not let you specify what you want the field to be when the user is inactive / unsubscribes. Instead it just removes it and leaves it blank. I need it so it adds "Inactive" to where active used to be, and change the other to "Regular" instead of the subscription plan name.
That is why I am trying to use the SQL Actions to accomplish it, and to accomplish adding a Date / Time to a field when the user renews subscription / creates subscription.
SQL Statements:
I have tried it this way:
Activation: UPDATE `#__comprofiler` SET `cb_donationdate` = NOW() WHERE `user_id` = '[user_id]'
Unsubscribe / Deactive: UPDATE `#__comprofiler` SET `cb_donationstatus` = 'Regular', `cb_memberstatus` = 'Inactive' WHERE `user_id` = '[user_id]'
And I have tried it this way:
Activation: UPDATE `#__comprofiler` SET `cb_donationdate` = NOW() WHERE `user_id` = [user_id]
Unsubscribe / Deactive: UPDATE `#__comprofiler` SET `cb_donationstatus` = 'Regular', `cb_memberstatus` = 'Inactive' WHERE `user_id` = [user_id]
I have also tried it this way:
Activation: UPDATE `jos_comprofiler` SET `cb_donationdate` = NOW() WHERE `user_id` = [user_id]
Unsubscribe / Deactive: UPDATE `jos_comprofiler` SET `cb_donationstatus` = 'Regular', `cb_memberstatus` = 'Inactive' WHERE `user_id` = [user_id]
None of them are executed when you unsubscribe via the backend / delete / activate a subscription
Thanks,
Metric