Jump to content

Automatically directed to homepage once logged out?


Guest howsthisart

Recommended Posts

Guest howsthisart

;) I have searched and couldnt' find anything regarding being redirected.

I would like the user to be redirected to the homepage after about 10 seconds of logging out.

Is this possible?

Link to comment
Share on other sites

Easy and clean solution:

skins/{your skin}/styleTemplates/global/index.tpl

Search for:

<title>{META_TITLE}</title>




Add after:
<!-- BEGIN: redirect --> <meta http-equiv="refresh" content="5;url=http://www.cubecart.com/"> <!-- END: redirect -->
Red marked - Redirect Delay in seconds (0 = redirect immediately) Blue marked - Redirection URL (your home page here etc.) Final code around new one looks like this:
<!-- BEGIN: body --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset={VAL_ISO}" /> <title>{META_TITLE}</title> <!-- BEGIN: redirect --> <meta http-equiv="refresh" content="5;url=http://www.cubecart.com/"> <!-- END: redirect --> <meta name="description" content="{META_DESC}" /> <meta name="keywords" content="{META_KEYWORDS}" />
includes/content/logout.inc.php Add code below:

Final code around new one looks like:

if($update == TRUE && !isset($_GET['s'])) {

header("Location: index.php?act=logout&s=1");

exit;

} elseif(isset($_GET['s']) && $_GET['s']==1) {

$logout->assign("LANG_LOGOUT_STATUS",$lang['front']['logout']['session_destroyed']);

$body->parse("body.redirect");

} else {

$logout->assign("LANG_LOGOUT_STATUS",$lang['front']['logout']['no_session']);

$body->parse("body.redirect");

}

;)

$body->parse("body.redirect");




After this:
	$logout->assign("LANG_LOGOUT_STATUS",$lang['front']['logout']['session_destroyed']);




and this code:
$logout->assign("LANG_LOGOUT_STATUS",$lang['front']['logout']['no_session']);
Link to comment
Share on other sites

  • 2 weeks later...
Guest apple

includes/content/logout.inc.php

I cant find file mentoned above. Where is it located? I can only see logout.tpl in styleTemplates/content/logout.tpl

Link to comment
Share on other sites

Guest apple

Dont you have folder includes and then content? includes/content in your CubeCart folder there is a file logout.inc.php

Oh yes, I see it now. I was looking at the wrong folder. OK. I have updated my files but it istill not re-directing it. Any idea? :D

Link to comment
Share on other sites

  • 2 months later...
Guest Guys and Gals Perfume

G'day Convict,

I added in your coding to redirect the user to the homepage once they have purchased an item. At the time, I typed in all the coding and I am not sure that if, in there somewhere I had a minor typo? I purchased an item on the site to test that everything was working correctly and it all worked fine until time came to the redirction.

After the redirection, instead of returning to the homepage, it came up with a white screen saying:

Error: No payment gateway variable is set!

I took a screen print of that page to save as a reference.

I have now gone back into your thread, and have literally copied the code and pasted it into the document to alleviate any typo's since everyone else seems to have had success with the code.

Is there any way of testing that this coding is correct in the web site without having to literally purchase an item?

Also, where you refer to alter this inital file type:

skins/{your skin}/styleTemplates/global/index.php

...if I go to this directory, my file type is index.tpl and therefore that is the file I have altered the text in. Is this correct or is this where I could be having problems?

Thanks for any help!

Cheers,

Shanna.

Link to comment
Share on other sites

Guest Guys and Gals Perfume

Convict,

I may be a twit here...I re read the thread of Q & A's and it looks like I have gotten the wrong idea from the initial question...

Return to Log Out Page...I was talking about once a person purchased an item to redirect to home page.

I went back into the site and check the logout bizzo, and that worked fine.

Having said said that, not sure if this is correct thread to ask this question, but any ideas as to what is happening once a person has purchased the item as to why it is coming up with the payment gateway error message?

Thanks,

Shanna.

Link to comment
Share on other sites

Also, where you refer to alter this inital file type:

skins/{your skin}/styleTemplates/global/index.php

Yes, this is a typo. I have changed the php to tpl which is right in my primary topic post.

I added in your coding to redirect the user to the homepage once they have purchased an item.
Dont forget you have to inform customer payment was sucessful or not.

If you want to redirect customer to homepage in case payment was sucessful, you have to do it in includes/content/confirmed.inc.php

Be ware there is a affiliate module code, if you dont use affiliate module you may redirect the customer sucesfully paid with following code:

Open file i have mentioned above

Search for

		$basket = $cart->unsetVar("shipMethod");

ADD AFTER

header("Location: index.php");

exit();

Link to comment
Share on other sites

Guest Guys and Gals Perfume

Thanks for your help convict...don't know what I'd do without the help of you guys. See how we go!

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...
Guest eric47905

Thanks Convict, I was fighting a bug where when someone would log in it would place a 1 in the search box, then when you logged out it would run thaqt search when you clicked on anything...

I have no idea what was causing it, but it is fixed now, you rock!

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...