Show / activate plans during a defined period

13 years 2 months ago #151911 by giecie
I'm looking for the following set-up in CBSubs;

New member subscription plans;
Plan 1 = JANUARY = €175 (price 1 year)
Plan 2 = FEBRUARY = €160,42 (11/12 of 1 year)
Plan 3 = MARCH = €145,83 (10/12 of 1 year)
......
Plan 9 = SEPTEMBER = €58,33 (4/12 of 1 year)
Plan 10 = OCTOBER = €218,75 (1 year + 3/12 of 1 year)
Plan 11 = NOVEMBER = €204,17 (1 year + 2/12 of 1 year)
Plan 12 = DECEMBER = €189,58 (1 year + 1/12 of 1 year)

Update member subscription plan;
Plan 13 = upgrade for 1 year, only for members.

I can create all these plans and manual publish them per month via de back-end.
But is there an 'automatic' way to manage/configure the publication of these plans or is there maybe another implementation way?

Thanks.
Geert

Please Log in to join the conversation.

13 years 2 months ago #151942 by krileon

But is there an 'automatic' way to manage/configure the publication of these plans or is there maybe another implementation way?

Sure, you could use a cronjob for instance to publish. Better to simple enable/disable new registrations as users who paid and you simply unpublish would lose their paid access. You could also use professional subscriber incubator project CB Queries to perform a database query at various CB triggers to check the date and enable Plan XYZ based on that date as well. Example query as follows.

Enable:
UPDATE `#__cbsubs_plans` SET `allow_newsubscriptions` = 1 WHERE `id` = PLAN_ID AND `allow_newsubscriptions` = 0 AND MONTH( NOW() ) = MONTH_INTEGER

Disable:
UPDATE `#__cbsubs_plans` SET `allow_newsubscriptions` = 0 WHERE `id` = PLAN_ID AND `allow_newsubscriptions` = 1 AND MONTH( NOW() ) = MONTH_INTEGER

Simply replace PLAN_ID with the plan in question and MONTH_INTEGER with the month you want that plan to enable/disable.


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.

13 years 2 months ago #151956 by giecie
Thanks for your answer.

Do you have also an example of the cronjob syntax I can use?

Rgds,
Geert

Please Log in to join the conversation.

13 years 2 months ago #151966 by krileon

Do you have also an example of the cronjob syntax I can use?

Sorry, no I don't. I've never written cron scripts, but simply just know it's possible.


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.180 seconds

Facebook Twitter LinkedIn