Forums / Templates, Stylesheets, Page Layout / Change the way products are displayed on a category page

Change the way products are displayed on a category page

Started by jmsnyder23 on 27 Apr 2014, 3:02 AM · Views: 740

Results 1 to 4 of 4
27 Apr 2014, 3:02 AM
#1
jmsnyder23 avatar

jmsnyder23

Zen Follower

Join Date:
Jan 2010
Location:
Richmond, Virginia, United States
Posts:
122
Plugin Contributions:
0

Change the way products are displayed on a category page

I have many categories on my site, which is a bookstore. All category pages display the books within the category in a three-column layout. Each book displays the following:

Cover art linked to product page
Book Title
Book Author
Book Price

I have a Coming Soon (upcoming products) page that displays the books in the same three-column layout, but with different information:

Cover art linked to product page
Book Title
Book Author
Release Date

I cannot get the upcoming products page to paginate, so I want to add the Coming Soon products to a category of their own. HOWEVER, I can't get the details to display properly. I want the release date listed, NOT the price.

Is there a way to create a category-specific product template? I can't do it in a stylesheet.

Thanks in advance!

28 Apr 2014, 1:32 AM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Change the way products are displayed on a category page

You could add coditional code to product_listing.php that would test for the category id = whatever it is, and skip the price and output the release date if true; otherwise output the price and skip the release date. This would require adding a term to the SQL query in (I think) main_template_vars.php to fetch the release date if it exists, and process that into the listing array. Then you would have the data to use in output if needed. Use the upcoming products code to see exactly how to fetch the release date.

28 Apr 2014, 2:54 PM
#3
jmsnyder23 avatar

jmsnyder23

Zen Follower

Join Date:
Jan 2010
Location:
Richmond, Virginia, United States
Posts:
122
Plugin Contributions:
0

Re: Change the way products are displayed on a category page

Unfortunately, I don't understand your response. I am unfamiliar with PHP coding and SQL queries.

If it isn't a simple change I can make to a template file, then I guess it's just not do-able for me. Thanks anyway.

28 Apr 2014, 5:31 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Change the way products are displayed on a category page

Sorry, it would require several changes to several files, and require good PHP skills. Making a new product type (the other way to achieve this) would also require PHP and Zen Cart knowledge.