Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Redirect session is new


Guest

Recommended Posts

Hello to all

I am wodering if i can get a bit of help :-"

I am trying to add a little redirect on application_top.php to redirect every new user to a special page

 

Please help I am loosing my mind!

>_<

Link to comment
Share on other sites

Hello to all

I am wodering if i can get a bit of help :-"

I am trying to add a little redirect on application_top.php to redirect every new user to a special page

 

Please help I am loosing my mind!

>_<

 

 

Nothing!!!

Link to comment
Share on other sites

in your application_top.php you could try

 

 

before this code:

// create the shopping cart & fix the cart if necesary

if (tep_session_is_registered('cart') && is_object($cart)) {

 

add

  if ($spider_flag == false && !tep_session_is_registered('new_user') {
tep_session_register('new_visitor');
$new_visitor = 1;
tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
}

and set the filename where to redirect to.

Link to comment
Share on other sites

  • 2 weeks later...

This one here worked for me

<script type="text/javascript">
// taken from http://evolt.org/article/list/20/416/
	// <![CDATA[
var Splash = GetCookie('SplashSkip');
var ReDirected = GetCookie('SplashReDirected');

ReDirect('/redirect-to-this-page.php');

function ReDirect (URL) {

	SetCookie('SplashSkip','TRUE',1);

	if (Splash == 'TRUE' && ReDirected != 'TRUE' ) {
		SetCookie('SplashReDirected','TRUE');
		window.location=(URL);
	}
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
	endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
  var j = i + alen;
  if (document.cookie.substring(i, j) == arg)
	return getCookieVal (j);
  i = document.cookie.indexOf(" ", i) + 1;
  if (i == 0) break; 
  }
  return null;
}

function SetCookie(name, value, expDays, path, domain, secure) {
	// Set cookie with name, value etc provided
	// in function call and date from above
	// Number of days the cookie should persist NB expDays='' or undef. => non-persistent
	if (expDays != null ) {
		var expires = new Date(); 
		expires.setTime(expires.getTime() + (expDays*24*60*60*1000));
	}	
	var curCookie = name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	document.cookie = curCookie;
}
	// ]]>
</script>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...