Forums / Templates, Stylesheets, Page Layout / Change template based on where user came from.

Change template based on where user came from.

Views: 572

Results 1 to 1 of 1
23 Sep 2011, 4:59 PM
#1
ericjb9 avatar

ericjb9

New Zenner

Join Date:
Jul 2011
Posts:
4
Plugin Contributions:
0

Change template based on where user came from.

Is it possible to change the template based on where a user came from?

For example, I have a user that is looking at candles on BCcandle.com and they want to purchase a candle. They click the "BUY NOW" button and they are taken to QSDirectusa.com which sells the candles. I want the template on QSDirectusa.com to change and be branded to BCcandle.com, only if the traffic comes from that site. I would simply change the template if we were using only one. But I need to have multiple templates that can be changed 'on the fly' for one cart.

I know how to do all of the html and css to make the stylesheet.

I need some direction on how to change, within zencart, the page template based on where traffic came from .

I have some code written that will perform an action if a user has come from a certain URL:

<?php
/* To store the page the user came from */
$referredURL = $_SERVER['HTTP_REFERER'];
if($referredURL=="http://xxxxxxx.com"){
	//perform command
}
?>

Thanks in advanced.