Skip to Content Skip to Menu

Bussiness subscription expire to Basic subscrption

10 years 2 months ago #248034 by jpif78@gmail.com
Bussiness subscription expire to Basic subscrption was created by jpif78@gmail.com
Joomla: v3.3.3
CB: v1.9.1
Profile Pro: v4.0
CB Paid Subscriptions: v3.0.0
Adsmanager: v2.9.12


We've deployed a few subscription plans and we're loking for a workaround for the following issue:

A new user can sign-up and pay for a premium subscription, but this will expirate after a few months.

Then, that user should become automatically a basic free business profile.

We've got to achieve this partly by creating all advanced (payment) plans as children of the basic business plan.

That provides an automatic subscription to both plans and a user can let expirate his/her premium advanced account and still gain access to the basic business features.

But this is not fully working.

In front-end, the user can see his/her profile updated to the basic plan, but still having the advanced features available.

We use CB Profile Pro plugin from JoomDuck to dessign different views relying on the subscription plan, even if the subscription looks to be updated in the front end, in database it isn't, and the front-end view still displaying the advanced subscription view options.

We've got CB Paid Subscriptions plugin too. There, we check each subscription plan's Integration TAB and see we've got an extra setting over CB Fields which we think it should ease to set a profile type to a new value once an advanced plan is disabled, but this feature looks useless as it doesn't update the user profile subscription actually, even if it looks to be able to do so.

At this point we can't really figure out what tasks should we perform in order to fix this issue, but it's inappropriate let the users whose advanced accounts are expired, to access the extended features.


Thanks.

Best regards

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
10 years 2 months ago #248065 by krileon

We've got CB Paid Subscriptions plugin too. There, we check each subscription plan's Integration TAB and see we've got an extra setting over CB Fields which we think it should ease to set a profile type to a new value once an advanced plan is disabled, but this feature looks useless as it doesn't update the user profile subscription actually, even if it looks to be able to do so.

The value reversal in CBSubs Fields is actually bugged. The below quickfix will fix that for you.

www.joomlapolis.com/forum/255-developer-members-support/221405-cbsubs-integration-cbfields?start=18#228624

The subscriptions are actually expired. It's just the field value reversal not working.


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 or Create an account to join the conversation.

10 years 1 month ago - 10 years 1 month ago #249153 by jpif78@gmail.com
Replied by jpif78@gmail.com on topic Bussiness subscription expire to Basic subscrption
Hello Joomlapolis Support,

thanks Krileon,

we did already fix that issue a few weeks ago.


As we needed a little more implementation, we added a few more lines of code in order to customize a few behaviors our customer wanted:

if ( $fieldRemoveContent ) {

/*
* Our code to check and unpublish this user's premium adsmanager ads ...
*/


$user->$fnam = $fieldRemoveContent;
} else {
if ( $user->$fnam == $fieldvalue ) {
$user->$fnam = '';
}
}

Once an advanced subscription is expired, we check it's subscription type and unpublish all adsmanager ads owned by that user from a few advanced categories he/she shouldn't handle after downgrading.

That works nice once the user is downgraded, but just by cancelling his/her premium subscription.

It doesn't happen if we just let expire that subscription.

We need to know where else should add our customization, in order to let all finished subscriptions to unpublish the content we want out once the user is no longer a premium account.

Besides, if we need it to publish again all that user's advanced content and ads, once his/her premium account is renewed, it would be nice to know where to handle this behavior too.

Thanks in advance for any advice you can provide us.

Best regards
Last edit: 10 years 1 month ago by jpif78@gmail.com.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
10 years 1 month ago - 10 years 1 month ago #249170 by krileon
Don't add your customization there. Use CBSubs SQL Actions if it's just a database query. If it's PHP API you need to execute then use CB Auto Actions and its Code action with the below initial setup.

Plan Active
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To A

Plan Expired
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To X

Once implemented re-install CBSubs Fields, apply the quickfix, and re-check if your field value reversal still isn't working. Note you could also use CB Auto Actions for this using Field actions if you wanted (2 actions, 1 for each state).


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.
Last edit: 10 years 1 month ago by krileon.

Please Log in or Create an account to join the conversation.

10 years 1 month ago #249723 by jpif78@gmail.com
Replied by jpif78@gmail.com on topic Bussiness subscription expire to Basic subscrption
Thanks again,

now it works, almost as expected. There's a last thing to be fixed though.

I've seen our auto-actions are now working but they require always a request by the user.

Is there a way to fire them to trigger on subsctiption expiration's real date?

Can our auto-actions be triggered by a cron scheduled task?
Or any other bundled functionality to provide automatic tasks over Paid Subscriptions?

We may deploy an external script to do so, but if possible, it would be nice to achieve this within our CB component.

Thanks a lot.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
10 years 1 month ago #249746 by krileon
Those triggers are fired by CBSubs when a plan state changes. That's how CB Auto Actions functions (acts on a trigger). It's possible to fire an action on CRON, but it's done through internal triggers, which have no CBSubs information.


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum