Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore F.A.Q/Instructions › iDev Affiliate and WP eStore Integration
Tagged: affiliate, iDev Affiliate Integration, integration
- This topic has 23 replies, 5 voices, and was last updated 13 years, 7 months ago by amin007.
-
AuthorPosts
-
April 19, 2010 at 1:28 am #880amin007Participant
If you want to integrate iDev Affiliate (iDevDirect – http://www.idevdirect.com) with WP eStore then follow this tweak.
1. Open the “paypal.php” file and search for the following line of code:
$this->debug_log('Updating Affiliate Database Table with Sales Data if Using the WP Affiliate Platform Plugin.',true);
2. Once you find it add the following block of code just above that line:
$profile = "72198";//Specify your profile number
$ip = $customvariables['ip'];
$sale_amount = $this->ipn_data['mc_gross'];
$order_num = $this->ipn_data['txn_id'];
$prepared_url = "http://www.site.com/idevaffiliate/sale.php?profile=".$profile."&idev_saleamt=".$sale_amount."&idev_ordernum=".$order_num."&ip_address=".$ip;
$this->debug_log('Adding iDev commission. Prepared URL = '.$prepared_url,true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $prepared_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);You will need to change “72198” with your actual profile number and “www.site.com” with the appropriate URL.
Now, run a test traction and make sure everything is working.
April 19, 2010 at 1:58 am #19799MikeMMemberOK, I think it seems to be working Thanks. Now of course I am going to ask for more
Any way to get the customer name and the product name that they ordered? I know in DLGuard iDev added:
&idev_option_1=%%customername%%&idev_option_3=%%productname%%
So would replacing the %%customername%% and %%productname%% variables with yours send back that information?
Thanks for all this help by the way, I really appreciate it.
MikeM
April 19, 2010 at 11:23 pm #19800amin007ParticipantYou can get the customer name like the following:
$customer_name = $this->ipn_data['first_name']." ".$this->ipn_data['last_name'];
Getting the product name is a bit tricky… product name will work fine for one product purchase but what will you do for a cart checkout where there will be multiple products in the shopping cart?
April 20, 2010 at 12:57 pm #19801MikeMMemberWould you put the customer name code in the $prepared_url string or in the line above it? Or both?
Thanks.
MikeM
April 20, 2010 at 10:50 pm #19802amin007ParticipantYeah you will need to add the customer name from the variable to the URL… so the prepared URL will become like the following:
$prepared_url = "http://www.site.com/idevaffiliate/sale.php?profile=72198&idev_saleamt=".$sale_amount."&idev_ordernum=".$order_num."&ip_address=".$ip."&idev_option_1=".$customer_name;
April 20, 2010 at 10:59 pm #19803MikeMMemberCool. I’ll give it a try tonight.
Thanks.
MikeM
April 21, 2010 at 12:40 am #19804MikeMMemberOK, I tried the code and I am not getting the customer name, so just to make sure I have it right, here is exactly what I put in the paypal.php:
_____________________________________________
$ip = $customvariables;
$sale_amount = $this->ipn_data;
$order_num = $this->ipn_data;
$customer_name = $this->ipn_data.” “.$this->ipn_data;
$prepared_url = “http://site.com/idevaffiliate/sale.php?profile=72198&idev_saleamt=”.$sale_amount.”&idev_ordernum=”.$order_num.”&ip_address=”.$ip.”&idev_option_1=”.$customer_name;
$this->debug_log(‘Adding iDev commission. Prepared URL = ‘.$prepared_url,true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $prepared_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
_________________________________________________________
I am getting the transaction id and sale amount, so that works, just not passing the name.
Thanks.
Mike M
April 21, 2010 at 3:51 am #19805amin007ParticipantThe code looks fine to me… please run the transaction with debug enabled then look for the following text in the debug file:
Adding iDev commission. Prepared URL
Let me know what the “Prepared URL” is.. I am pretty sure the customer name is getting appended to the URL but if you have configured iDev to use it properly is a different question.
April 21, 2010 at 1:07 pm #19806MikeMMemberActually, I see it is recording the first name, but not the last. Not sure how I missed that, but I will send a help ticket to iDev with the details and see what they have to say about the last name.
Thanks.
Mike M
April 21, 2010 at 7:36 pm #19807MikeMMemberHere is what the iDev support said as to why the last name is not showing up:
________________________________________
Well this is being chopped.
idev_option_1=Flo Murphy
You’d need this to be sent using standard HTML.
idev_option_1=Flo%20Murphy
%20 would be a space.
Try HTML entities or some other piece of code to conver the data before assigning it to a URL.
__________________________________________
Is that easily doable?
Thanks.
MikeM
April 22, 2010 at 5:23 am #19808amin007ParticipantYeah, modify the customer name variable to use the following:
$customer_name = $this->ipn_data['first_name']."%20".$this->ipn_data['last_name'];
April 22, 2010 at 1:06 pm #19809MikeMMemberThanks. That worked.
Mike M
May 16, 2010 at 7:29 pm #19810williamMemberHi,
I too bought iDevAffiliate to enable my Affiliates to have 1 admin centre across
my multiple websites. Do I understand correctly that I need to modify the WP eStore php files (mentioned above) on all the domains I am tracking sales/leads for?
(logic says yes). If so, can I modify 1 lot and then copy it across or are php files website specific. I am not much of a programmer so not sure if php files contain certain values that are updated.
Thanks for your help.
William
May 17, 2010 at 3:38 am #19811amin007ParticipantYou can modify one PHP file and copy it accross to all your sites.
May 23, 2010 at 2:30 am #19812williamMemberSorry, I must be missing a step somewhere.
What integration method should I choose on the iDev side? I cannot see WP eStore in the
looong list, choosing Paypal BuyNow & Subscriptions requires a php page, and the
only other option I see is Generic Tracking Pixel; which I saw you addressed in another post as not working.
Thanks for your insights.
Regards,
William
-
AuthorPosts
- You must be logged in to reply to this topic.