"Cupon" System

12 years 3 months ago #188626 by bytekultur
"Cupon" System was created by bytekultur
Hello

First of all - very nice job you have done with the cbsubs!!! i really like!!!

Our costumer wishes to have to kind of subscriptionplans...
individula & institutional

- the individual is for one person - works perfect

- the institutional should be one person who registers his company and gets additional 5 loggins for free.. so 5 employes of his company can also get a login without paying...

is there a way we can make this with the cbsubs? we are also pretty good in php - so any tipps are welcome!

thanks and all the best,
Maya

Please Log in to join the conversation.

12 years 3 months ago #188674 by krileon
Replied by krileon on topic Re: "Cupon" System
You could use CBSubs SQL Actions in the institutional plan to dynamically generate 5 user limit coupons. Example of this as follows.
INSERT INTO `jos_cbsubs_promotions` ( `name`, `promotion_type`, `coupon_code`, `coupon_code_cbfield`, `coupon_description`, `discount_type`, `rate`, `currency`, `amount`, `stages`, `rate_cbfield`, `currency_cbfield`, `amount_cbfield`, `amount_cbfield_deduct`, `priority`, `exclusive_within_priority`, `show_also_zero_values`, `applies_to_first_payment`, `applies_to_recurrings`, `applies_to_registrations`, `applies_to_upgrades`, `applies_to_renewals`, `max_uses_total`, `max_uses_per_customer`, `buyer_geo_zone_id`, `applies_to_business_consumer`, `applies_to_items`, `plans_applied_to`, `plans_sametime_required`, `cond_1_operator`, `cond_1_plans_required`, `cond_1_plans_status`, `cond_1_purchase_ok`, `cond_1_date_1`, `cond_1_date_cbfield_1`, `cond_1_value_1`, `cond_1_dates_diff_a`, `cond_1_dates_diff_b`, `cond_1_date_2`, `cond_1_date_cbfield_2`, `cond_1_value_2`, `cond_2_operator`, `cond_2_plans_required`, `cond_2_plans_status`, `cond_2_purchase_ok`, `cond_2_date_1`, `cond_2_date_cbfield_1`, `cond_2_value_1`, `cond_2_dates_diff_a`, `cond_2_dates_diff_b`, `cond_2_date_2`, `cond_2_date_cbfield_2`, `cond_2_value_2`, `published`, `start_date`, `stop_date`, `usergroups`, `user_ids`, `ordering`, `cssclass`, `owner`, `params`, `integrations` ) VALUES ( 'Discount', 'coupon', MD5( RAND() ), 0, '', 'percentage', '100', '', '0', '', 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 5, 1, 0, 'A', 0, 'PLAN_ID_HERE', 'PLAN_ID_HERE', '', '', '', 0, '', 0, '', '=', '', 'value', 0, '', '', '', '', 0, '', 0, '', '', '', '', 0, '', 1, '0000-00-00', '0000-00-00', '29', '', 2, '', 0, '', '' );

With the above you'd need to replace PLAN_ID_HERE with the actual ID of the plan you want discounted. Of course this is just an example and have in no way tested it.

Alternatively depending on traffic of your site you could just create the coupons manually and give them to the institutes.


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.
The following user(s) said Thank You: bytekultur

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.327 seconds

Facebook Twitter LinkedIn