Inserting Registration Info into Community Builder Profile

9 years 10 months ago #246313 by prcua
Hi Community Builder!
I have a very specific question.
I am using the CB multi-tab registration for a different part of my website and for another specific part of the site I would like to use an Acymailing registration module that subscribes users to a newsletter.
Then when users want to change their subscription they obviously access the community builder profile page and it is done correctly and everything is correctly synchronized with ACYmailing with the help of the plugin. However I did notice that when users register using acymailing, their address and phone for example don't show up in community builder's profile page. I did some research and I do understand that you should extensively use the community builder's login module and registration module for all the user info to show up.
But I have been working on some of my own code and used some other custom code and ideally what I would like to have is the address and phone from the acymailing registration module to populate that info into the Community builder profile.
Here is some code I am working with already:

function onAcyUserCreate($subscriber) {
jimport('joomla.user.helper');
$data = array(
"name"=>$subscriber->name,
"username"=>$subscriber->email,
"password"=>$subscriber->password,
"password2"=>$subscriber->password,
"email"=>$subscriber->email,
"cb_address"=>$subscriber->address,
"cb_city"=>$subscriber->city,
"block"=>0,
"groups"=>array("1","2")
);
$user = new JUser;
//Write to database
if(!$user->bind($data)) {
throw new Exception("Could not bind data. Error: " . $user->getError());
}
if (!$user->save()) {
throw new Exception("Could not save user. Error: " . $user->getError());
}
return $user->id;
}

I haven't done too much research and am not an expert php programmer, however I can image that I should call up that part of the cb database/user table such as cbimport (if it exists) and then as I mentioned in the code from above insert the data from the registration module into the cb user tables similarly: "cb_address"=>$subscriber->address,
"cb_city"=>$subscriber->city,

Any help is much appreciated.
If there is any type of sync hack/feature or link upon registration that would be much appreciated. Or even if it is not linked but just enters in the information upon registration, that could be good enough too.
THank you very much.

Please Log in to join the conversation.

9 years 10 months ago #246331 by krileon
You're registering a user with Joomla API. That won't register the user in CB. Your module should register the user using CB API as documented in the below tutorial in order for the user to be correctly created in CB.

www.joomlapolis.com/support/tutorials/120-api-usage/18362-registering-a-user-through-cb-api


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

Facebook Twitter LinkedIn