ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Need help with displaying Affiliate name on screen
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Need help with displaying Affiliate name on screen

 Post Reply Post Reply
Author
Message
Andy @ Landmarq View Drop Down
Newbie
Newbie
Avatar

Joined: 12-November-2008
Location: London
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy @ Landmarq Quote  Post ReplyReply Direct Link To This Post Topic: Need help with displaying Affiliate name on screen
    Posted: 02-April-2009 at 8:55am
Afternoon fellow 'carters

I am trying to set up a site for use with the affiliate feature but I want the Affilate company name to display when an affilate link is clicked.

The idea being if someone just arrives on out site it's says one message but if it's an affiliate link it will add their name to the end. I have been using the code below which is a modified version of how I display a logged in customers name on the screen on my main site but having trouble pinning down the fields needed for this to work.

<% if session("IDAffiliate")<>"0" then %>
<% response.write "<h2>&nbsp;&nbsp;In partnership with Landmarq Technologies Limited & " & session("pcSFCompany") & "</h2>" %>
<% else %>
<% response.write "<h2>&nbsp;&nbsp;In partnership with Landmarq Technologies Limited</h2>" %>
 <% end if %>

The IDAffiliate should be able to pick which affiliate is being used and then the company name gets displayed but I cannot get the company name to display or get it to properly detect the difference between a regular vist and an affiliate vist.

Any help on this would be great I'm pretty sure im on the right track but it's the fields tat need tweaking.

Thanks in advance for any replies :)
Need a bespoke PC built to order? come to www.landmarq.co.uk
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 02-April-2009 at 9:08am
Hi Andy,
     You will need to get the "affiliatecompany" from the "affiliates" table of the database with some SQL. See NewAffa.asp for the code that inserts it in the table.
Back to Top
Andy @ Landmarq View Drop Down
Newbie
Newbie
Avatar

Joined: 12-November-2008
Location: London
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy @ Landmarq Quote  Post ReplyReply Direct Link To This Post Posted: 02-April-2009 at 9:19am
Hi Hamish,

Thanks for the pointers :)

I thought I might but did not have much luck intially will give it another whirl, I was using newaffa.asp as a reference point to get the table names.


Need a bespoke PC built to order? come to www.landmarq.co.uk
Back to Top
Andy @ Landmarq View Drop Down
Newbie
Newbie
Avatar

Joined: 12-November-2008
Location: London
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy @ Landmarq Quote  Post ReplyReply Direct Link To This Post Posted: 02-April-2009 at 11:44am
Being the SQL thickie that I am I have got to this, I am manually using affiliate 2 as it's a test one but I will need to find how to detect which idaffiliate is being used on the link I guess I'm still missing something as the IF statement shows the first line but the company is not being shown. Any more pointers to get me on track would be great :)

<!--#include virtual="shop/includes/opendb.asp"-->
<%
call openDB()
query="SELECT idaffiliate, affiliatecompany FROM affiliates WHERE idaffiliate=2"
set rstemp=conntemp.execute(query)
session("affid")=rstemp("idAffiliate")
Session("affcomp")=rstemp("affilatecompany")
%>
    <div id="logo">
      <h1><img src=images2/shutlogo.png></h1>
  <% if session("affid")<>"0" then %>
    <% response.write "<h2>&nbsp;&nbsp;In partnership with Landmarq Technologies Limited & " & session("affcomp") & "</h2>" %>
  <% else %>
    <% response.write "<h2>&nbsp;&nbsp;In partnership with Landmarq Technologies Limited</h2>" %>
  <% end if %>
    </div>


Edited by Andy @ Landmarq - 02-April-2009 at 11:45am
Need a bespoke PC built to order? come to www.landmarq.co.uk
Back to Top
RUOnTheNet View Drop Down
Newbie
Newbie


Joined: 06-November-2008
Location: Vancouver
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote RUOnTheNet Quote  Post ReplyReply Direct Link To This Post Posted: 16-April-2009 at 12:44am
My suggestion is
 
You need to retrieve the Aff ID from the cookie on the visitor's site if product cart uses a cookie for tracking affiliates.   ( we use a third party aff program, but asp based  and that is how we do this. )
 
What you need to do is get the Aff ID from the cookie, then have it passed to your page as a string etc. ... so the idaffiliate="string_COOKIE" ..
 
 
Alan,
www.AreYouOnTheNet.com
Internet Sales, Marketing & Affiliate Program Management
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 16-April-2009 at 2:50am
Hi,
   ProductCart automatically retrieves the affiliateid if there is one stored in the cookie in code within pc/pcStartSession.asp so you should be able to access it just about everywhere with: session("idAffiliate")  - basically combine your two posts. 
You should also exclude affiliateid=1
 
Back to Top
Andy @ Landmarq View Drop Down
Newbie
Newbie
Avatar

Joined: 12-November-2008
Location: London
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy @ Landmarq Quote  Post ReplyReply Direct Link To This Post Posted: 21-April-2009 at 10:56am
I solved it Smile (sort of Wink)

I was not winning with the whole sql query thing (need to learn more on that front) but had a flash on inspiration that allows me a touch more flexability albeit with a touch more work.

In my header I now have

      <% if session("idAffiliate")>1 then %>
      <%
      Server.Execute("aff/"&session("idAffiliate")&".asp")
      %>
      <% else %>
        <% response.write "<h2>&nbsp;&nbsp;</h2>" %>  
  <% end if %>

(on the line with &nbsp;&nbsp; you can have a message shown when there is no affiliate set)

Then in my subdir aff/ i have files simply named 2.asp, 3.asp etc . . . which might contain

<% response.write "<h2>In partnership with XYZ Computers</h2>" %>

or

<% response.write "<h2><span style=""vertical-align: bottom;"">In partnership with&nbsp;&nbsp;<img style=""vertical-align: bottom;"" src=images/login.gif></span></h2>" %>

So when an affilate link is parsed the idaffilate becomes the filename and can display either a simple line of text or text/image or anything I fancy in the called .asp file. It work just fine and save a lot of extra database calls on every page load.

If anyone wants to use this code please feel free to help yourself Smile the only thing I found is that if you want to test different affiliates you have to clear the cookies and restart IE or clear private data and select cookies in Firefox other wise the first affiliate used will override all subsequent affiliates. There is meant to be an option in the settings to change this behaviour but could not see it on 3.51
Need a bespoke PC built to order? come to www.landmarq.co.uk
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.