March 14, 2010, 11:58:23 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to JROX.COM Forums! 
 
Pages: 1 2 3 [4]
  Print  
Author Topic: Showing your Affiliate's Name on a Web Page  (Read 21296 times)
electric
Newbie
*
Offline Offline

Posts: 45


View Profile
« Reply #45 on: May 11, 2008, 01:28:38 AM »

I'm wondering if you might have a php hack that does the same thing, but gets the cookie value for referrer ID, pulls the entire row of data from the DB for that referrer, and then allows echoing of referrer's name and referrer's ID in a way that would work even if used in a hidden form field, enclosed in quotes, like...

<input type="hidden" name="referrername" value="<?php print $fname; ?>">

I am looking for exactly the same thing. 

Basically, I would like have some PHP code on my "landing page" to use the affiliate info to display customized pricing and information to the visitor, depending on the referring affiliate.

Can you tell me how to do this?

For example:

- Visitor hits my homepage, using affiliate link.
- Homepage "looks up" the affiliate ID in my database and retrieves custom pricing for my products
- Homepage is displayed, with custom pricing.
- Visitor makes purchase using custom pricing.
- Affiliate gets credit for 50% of the sale price.

Is that possible? It is the 2nd step that I need help with, as I don't know how to "get" the affiliate info in usable PHP variable.  Perhaps there is a simple PHP script I can include on my page that will:

- Check for affiliate cookie
- If found, make available various jam variables such as "$jam_aff_id", "$jam_aff_name", etc..
- If not found, then my script would test to see that $jam_aff_id is empty.

Let me know...

Thanks!

Logged
jroxadmin
JROX Admin
Administrator
Advanced Member
*****
Offline Offline

Posts: 7223



View Profile WWW Email
« Reply #46 on: May 11, 2008, 02:28:37 AM »

it is possible, but you would have to custom code that entire function yourself, as JAM is not directly integrated into any shopping cart, so it cannot retrieve pricing for any product.

the affiliate cookie stores the affiliate ID, like this:

1000%23%23%231%23%23%230%23%23%230%23%23%23Unknown

you would first have to write some code to extract the ID:

Code:
$user = explode('###', urldecode($_COOKIE['jrox']));

$member_id = $user[0];

you can now use the member ID in variable $member_id
Logged

Want a Completely Integrated eCommerce System?
JEM = Shopping Cart, Affiliate Marketing, Content Manager, Help Desk, All-In-One!
www.jrox.com
electric
Newbie
*
Offline Offline

Posts: 45


View Profile
« Reply #47 on: May 11, 2008, 03:52:46 AM »

It is no problem for me to write the function that gets pricing from my database, once I have the affiliate ID.

What I don't know how to do is get all the JAM variables from your cookie.

Is that something you can provide?

Basically, what would be really nice is if you could modify the existins showaff.php file that is included with the JAM core files (maintained by you) so that we can use it as a simple "include file" that we can 'include' in our own landing page script, which retrives all the cookie values into a PHP array called $jam_affiliate.

So for example, in our landing page we could then have something like this:

Code:
// The showaff.php file is provided by JROX.
$jam_do_cookies = true; // Tell showaff.php what we want to do.
include('your_affiliate_directory/showaff.php');

// If array exists, it means a cookie was found.
if (isset($jam_affiliate)) {
  echo $jam_affiliate['fname']; // First name
  echo $jam_affiliate['name']; // Username
  echo $jam_affiliate['website']; //Website
  echo $jam_affiliate['customid']; // Custom ID
  echo $jam_affiliate['ID']; // Affiliate ID 
  echo $jam_affiliate['whatever_else_is_stored_in_cookie'];
}
else {
  echo "No affiliate cookie exists.";
}

The "$jam_do_cookie = true;" part right before the include is to tell your showaff.php script that we want to create only the PHP variable and no javascript, etc.  This way, the showaff.php script can remain backwards compatible...

I hope that makes sense.  It's nice and simple (only one included file is needed in our script), the variable names won't conflict with our own code, it's backwards compatible with the existing showaff.php file, and presto.. we can immediately access the JAM affiliate variables with our own landing page PHP scripts.

Let me know what you think.  I believe this would add some good value to JAM.

