Zen Cart Logo
Forums / General Questions / Affiliate Trail Integration

Affiliate Trail Integration

Locked

Views: 1,078

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
25 Jul 2010, 10:28 PM
#1
adrielgreene avatar

adrielgreene

New Zenner

Join Date:
Jul 2010
Posts:
7
Plugin Contributions:
0

Affiliate Trail Integration

Hello ZenCart Community!

I've recently installed Zencart v1.3.9d with no addons.

I am attempting to integrate a 3rd party affiliate program called Affiliate Trail to my shop. The integration seems simple enough, I just add this code to my confirmation page:

<img src="http://www.yourdomain.com/affiliate/scripts/sale.php?TotalCost= XXXXXX.XX&OrderID=XXXXXX&ProductID=XXXXXX" width=1 height=1>

Where src="the page on my domain"
Where TotalCost= the orders total cost

OrderID and ProductID aren't neccesary so the new code looks like:

<img src="http://www.yourdomain.com/affiliate/scripts/sale.php?TotalCost= XXXXXX.XX" width=1 height=1>

My question is therefore:

What is the variable that Zencart uses as a "TotalCost" once an order is confirmed? :blink:

26 Jul 2010, 6:39 AM
#3
adrielgreene avatar

adrielgreene

New Zenner

Join Date:
Jul 2010
Posts:
7
Plugin Contributions:
0

Re: Affiliate Trail Integration

I've tried and I've gotta say - they are slow to respond. I'm also a bit afraid of a standard "use the total cost variable for ZenCart" message instead of a strait answer.

26 Jul 2010, 6:50 AM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Affiliate Trail Integration

They are quick to list Zen Cart compatibility in one area of their site, but when it gets down to the actual list, ZC ain't there.

Just because particular shopping cart is not listed, do not worry, the chances are that XxYyZz product will work 100%does not make me feel too confident.

I'd also be concerned about the product working with newer versions of PHP and MySql.

26 Jul 2010, 8:27 AM
#5
adrielgreene avatar

adrielgreene

New Zenner

Join Date:
Jul 2010
Posts:
7
Plugin Contributions:
0

Re: Affiliate Trail Integration

That lack of confidence is legitimate.

"As stated earlier virtually 100% of shopping carts will work with Affiliate Trail"

Tried to set this up for a friend using Godaddy Quick shopping cart and it was a no go. Their cart allows you to add some variables in the receipt, just not the total cost. Affiliate Trail should state this conditional.

27 Jul 2010, 9:32 AM
#6
adrielgreene avatar

adrielgreene

New Zenner

Join Date:
Jul 2010
Posts:
7
Plugin Contributions:
0

Re: Affiliate Trail Integration

Just received a response from affiliate trail. I haven't tested it yet but I will be confirming asap for others:

"

  1. Locate the following file: /zencart/tpl_checkout_success_default.php.
  2. Find this code in the file: fields['orders_id']; ?>
  3. Copy/Paste the following code into the file (just under "fields['orders_id']; ?>")

$affcode = $db->Execute("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '".(int)$orders->fields['orders_id']."' AND class = 'ot_subtotal'");
$var1 = (number_format($affcode->fields['value'],2));
$var2 = $affcode->fields['orders_id'];
echo ("<img src="http://YOURSITE.com/affiliate/scripts/sale.php?TotalCost=$var1&OrderID=$var2" width=1 height=1>");

NOTE: Do not forget to edit last line in this code - http://YOURSITE.com should be replaced with your URL where you installed Affiliate Trail.
"

27 Jul 2010, 10:05 AM
#7
adrielgreene avatar

adrielgreene

New Zenner

Join Date:
Jul 2010
Posts:
7
Plugin Contributions:
0

Re: Affiliate Trail Integration

Closest thing I've found to "fields['orders_id']; ?>" in tpl_checkout_success_default.php was "$zv_orders_id; ?>". Perhaps this version of zencart uses a different variable. I'm going to ask there techs what they think but I'm going to go ahead and test it to see what happens. Will post with a new update soon.

27 Jul 2010, 4:24 PM
#8
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,809
Plugin Contributions:
15

Re: Affiliate Trail Integration

AdrielGreene:

  1. Locate the following file: /zencart/tpl_checkout_success_default.php.
    Just that one line lets me know they don't have a clue.:censored:

You may want to remind them that this file was modified with the release of 1.3.9 -- BUT -- that variable did not change:no:

29 Jul 2010, 2:39 PM
#9
adrielgreene avatar

adrielgreene

New Zenner

Join Date:
Jul 2010
Posts:
7
Plugin Contributions:
0

Re: Affiliate Trail Integration

I can confirm that the total cost and order variables are called by there code. I'm having an issue still though I don't think its ZenCart related. If it is a little cookie issue as I suspect I'll repost with some advice for anyone else searching for answers.

24 Aug 2010, 9:58 AM
#10
adrielgreene avatar

adrielgreene

New Zenner

Join Date:
Jul 2010
Posts:
7
Plugin Contributions:
0

Re: Affiliate Trail Integration

Great news everyone! I have affiliate trail configured and working! After the above was done I couldn't get affiliate trail to recognize sales. Ultimately I made a new account on my shop that had a different email from the one signed up in affiliate trail and that seems to have done the trick! Once I've used it for some time I'll come back here and let the community know what I think of it.
:clap: