Redirect to subscriptions page

10 years 3 months ago #239289 by LukeDouglas
Redirect to subscriptions page was created by LukeDouglas
How can we setup a redirect to the subscription page for a user who's subscription has run out and this is their first time logging in since their subscription ran out?

Please Log in to join the conversation.

10 years 3 months ago #239305 by krileon
Replied by krileon on topic Redirect to subscriptions page
If the subscription is marked expired it should already do this, but I believe it only functions if you don't allow free registrations without a subscription via parameter within CBSubs > Settings > Global. Aside from that I don't think you can unless you determine they're expired with CB Query Field then handle the redirect with CB Auto Actions.


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.

10 years 3 months ago - 10 years 3 months ago #239338 by LukeDouglas
Replied by LukeDouglas on topic Redirect to subscriptions page
Kyle,

I checked and that setting is set to 'Yes' as we are allowing users to registered without having a subscription. I'll discuss this with staff and see if they just want to allow registrations with a subscription so it can achieve this result of displaying the subscription page when a registration expires. The reason they are currently allowing this is to gain email addresses for marketing purposes.

If they don't want to change this, how can I use the CB Query function to check for expired subscription and then use the Auto funcions to redirect?

Please Log in to join the conversation.

10 years 3 months ago #239341 by krileon
Replied by krileon on topic Redirect to subscriptions page
The below query can be added to CB Query Field then condition in your Redirect action on the after login trigger.

SELECT COUNT(*) FROM `#__cbsubs_subscriptions` WHERE `user_id` = '[user_id]' AND `id` = PLAN_ID_HERE AND `status` = 'X'

Replace PLAN_ID_HERE with the plan id that you want to check against or remove the id usage entirely to check if any plan is expired.


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.

10 years 3 months ago - 10 years 3 months ago #239350 by LukeDouglas
Replied by LukeDouglas on topic Redirect to subscriptions page
I setup an auto action, type = 'Redirect' with this trigger:
SELECTCOUNT(*)FROM`#__cbsubs_subscriptions`WHERE`user_id`='[user_id]'AND`status`='X',onAfterLoginForm'

Access is 'All registered Users' but it didn't redirect on a test login.

I changed it to:
SELECTCOUNT(*)FROM`dzrd_cbsubs_subscriptions`WHERE`status`='X',onAfterLoginForm'

This did not redirect to the subscriptions page.

Is this the way it is suppose to be setup?

Please Log in to join the conversation.

10 years 3 months ago #239352 by krileon
Replied by krileon on topic Redirect to subscriptions page
The query is for CB Query Field. You do not add it to Triggers. Please see our tutorials page below which has several examples of how to use CB Auto Actions.

www.joomlapolis.com/support/tutorials/107-use-cases


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.

Moderators: beatnantkrileon
Time to create page: 0.199 seconds

Facebook Twitter LinkedIn