Thanks!
« Last Edit: May 11, 2008, 04:07:22 AM by electric » Logged
jroxadmin
JROX Admin
Administrator
Advanced Member
*****
Offline Offline

Posts: 7223



View Profile WWW Email
« Reply #48 on: May 11, 2008, 04:07:18 AM »

in showaff.php, you can add the following lines:

Code:
if (!empty($show_jrox))
{
$cookie_sponsor = explode('###', urldecode($show_jrox));
$id = $cookie_sponsor[0];
       
        //added
        $pid = $cookie_sponsor[1];
        $tool = $cookie_sponsor[2];
        $tool_id = $cookie_sponsor[3];
       
        if (count($cookie_sponsor) == 6)
        {
           $tracker = $cookie_sponsor[4];
           $ref_site = $cookie_sponsor[5];
        }
        else
        {
            $ref_site = $cookie_sponsor[4];
        }



if (is_numeric($id))
Logged

Want a Completely Integrated eCommerce System?
JEM = Shopping Cart, Affiliate Marketing, Content Manager, Help Desk, All-In-One!
www.jrox.com
electric
Newbie
*
Offline Offline

Posts: 45


View Profile
« Reply #49 on: May 11, 2008, 04:10:30 AM »

Hello,

Thanks.  I just modified my post quite a bit..

I was really hoping that you might want to add this functionality to the showaff.php file.  This way, if anything changes in the future our scripts won't break, etc.

The change I did in my post above would be backwards compatible with the existing showaff.php file....

Is that something you can do? 

(I'm just very concerned that if we modify the showaff.php file ourselves, then we run the great risk of having things break in the future if cookie storage system is chanaged.  Since you already maintain the showaff.php file to output javascript values, I figured it makes sense to also allow it to create PHP values that we can use in our own scripts.

Let me know what you think. The code sample I provided above would be perfect.

Thanks!
Logged
jroxadmin
JROX Admin
Administrator
Advanced Member
*****
Offline Offline

Posts: 7223



View Profile WWW Email
« Reply #50 on: May 11, 2008, 04:27:41 AM »

we can add this to a later update for JAM.
Logged

Want a Completely Integrated eCommerce System?
JEM = Shopping Cart, Affiliate Marketing, Content Manager, Help Desk, All-In-One!
www.jrox.com
electric
Newbie
*
Offline Offline

Posts: 45


View Profile
« Reply #51 on: May 11, 2008, 04:42:12 AM »

we can add this to a later update for JAM.
OK, great!  You know I'm going to ask... any idea on an eta?

I'm developing our website right now, and the ability to "see" the affiliate cookie info so we can display custom pricing to the visitor is critical.

Smiley
Logged
jroxadmin
JROX Admin
Administrator
Advanced Member
*****
Offline Offline

Posts: 7223



View Profile WWW Email
« Reply #52 on: May 11, 2008, 04:45:33 AM »

there is no ETA, as we will just add it to the to-do list.

you can always edit it yourself now if you need the functionality.
Logged

Want a Completely Integrated eCommerce System?
JEM = Shopping Cart, Affiliate Marketing, Content Manager, Help Desk, All-In-One!
www.jrox.com
obertancat
Newbie
*
Offline Offline

Posts: 13



View Profile Email
« Reply #53 on: June 26, 2008, 08:42:56 AM »

Very cool. This thing looks better and better.
Logged
darkkean
Newbie
*
Offline Offline

Posts: 5


View Profile Email
« Reply #54 on: December 03, 2009, 09:36:55 AM »

Hi.. this is cool! However, I would like to ask if you know any code that can be used for PHP ECHO.
I mean basically, the idea is the same just like the Javascripts provided here, but only converted in to a PHP format that can be used for ECHO function.

Thanks a lot!
Logged
dmwelch
Advanced Member
***
Offline Offline

Posts: 208

Knowledge is Power


View Profile Email
« Reply #55 on: December 04, 2009, 08:02:57 AM »

The code provided here IS php... not javascript.
Logged

For general JAM help/customizations contact via e-mail at dwbiz05@yahoo.com or PM me here. I am affordable. Smiley
Pages: 1 2 3 [4]
  Print  
 
Jump to: