Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › WP eStore and JROX JAM Affiliate Manager Integration
- This topic has 12 replies, 5 voices, and was last updated 9 years, 7 months ago by admin.
-
AuthorPosts
-
January 9, 2010 at 2:51 am #638amin007Participant
Update: There is now an addon for this (no need to manually modify any code):
https://www.tipsandtricks-hq.com/ecommerce/jrox-jam-affiliate-software-integration-addon-3601
===========================
1. Open the “wp_eStore1.php” file and find the following function:
function eStore_get_custom_field_value()
once you find it just add the following towards the end of the function (just before the return statement):
$name = 'jrox_cookie';
$value = $_COOKIE['jrox'];
$custom_field_val = append_values_to_custom_field($name,$value);2. Open the “eStore_payment_submission.php” file and find the following function:
function eStore_get_custom_field_value1()
once you find it just add the following towards the end of the function (just before the return statement):
$name = 'jrox_cookie';
$value = $_COOKIE['jrox'];
$custom_field_val = append_values_to_custom_field($name,$value);That will add it to the custom field.
3. Now 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 that line add the following bit of code just before that line:
$sale_amt = $this->ipn_data['mc_gross'];
$trans_id = $this->ipn_data['txn_id'];
$jrox_cookie = $customvariables['jrox_cookie'];
$JAMIntegrate = file_get_contents("http://www.mydomainname.com/affiliates/sale.php?amount=".$sale_amt."&trans_id=".$trans_id."&custom_mid=".$jrox_cookie);
$this->debug_log('Awarding JROX affiliate commission.',true);Don’t forget to change “www.mydomainname.com” with your own domain name.
That should do it.
March 5, 2010 at 6:09 pm #17098thomasMemberJAM integration! Is there a way to award the affiliates via manual chechout as well?
Can you post that code and where to place it?
Thanks a lot!
March 6, 2010 at 3:47 am #17099amin007ParticipantIn the “eStore_payment_submission.php” there is a place for awarding commission to “WP Affiliate Platform” so search for the following comment in that file:
//Award Affiliate Commission
and replace the commission awarding of “WP Affiliate Platform” to do the JROX Affiliate awarding. The following bit of code should do it.
$sale_amt = $_SESSION;
$trans_id = “”;//Use some unique ID
$jrox_cookie = $_COOKIE;
$JAMIntegrate = file_get_contents(“http://www.mydomainname.com/affiliates/sale.php?amount=”.$sale_amt.”&trans_id=”.$trans_id.”&custom_mid=”.$jrox_cookie);
$this->debug_log(‘Awarding JROX affiliate commission.’,true);
March 6, 2010 at 11:22 am #17100thomasMemberThank’s amin!
It’s working, but:
1.Error:
$this->debug_log(‘Awarding JROX affiliate commission.’,true);
The “eStore_payment_submission.php” file dosen’t know the debug_log and I think, the “$this” is not allowed at that code-position.
Please Help!
2.Send custum variables to Jrox:
Jrox-Jam has up to 5 custom variables like “$jrox_svalue_1”
I need to submit the “customer_email” to JAM.
That’s the only way to identify the affiliate, when a customer doesn’t transfer the money.
Please help me with that !
Thank’s Thomas
March 6, 2010 at 4:30 pm #17101thomasMemberMy solustion is running, except the “debug-thing”!
What I did:
<br />
// Start - Award Jrox Affiliate for Manual Checkout<br />
$sale_amt = $_SESSION['eStore_cart_sub_total'];<br />
$trans_id = "Bank-Manuell";<br />
$jrox_cookie = urlencode($_COOKIE['jrox']);<br />
$payer_email = $_POST['customer_email'];<br />
$JAMIntegrate = file_get_contents("http://www.mydomain.com/affiliates/sale.php?amount=".$sale_amt."&trans_id=".$trans_id."&custom_mid=".$jrox_cookie."&jrox_svalue_1=".$payer_email);<br />
//$this->debug_log('Awarding JROX affiliate commission.',true);<br />
// End - Award Jrox Affiliate for Manual Checkout<br />First, I needed to “urlencode” the cookie, to get the cookie-information into Jrox-JAM. (before I got only the affiliate-ID but not the rest (adtracker-info, referrer-website)
Second, I avtivated the custom_variable in JAM (system integration) for the “customer_email_address”.
Third, I added the code-elements for the $payer_email
Now I need to change that in paypal.php for paypal-payment as well. But that should be no problem anymore.
Greetings,
Thomas
PS: Be careful with custom-values where the content can include “space” (eg. name). You need to trim that. Otherwise you get an ERROR.
March 6, 2010 at 11:32 pm #17102amin007ParticipantOkay when I copied and pasted the code I made a little mistake
The following line should not be in the “eStore_payment_submission.php” file:
$this->debug_log(‘Awarding JROX affiliate commission.’,true);
That line is in the “paypal.php” file to output information to the debug file.
September 17, 2010 at 1:44 pm #17103julienMemberHello, i tried to make the edits but it doesn’t work,
i’m unsure about where to pleace each piece of code, can you please provide the php files ?
September 18, 2010 at 6:56 am #17104amin007ParticipantDid you change the “http://www.mydomainname.com” to your own domain name? Sometimes users miss this step.
Anyway, I sent you the files.
March 4, 2015 at 9:05 pm #17105PattyGaleMemberAre there updated instructions for this?
The reason I ask is because I got to Step 2 and can not find the code:
function eStore_get_custom_field_value1() anywhere in the eStore_payment_submission.php file.
And I just saw in the Changelog that with Version 7 of WP eStore, there is simple integration with JROX JAM.
Thanks!
March 5, 2015 at 2:30 am #17106adminKeymasterI will try to make a little addon for this so you don’t have to do any code modification.
March 5, 2015 at 12:08 pm #17107PattyGaleMemberAn addon would be great! Thank you!
March 8, 2015 at 3:40 am #17108PattyGaleMemberJust curious as to if you have a time frame for the JROX JAM addon? I’m going to be working on integration in the products and affiliate integration in the next few weeks.
March 9, 2015 at 2:58 am #17109adminKeymaster -
AuthorPosts
- You must be logged in to reply to this topic.