January 18, 2011 at 1:22 am #2527
hi, i could not find anything in the forums, but i’d like to integrate the affiliate registration with our crm in such a way that when a new affiliate is either registered or entered manually by the admin, the details are passed on to the crm. i think it would be an interesting feature, not only for batchbook, but also for sugarcrm or vtiger.
batchbook has its own api (https://github.com/batchblue/batchbook-php); would you be able to look at it and suggest how to go about it? if you’d like to develop it we can discuss this further, but for now i’d certainly appreciate suggestions!January 18, 2011 at 5:27 am #28127
I can tell you where in the affiliate plugin to put the code to send details to your CRM.January 19, 2011 at 1:28 am #28128
thanks for the reply!
sure, that would be a start: i think i can hack some of the functions from a plugin called CRM4wordpress to begin with, but as i’m a tinkerer rather than a programmer it might be safer if someone more experienced is giving me some input!January 19, 2011 at 5:11 am #28129
Which option are you using from here?January 19, 2011 at 4:28 pm #28130
i’m on the standalone version, but, just in case, i’ve got a multisite installation of WP. (haven’t tried what’s happening if i activate the plugin on more than one site though! – and would be curious to know whether every site would have its own affiliate database tables or if it goes all in one across the base WP installation)
an interesting thing which doesn’t make much sense in the registration: why the message ‘Affiliate account signup option is disabled. Please contact the admin.’ in register.php comes up at the bottom of the form?
[suggestion: as plugin improvement, surely you can catch if the flag is off already from the head of files and redirect to a page which doesn’t even display the signup form, or at least move it at the top of the page?]
how difficult would it be to implement an approval system for affiliate requests? i know that you have done every effort to make it non-spammy, but inevitably there will be some who exploit the system maliciously. something like the WP comment approval would be great!
by the way, do you have any plan to integrate the plugin with Magento?
thanksJanuary 20, 2011 at 4:39 am #28131
On a multisite setup when you use the “Network activate” each site will have a separate affiliate admin and stuff (it works like any other plugin on a multi site setup).
Yes I can redirect to another page but that requires the admin to setup an extra page (I try to make it so the admin needs minimum configuration). Yes moving the warning up on the page is definitely a good option. I will make this change.
“how difficult would it be to implement an approval system for affiliate requests?” – Its not very difficult but it involves a bit of coding as the database structure will need to be changed so the approval value can be stored with all the other details of the affiliate.
“do you have any plan to integrate the plugin with Magento?” – It depends if the software allows to do a 3rd party integration or not.January 21, 2011 at 10:35 pm #28132
Thanks for the tips. There is also another simple option to avoid confusing users when new registration is blocked: if you use div you can simply set it to hidden after checking the flag from the configuration and show your message.
Back to the original query, where should I look for to pass on the details of a new reg into the crm? I’ve got some functions to pass the stuff, but you will save me a lot of time if you can point me to where/ when data is inserted in the db after submission from both admin and from the reg form.January 22, 2011 at 5:55 am #28133
Open the “register.php” file from the “affiliates” directory and search for the following:
The code inside that if condition gets executed after the registration form is submitted so add your code to notify the 3rd party software where you see fit.February 22, 2011 at 11:56 am #28134
sorry, i’ve got another question about this: i looked at the file, but i am still a bit puzzled about it as i was expecting to be able to pull the content from the form fields but as far as i understand things are added in the db already at this point.
would you be able to give me a quick example of how you refer to the following from here without making a new database call interrogating the affiliate table?
i would need: first name, last name, email and affiliate id (then i’ve got a function which does the job of passing stuff to the other system).
many thanks!February 23, 2011 at 1:41 am #28135
Inside the “if” condition all the details of the person signing up is available to you. You can get the details you requested like the following:
$firstname = $_POST['afirstname'];
$lastname = $_POST['alastname'];
$affiliate_id = $_POST['user_name'];February 24, 2011 at 4:03 pm #28136
hi, this was great and very helpful!
one more question: obviously something similar is done when a user update their details. could you point me to where the update funcion is so that i can fire my update commands?
thanks!February 25, 2011 at 3:39 am #28137
Look in the “details.php” file. It will be inside the following code block:
if($_POST['commited'] == 'yes')February 25, 2011 at 7:19 pm #28138
spot on and very prompt as usual!! thanks.
can i just double check with you if i get things right: i want to check whether the current visitor is logged in. if i get it right there is a function you use is in the mics_functions?
i tried to echo the ccokie variable $_SESSION;
from the header.php, but it didn’t work… what is the the actual session variable? can i pull the logged in user ap_id and full name?
thanksFebruary 26, 2011 at 1:26 am #28139
You can retrieve the cookie value like the following:
The name is not stored in the cookie. You will need to make a database query to retrieve the record for this affiliate then find his name.February 28, 2011 at 1:35 pm #28140
hi, sorry, one more question as i’m double checking all the places where the add/edit details is fired.
if not the user, but the admin is adding/updating the details from the wordpress backend manually, could you please confirm where is the function(s) that does this?
another question which is coming to my mind is the following. i understand the logic about why you would want to have separate users for the affiliate programs and WP users, but don’t you think it would be quite easy for someone logged in as member to want to become affiliate?
how would you go about adding a third option in the front page asking something like ‘register using your WP user’: this is basically a check if the user is logged in WP, then check whether the users’ email is already in the AP table anfd, if yes log in automatically, otherwise and query the database user details and populate them into the affiliates reg form. does it make sense to you?
much appreciating your opinion and help so far!
- You must be logged in to reply to this topic.