Tips and Tricks HQ Forum

Support Forum for Tips and Tricks HQ Products

Register or log in - lost password?

Search the Forum

Tips and Tricks HQ Forum » WP eStore Forum » WP eStore F.A.Q/Instructions

iDev Affiliate and WP eStore Integration

(23 posts) (5 voices)
  • Started 1 year ago by amin007
  • Latest reply from amin007
  • Related Topics:
    1. eStore, eMember, Affiliate Platform, pdf Stamper, and mailchimp integration
    2. Integration with Affiliate, eStore, and e Member
    3. I noticed there is MailChimp integration with eStore, how about WP-Affiliate?
    4. WP eStore and JROX JAM Affiliate Manager Integration
    5. eStore/PDF Stamper/Wordpress v3.21/MailChimp/ and now ---->goMobi integration

Tags:

  • iDev Affiliate Integration
123Next »
  1. amin007
    Key Master

    If you want to integrate iDev Affiliate (iDevDirect - http://www.idevdirect.com) with WP eStore then follow these set of tweaks. Our objective here is to pass the customers IP address so a commission can be awarded from the post payment processing script.

    The latest version of WP eStore plugin already passes the IP Address to the post payment processing script so no need to worry about that.

    Open the "paypal.php" file and search for the following line:

    $this->debug_log('Updating Affiliate Database Table with Sales Data if Using the WP Affiliate Platform Plugin.',true);

    Once you find it add the following bit of code just above that line:

    $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=72198&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);

    Now, run a test traction and make sure everything is working.

    Posted 1 year ago #
  2. MikeM
    Member

    OK, 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

    Posted 1 year ago #
  3. amin007
    Key Master

    You 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?

    Posted 1 year ago #
  4. MikeM
    Member

    Would you put the customer name code in the $prepared_url string or in the line above it? Or both?

    Thanks.

    MikeM

    Posted 1 year ago #
  5. amin007
    Key Master

    Yeah 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;
    Posted 1 year ago #
  6. MikeM
    Member

    Cool. I'll give it a try tonight.

    Thanks.

    MikeM

    Posted 1 year ago #
  7. MikeM
    Member

    OK, 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['ip'];
    $sale_amount = $this->ipn_data['mc_gross'];
    $order_num = $this->ipn_data['txn_id'];
    $customer_name = $this->ipn_data['first_name']." ".$this->ipn_data['last_name'];
    $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

    Posted 1 year ago #
  8. amin007
    Key Master

    The 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.

    Posted 1 year ago #
  9. MikeM
    Member

    Actually, 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

    Posted 1 year ago #
  10. MikeM
    Member

    Here 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

    Posted 1 year ago #

RSS feed for this topic

123Next »

Reply »

You must log in to post.

Tips and Tricks HQ Forum is proudly powered by bbPress

Tips and Tricks HQ  | WP Shopping Cart  | WP Affiliate Software  | WordPress Membership Plugin