Skip to Content Skip to Menu

CBSUBS and pricing options - some options to require approval, one not

  • wintercorn
  • wintercorn
  • OFFLINE
  • Posts: 183
  • Thanks: 19
  • Karma: 2
1 month 3 weeks ago #342586 by wintercorn
I'm simplifying the workflow for a client as we have a plan for each sub level currently. The plan is to have a single plan and reg form with pricing options for each sub level.

However one level must be automatically allowed without admin approval. The others require a committee decision.

Query : 

eg. In the screenshot attached could option 'one' be automatically approved whilst 'two' and 'three' require admin approval. Can this be done with Auto Actions?

Thanks
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50113
  • Thanks: 8576
  • Karma: 1468
1 month 3 weeks ago #342590 by krileon
That should be doable since the option selection is stored with the basket, the subscription, and POST data so it's possible to pull that value from either in CB Auto Actions. The main issue will be how you've defaults setup. You'd need to have admin approval enabled by default in CB > Configuration > Registration so that you're turning it off rather than on.

As for what trigger to act on. Probably best to do this the same way CBSubs does. Directly before registration is completed. So the onCPayBeforeUserRegistration trigger should work here. It has limited information in it as follows.
Code:
$_PLUGINS->trigger( 'onCPayBeforeUserRegistration', array( &$chosenPlans, $row ) );

Basically only have the array of plans selected in addition to the user being registered. So this is doable, but it will take PHP experience as you'll be overriding the registration behavior of CBSubs. For example the below will force the registration approved, but needs additional checks like checking the option selection from POST data.

Global
Triggers: onCPayBeforeUserRegistration
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
Code:
global $ueConfig; $ueConfig['reg_admin_approval'] = 0; return true;
Output
Display: return


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