Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Product listing show/hide more info by category

Product listing show/hide more info by category

Locked

Views: 4,868

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
5 Jun 2007, 4:12 PM
#1
bobede avatar

bobede

New Zenner

Join Date:
Jun 2007
Posts:
7
Plugin Contributions:
0

Product listing show/hide more info by category

In my store there is a category which never requires more info to show. I would like to have an add to cart option show up in the product listing, but only for that one category. Has anyone ever tried this?

Thanks

5 Jun 2007, 4:26 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Product listing show/hide more info by category

By default, only products without attributes show the add to cart button; you can specify it to show in Configuration > Product Listing > Display Product Add to Cart Button (0=off; 1=on; 2=on with Qty Box per Product).

If other categories have a mix of products with and without attributes, the ones without would then show the add button. What is your situation?

It should be possible to add a test in product_listing.php to control this behavior.

5 Jun 2007, 5:07 PM
#3
bobede avatar

bobede

New Zenner

Join Date:
Jun 2007
Posts:
7
Plugin Contributions:
0

Re: Product listing show/hide more info by category

Thanks for the quick reply.

In my situation none of the products have attributes. Some products may have detailed descriptions which would require the more info button.

The products which don't require the more info button have very short or no desription at all.

6 Jun 2007, 4:23 PM
#4
bobede avatar

bobede

New Zenner

Join Date:
Jun 2007
Posts:
7
Plugin Contributions:
0

Re: Product listing show/hide more info by category

Correction - some products may have attributes after all.

Does anyone know of a way to have the "more info" button display at the same time as the "add to cart" ?

Thanks

6 Jun 2007, 6:38 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Product listing show/hide more info by category

That is not possible.

Attributes require a choice to be made before the product can be added to cart, and the product listing is not set up to process that. You always need to go to the product info page to select attributes.

I understand there is a way to add the attribute processing function to the listing page, but it would require advanced PHP skills and a good knowledge of the underlying ZC structure.

7 Jun 2007, 12:59 PM
#6
bobede avatar

bobede

New Zenner

Join Date:
Jun 2007
Posts:
7
Plugin Contributions:
0

Re: Product listing show/hide more info by category

Thank you for the reply Glenn.

I understand that "buy now" cannot possibly be an option when there are attributes that need to be chosen. But that's not really what I'm wondering.

Hopefully I can explain this a little better. I have a product listing page displaying several products.
Product "A" has attributes and therefore displays only the "more info" button. Product "B" has no attributes and a short description, so the "add to cart" is available, but not the "more info" button.
Product "C' has no attributes, but has a very long description.

What I want to display for product "C" is the "add to cart" so returning visitors don't have to click the "more info" button and will have a quicker checkout, AND I also want to display the "more info" button for first time visitors so they can go to the product info page and get a full description of the product.

Product "C" has no attributes, so can it show both?

Thanks again.

Bob

7 Jun 2007, 2:34 PM
#7
bobede avatar

bobede

New Zenner

Join Date:
Jun 2007
Posts:
7
Plugin Contributions:
0

Re: Product listing show/hide more info by category

OR...

Is it possible to simply duplicate the code which creates the link in the Title of the product, and apply it to an image.

Hmm..
That would cause an issue with products which have attributes showing 2 more info buttons.

Unless...
I make the original moreinfo button a 1px x 1px white gif.

Does this sound doable?

Thanks

Bob

7 Jun 2007, 2:53 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Product listing show/hide more info by category

For the case you describe, yes it could.

It would require finding the code that truncates the description and sets the more info flag, and setting a parallel "show add" flag, then modifying the code in product_listing.php to show both in that case.

7 Jun 2007, 3:51 PM
#9
bobede avatar

bobede

New Zenner

Join Date:
Jun 2007
Posts:
7
Plugin Contributions:
0

Re: Product listing show/hide more info by category

Thanks Glenn!

That makes sense. Now for the fun part. :blink:
Hopefully I can figure this out. I'll post my results if I'm successful.

Bob

14 Jan 2009, 7:47 PM
#10
lifescrappers avatar

lifescrappers

New Zenner

Join Date:
Jan 2009
Posts:
21
Plugin Contributions:
0

Re: Product listing show/hide more info by category

This is what I need I think...as long as my customers have the option to just add the product on the listing page, I would be fine with the more info showing up too.
Is there an easy way to combine these? Or a way at all? My husband is the web guru, and can handle it if I know where to direct him.

15 Jan 2009, 9:40 AM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Product listing show/hide more info by category

The code will be in /includes/modules/your_template/product_listing.php (copy it from /includes/modules/product_listing.php). It does use a function (zen_truncate_paragraph() or something like that) and you might need to chase that down and modify it or a renamed copy of it. I haven't looked at it in a while.