Forums / Setting Up Categories, Products, Attributes / Redirect Catergory to different URL?

Redirect Catergory to different URL?

Locked

Views: 3,330

Results 1 to 18 of 18
This thread is locked. New replies are disabled.
31 Oct 2009, 12:01 AM
#1
plsony avatar

plsony

New Zenner

Join Date:
Jul 2009
Posts:
54
Plugin Contributions:
0

Redirect Catergory to different URL?

What I would like to do is, when someone clicks the Category Wholesale I would like it to redirect to wholesale.midwestnotebooks.com so I can use a completely different checkout.

Any have an idea on how to do this?
I have searched many things up can quite come up with good enough search terms to find what I need.
.
.
.
.
.
.

31 Oct 2009, 12:23 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Redirect Catergory to different URL?

What is the relationship between that site and yours?

.
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.

31 Oct 2009, 1:55 AM
#3
plsony avatar

plsony

New Zenner

Join Date:
Jul 2009
Posts:
54
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

Thanks,
My site is https://www.midwestnotebooks.com would like redirect to https://www.wholesale.midwestnotebooks.com when someone clicks the wholesale category, both of them mine.

It is to keep retail and wholesale items seperate as wholesale will have minimum order size while retail will not.
.
.
.
.
.

31 Oct 2009, 2:17 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: Redirect Catergory to different URL?

Do you know what the cPath for that category is?

If so, you can edit your /includes/init_includes/init_category_path.php and at the end of the file, remove the "?>" that's on a line by itself, and then add something like this:```
if ($cPath == '[B]3_10[/B]') {
zen_redirect('http://wholesale.midwestnotebooks.com/');
}

Naturally, replace the '**3_10**' with whatever the cPath is for the category you want redirected.

.
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.

31 Oct 2009, 2:37 AM
#5
plsony avatar

plsony

New Zenner

Join Date:
Jul 2009
Posts:
54
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

Thanks,

That is the ticket! Works perfectly!
Would would I do if I wanted to redirect a product in a different category?
.
.
.
.
.
.

31 Oct 2009, 3:33 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: Redirect Catergory to different URL?

Can you explain further?

.
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.

31 Oct 2009, 4:10 AM
#7
plsony avatar

plsony

New Zenner

Join Date:
Jul 2009
Posts:
54
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

Thanks,

For instance redirect:
-http://www.midwestnotebooks.com/index.php?main_page=product_info&cPath=23&products_id=75

to

-http://www.wholesale.midwestnotebooks.com/index.php?main_page=product_info&cPath=23&products_id=75

31 Oct 2009, 4:15 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: Redirect Catergory to different URL?

Similar approach:```
if ($cPath == '23' && isset($_GET['products_id']) && $_GET['products_id'] == '75') {
zen_redirect('http://wholesale.midwestnotebooks.com/index.php?main_page=product_info&cPath=23&products_id=75 ');
}

.
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.

31 Oct 2009, 4:40 AM
#9
plsony avatar

plsony

New Zenner

Join Date:
Jul 2009
Posts:
54
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

Thanks,

That is excellent!

8 Dec 2009, 3:45 AM
#10
b2100 avatar

b2100

New Zenner

Join Date:
Dec 2009
Posts:
3
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

DrByte:

Do you know what the cPath for that category is?

If so, you can edit your /includes/init_includes/init_category_path.php and at the end of the file, remove the "?>" that's on a line by itself, and then add something like this:```
if ($cPath == '[B]3_10[/B]') {
zen_redirect('http://wholesale.midwestnotebooks.com/');
}

> Naturally, replace the '**3_10**' with whatever the cPath is for the category you want redirected.

Hi

If I wanted to do this for 2 categories could I just add the same lines below the first ? Obviously changing the cPath for the second category.

Thanks in advance for any help you can give me
8 Dec 2009, 7:51 AM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Redirect Catergory to different URL?

If you want to go to the same location in both cases, you can just add the second category in the if() test:```php
if ($cPath == '3_10' or $cPath == '4_20') {
zen_redirect('http://wholesale.midwestnotebooks.com/');
}

8 Dec 2009, 2:38 PM
#12
b2100 avatar

b2100

New Zenner

Join Date:
Dec 2009
Posts:
3
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

Thanks for your reply but I want to redirect 2 categories to 2 different pages that are based on joomla and are more catalogues than shops.
Thanks

9 Dec 2009, 1:58 AM
#14
b2100 avatar

b2100

New Zenner

Join Date:
Dec 2009
Posts:
3
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

Sorted thank you very much for your help.

Peter

19 Dec 2009, 4:02 PM
#15
ariana avatar

ariana

New Zenner

Join Date:
Nov 2007
Posts:
11
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

I am modifying a site of my friend and I added a redirect to page_2. I have no idea why the following does not redirect me to page_2

 require_once('includes/application_top.php');

$action = (isset($_GET['action']) ? $_GET['action'] : '');

if (zen_not_null($action)) {
	switch ($action) {
		case 'test':
echo '<br / >',zen_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS);
zen_redirect(zen_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS));
		break;
		}
		}

The echo function shows the correct path
The redirect reloads the page but does not redirect to the correct page.
Any idea is much appreciated.

Zyrmax

19 Dec 2009, 4:59 PM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Redirect Catergory to different URL?

zen_href_link() does not provide a complete link, it provides the path to be linked to. You have to surround it with the HTML link code.```php
echo '<br / >'. '<a href="' . zen_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS) . '">' ;

19 Dec 2009, 5:40 PM
#17
ariana avatar

ariana

New Zenner

Join Date:
Nov 2007
Posts:
11
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

thank you gjh42 for the comment.
My problem is the "ZEN_REDIRECT" is not executing properly.

I know that the header (Location) function is sensitive and require care.

The ZEN_REDIRECT is not executing in my script but executes with other default installation scripts. So my question is am i missing an argument or something?

Take care

25 May 2010, 1:15 AM
#18
shannda avatar

shannda

New Zenner

Join Date:
Dec 2005
Posts:
46
Plugin Contributions:
0

Re: Redirect Catergory to different URL?

This was a hot little tip! Thanks so much!