Skip to Content Skip to Menu

cb_Code triggers in cbSubs

13 years 6 months ago #160957 by bruceisaacson
cb_Code triggers in cbSubs was created by bruceisaacson
Greetings,
I have a joomla (1.5.22) project using CB(1.3.1), CBSubs(1.1.2) and EventList. I have successfully used CBCode to trigger a PHP script OnAfterUserRegistration. I'd like to know if there is an equivalent trigger in CBSubs that would be OnAfterPlanRegistration. This would allow a script to be run after a user successfully registers for a plan ( including payment verification.)
If there is no such trigger, is it feasible to make one?
The goal is to have a button on a user( read performer)'s profile page that will take the live musical performance event ID from EventList, couple it with the user (read viewer)'s ID, the performer's ID,, and the Plan ID and call a script to store a customized version of a canned video player embed code in a field in the viewer's record. Whew!
Any help will be very much appreciated.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
13 years 6 months ago #161010 by krileon
Replied by krileon on topic Re: cb_Code triggers in cbSubs
CBSubs triggers are not currently available for public usage. However CBSubs URL provided with CBSubs package does the same as CB Code, but acts on plan activation, deactivation, etc...


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.

13 years 6 months ago #161027 by bruceisaacson
Replied by bruceisaacson on topic Re: cb_Code triggers in cbSubs
Thanks for the reply.
How would I get the user ID, Plan ID and the ID of current profile page user into my script? Is this a _POST array?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
13 years 6 months ago - 13 years 6 months ago #161036 by krileon
Replied by krileon on topic Re: cb_Code triggers in cbSubs
It works in the same manner as CB Code where you can pass variables with the URL or making a POST request and accessing through $_POST. As stated in CBSubs URL backend the below substitutions can be used.

"You can also use: [plan_id], [subscription_id], and where applicable (replaced by a 0 if not available): [replaced_plan_id], [parent_plan_id], [parent_subscription_id]"

Standard substitutions of [user_id] for example still work of course.


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: 13 years 6 months ago by krileon.

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

13 years 6 months ago #161381 by bruceisaacson
Replied by bruceisaacson on topic Re: cb_Code triggers in cbSubs
Thanks for your reply.
As a test, I have entered a URL ( www.mywebsitename.com/postexaminer3.php ) in the Plan-Integrations-URL-First Subscription Activation slot that calls a simple script (postexaminer3.php) that places a string in a text file in the root directory.

<?php //postexaminer3.php
$fp=fopen("thepostexaminer3.txt",'w');
fwrite($fp, "This is the postexaminer3.txt file, and I hope it got called by the CB Subs URL option.");
fclose($fp);
?>

When I have a new user register (front end) for that plan, I hoped I would get the text file created. However, I get no file generated. I set the method to POST, with just [first_name] as the field name. This same code worked well when I used it with the CB Code OnAfterRegistration trigger.
I know I must be doing something wrong. Can you help?
Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
13 years 6 months ago #161392 by krileon
Replied by krileon on topic Re: cb_Code triggers in cbSubs
Not sure what to advise. Reviewing source they work exactly the same. CBSubs will only trigger its usage on plan activation, this means a complete and successful subscription.

Many situations could be preventing this such as CBSubs URL not being published, user paying with Offline Payment and has not gotten their basket paid, free lifetime plan when CBSubs is not configured to create subscriptions for free lifetime plans, URL not structured properly, etc..

Please always ensure debug mode is enabled and error reporting is set to maximum in Joomla global configuration when testing.


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