Forums / Customization from the Admin / One product in category view - can I skip single product category listings?

One product in category view - can I skip single product category listings?

Locked

Started by imagenation on 10 Jul 2006, 1:11 PM · Views: 4,741

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
10 Jul 2006, 1:11 PM
#1
imagenation avatar

imagenation

New Zenner

Join Date:
Jul 2006
Posts:
11
Plugin Contributions:
0

One product in category view - can I skip single product category listings?

Hi, Apologies if this is a really newbie question but i've searched and searched and cant find the answer!

Is there an area in the admin that can change how single product categories are viewed. Instead of linking through to the full product description page I would like to go to the summary page as it does when there is more than one product in the sub category.

I am sure there is something in the admin that manages this but I just cant find it!

Thanks in advance for your help

11 Jul 2006, 6:49 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: One product in category view - can I skip single product category listings?

Admin->Configuration->Layout Settings->Skip 1-prod Categories

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

11 Jul 2006, 9:27 AM
#3
imagenation avatar

imagenation

New Zenner

Join Date:
Jul 2006
Posts:
11
Plugin Contributions:
0

Re: One product in category view - can I skip single product category listings?

Thank you very much, thats exactly what I needed, knew it was in the admin somewhere.

26 Sep 2008, 7:47 PM
#4
jacdesigner avatar

jacdesigner

Zen Follower

Join Date:
Jun 2005
Location:
Austin, Texas, US
Posts:
205
Plugin Contributions:
0

Re: One product in category view - can I skip single product category listings?

I know this is an old post, but I have been searching for this setting in a very old store that one of my clients owns - version 1.2.7 (don't ask me about upgrading please, I do not own the web site).

I just want to know if it is possible to skip the product list page if only 1 product exists in the category. It looks like in 1.2.7, the "skip 1-prod category" option is not available like it is in new versions.

Specifically, I want to skip straight to the Gift Certificate product when the Gift Certificates category is selected. As it stands, there is an unwanted extra click with a list that only has the one product (one gift certificate type) in it.

This message brought to you by Jac.
Happily developing sites with Zen Cart since 2003.

28 Sep 2008, 11:08 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: One product in category view - can I skip single product category listings?

This is new in v1.3.x ... and did not exist in the v1.2.x series ...

I do not have a v1.2.7 laying about, but in v1.3 this is what is in the:
/includes/modules/pages/index/header_php.php

// query the database based on the selected filters
$listing = $db->Execute($listing_sql);

// if only one product in this category, go directly to the product page, instead of displaying a link to just one item:
// if filter_id exists the 1 product redirect is ignored
if (SKIP_SINGLE_PRODUCT_CATEGORIES=='True' and (!isset($_GET['filter_id']) and !isset($_GET['alpha_filter']))) {
  if ($listing->RecordCount() == 1) {
    zen_redirect(zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing->fields['products_id']));
  }
}

Perhaps this will help you adapt your old, acient, buggy and heavily security patched out dated code to work with this feature available in the nice, new, code with all of the neat new features that your code lacks ... :smile:

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!

29 Sep 2008, 2:32 PM
#6
jacdesigner avatar

jacdesigner

Zen Follower

Join Date:
Jun 2005
Location:
Austin, Texas, US
Posts:
205
Plugin Contributions:
0

Re: One product in category view - can I skip single product category listings?

Thank you, Ajeh. I will check that code out and see if I can make it work under minimal effort (since the client has an unfortunately limited budget at this time).

I may be closer to getting them to upgrade. I have had more than one conversation with the owner about features on his wish list that are already present in the latest 1.3.8. Cross your fingers!

This message brought to you by Jac.
Happily developing sites with Zen Cart since 2003.