[SOLVED] Pre-renewal component process - completed

1 year 6 months ago - 1 year 5 months ago #331151 by bizguy
I have created a custom component form, that will display selected fields from a member's profile, allowing them to edit and save the changes. I need to process this form, before the annual membership renewal, as some of this information is required for branch reporting, and the client wants to allow subscribers to update their information so it is applied to the correct branch. 
Is it possible to launch the form, before a user manually renews their subscription or is forced to renew on login, as part of the renewal process?
Can the subscription renewal process be configured to continue after the form is submitted?

Thanks in advance.
Ed

Please Log in to join the conversation.

1 year 6 months ago #331157 by krileon
Replied by krileon on topic Pre-renewal component process
Only way I can think of to do that is to redirect away from CBSubs when they go to renew and the information you need them to complete is empty. You should be able to do this using CB Auto Actions using a Redirect action on the onCPayAfterPlanRenewalSelected trigger. Under conditions you'd check if their profile fields are empty. The redirect URL would just be the URL to your custom form. That trigger happens early enough in the renewal process that this should work pretty well.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

1 year 5 months ago #331376 by bizguy
Replied by bizguy on topic Pre-renewal component process
Thanks Kyle.

How can I access the User ID as they are not logged in through Joomla at this point?

Ed

Please Log in to join the conversation.

1 year 5 months ago #331377 by bizguy
Replied by bizguy on topic Pre-renewal component process
I am able to access the renewing User ID by passing it to my form in the URL. If there is a better option, please advise.

My next obstacle is returning to the CB Subs renewal process upon successfully submitting the member update form. The form remains on the form page, throughout the process to capture/display errors on submitting blank fields and once the data is saved. Should it redirect or ...?

Thanks. 

 

Please Log in to join the conversation.

1 year 5 months ago #331384 by krileon
Replied by krileon on topic Pre-renewal component process

How can I access the User ID as they are not logged in through Joomla at this point?

The variables available to that trigger are as follows.
$_PLUGINS->trigger( 'onCPayAfterPlanRenewalSelected', array( &$chosenPlans[(int) $plan], &$subscription, $act ) );

var1 is the plan selected. var2 is the subscription being renewed. You can get user id from the subscription via [var2_user_id].

My next obstacle is returning to the CB Subs renewal process upon successfully submitting the member update form. The form remains on the form page, throughout the process to capture/display errors on submitting blank fields and once the data is saved. Should it redirect or ...?

Log something to their Joomla user session, check for that something existing after they updated their profile, and if it exists redirect wherever as needed while clearing that something from their session. That's typically the best way to deal with persisting states. Your other option would be to use PHP to call CBSubs API to check if something needs renewed. Regardless this will require custom code.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

1 year 5 months ago #331406 by bizguy
Replied by bizguy on topic Pre-renewal component process
Thanks, Kyle.

I am more of a copy & paste programmer, so if you could provide a code example to access the plan selected and the subscription being renewed, I can build that into the URL I send the user, to renew their subscription.

Thanks,
Ed

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.207 seconds

Facebook Twitter LinkedIn