Forums / Templates, Stylesheets, Page Layout / Automatic redirect from cat page to another?

Automatic redirect from cat page to another?

Locked

Views: 1,201

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
24 Feb 2010, 10:37 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Automatic redirect from cat page to another?

Why ?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Feb 2010, 11:11 AM
#3
joomoo79 avatar

joomoo79

New Zenner

Join Date:
Feb 2009
Posts:
33
Plugin Contributions:
0

Re: Automatic redirect from cat page to another?

It's complicated to explain... But let me try to give it a shot anyway...

I set up a "consultation page", which is nothing but a quiz. The quiz returns product combos depending on score. Those combos are in cat #3 and meant to be there ONLY for the quiz. If for some reason, someone tries to go to the product listing, I'd rather them being redirected to the cat #1 product listing instead, coz it shows each product individually, not in a combo. I don't want a combo to come up out of context, it that makes any sense to you.

That's basically why I only need a redirect from cat #3 to cat #3. I don't wanna redirect product pages in cat #3.

24 Feb 2010, 11:21 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Automatic redirect from cat page to another?

Okay, if I'm understanding you correctly, I think you can accomplish that by adding this to the end of your /includes/init_includes/init_category_path.php file, just before the closing ?> (or just remove the ?> altogether):```
if ($cPath == '3' && $current_page == 'index') zen_redirect(zen_href_link(FILENAME_DEFAULT, 'cPath=1'));

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Feb 2010, 11:36 AM
#5
joomoo79 avatar

joomoo79

New Zenner

Join Date:
Feb 2009
Posts:
33
Plugin Contributions:
0

Re: Automatic redirect from cat page to another?

Works perfectly!!! Thanks a lot!!! :smile: