Forums / General Questions / Turned off/deleted category - how can I redirect to homepage?

Turned off/deleted category - how can I redirect to homepage?

Started by lj20272 on 31 May 2011, 6:14 AM · Views: 1,092

Results 1 to 8 of 8
31 May 2011, 6:14 AM
#1
lj20272 avatar

lj20272

New Zenner

Join Date:
Jul 2007
Posts:
57
Plugin Contributions:
0

Turned off/deleted category - how can I redirect to homepage?

Hi,

How would I go about making a turned off or deleted category/product redirect to the homepage.

Turned off categories currently give the "There are no products to list in this category" message.

I currently use top categories set up as "Masters", which is where I add all my products. I then link the products to various other subcategories. When I originally set my cart up, I had products in top categories. I am now using subcategories, hence the reason for using the original tops as masters.

So... I just want anything that is turned off to go straight to the homepage.

Hope I haven't been too confusing :)

http://www.pregnancyshop.com.au

Cheers

Amanda

27 Aug 2011, 9:55 AM
#2
lj20272 avatar

lj20272

New Zenner

Join Date:
Jul 2007
Posts:
57
Plugin Contributions:
0

Re: Turned off/deleted category - how can I redirect to homepage?

Hi again :)

I'm still looking for a solution to this. Any suggestions??

Thanks.

27 Aug 2011, 12:44 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Turned off/deleted category - how can I redirect to homepage?

Categories hold either Categories or Products and not both ...

The Master Categories ID needs to be the immediate Category that the Product belongs to ... not a parent category ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Sep 2011, 1:29 AM
#4
lj20272 avatar

lj20272

New Zenner

Join Date:
Jul 2007
Posts:
57
Plugin Contributions:
0

Re: Turned off/deleted category - how can I redirect to homepage?

Thanks Ajeh,

I had already reassigned all products to the new master categories, so that side of it is ok.

As the old top category still exists (has no sub categories or products) if someone clicks the link via a search engine they land on this page:

http://www.pregnancyshop.com.au/index.php?main_page=index&cPath=1

Even deleted top categories land at this page:

http://www.pregnancyshop.com.au/index.php?main_page=index&cPath=6

How can I have these turned off or deleted categories go directly to the homepage instead of these, I suppose you could call them dead pages? I think that left this way, it looks as though I either don't sell these products or the site is incomplete.

Thanks in advance

2 Sep 2011, 1:37 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Turned off/deleted category - how can I redirect to homepage?

If you go directly to a categories_id that does not exist nor have a product in it nor an inactive categories_id ... you will get the message that no Products exist ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Sep 2011, 1:42 AM
#6
lj20272 avatar

lj20272

New Zenner

Join Date:
Jul 2007
Posts:
57
Plugin Contributions:
0

Re: Turned off/deleted category - how can I redirect to homepage?

Thanks for the quick reply.

Is there a way to redirect these pages to the homepage?

2 Sep 2011, 1:52 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Turned off/deleted category - how can I redirect to homepage?

You would have to write the code for that ...

Currently, it is doing the best that it can with an unknown or unavailable categories_id and still displaying something that at least does not trigger errors ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Sep 2011, 9:30 AM
#8
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Turned off/deleted category - how can I redirect to homepage?

This is the bit of code in product_listing.php that shows the 'There are no products to list in this category'

$list_box_contents[0] = array('params' => 'class="productListing-odd"');
$list_box_contents[0][] = array('params' => 'class="productListing-data"',
'text' => TEXT_NO_PRODUCTS);

So how could we make it so instead of posting that text, it does a HTML redirect back to the homepage.