[ic] Advanced affiliate issue

Kevin Walsh interchange-users@lists.akopia.com
Tue Aug 7 09:19:01 2001


> Quoting Jason Timm (jason@itchoices.com):
> > Hi all,
> >
> > We are using the affiliate functions extensively.  We run a single
catalogue
> > that is the core of an affiliate program with 30+ affiliates and growing
> > quickly.  Each affiliate has their own look and feel capability (and static
> > pages) but all use the same databases (products, shipping, etc.) as well as
> > the same common pages.
> >
> > Currently, each domain is mapped to the same directory on the server (main
> > document root).  So, when an affiliate goes to www.theirdomain.com, they
get
> > forwarded to their entry point within IC.  But, from then on it seems like
> > IC uses the SERVER_NAME variable to pre-pend all future URLs and paths.
> > This means that after the first click to their site, the URL changes to
> > http://www.mydomain.com/cgi-bin/catalog/sites/their_affiliate_id/page.html.
> > While this still has their affiliate id in it, it no longer looks like
their
> > URL. > Does anyone have any ideas on how to make IC use a value from the
> > affiliate table instead of the SERVER_NAME variable?  In other words, make
> > the URL stay the same from beginning to end while using the same catalog?
> >
> Well, you can just set VendURL to be /cgi-bin/catalog without the
> http://whatever stuff. That works -- I can't remember whether you get
> a warning or not.
>
Another method could be to use the catalog.cfg Autoload directive:

    Autoload <<EOL
    [perl]
        $Config->{'VendURL'} = 'http://www.domain.com/somepath';
    [/perl]
    EOL

Obviously, you'll need a db lookup in there or something.

Yet another approach could be to create a usertag like this:

    UserTag current_uri Routine <<EOR
    sub {
        $CGI::script_name;
    }
    EOR

Then change your catalog.cfg's Autoload to look like this:

    Autoload <<EOL
    [perl]
        $Config->{'VendURL'} = 'http://' . $Tag->current_uri();
    [/perl]
    EOL

Hopefully (untried), it would pick up the current URI and
stick http:// in front, to make the URL that IC will use when
creating internal page links.  IC will then carry on using
whatever entry point is provided.  This seems to be what you
are asking for.

You will need to have the appropriate Catalog entry alias in
interchange.cfg for every 'entry point' you plan to use, but
I have the feeling you have that all set up already.

Of course, I could be talking a load of nonsense here, so just
have a play around with it and see what it can do.

Have fun.

--
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.uk.com
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/