Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Attempting to restructure product listings

Attempting to restructure product listings

Views: 1,725

Results 1 to 16 of 16
7 Nov 2013, 4:26 PM
#1
peter_m_dodge avatar

peter_m_dodge

New Zenner

Join Date:
Nov 2013
Posts:
24
Plugin Contributions:
0

Attempting to restructure product listings

Good morning,
I have spent the better part of the previous week combing through the at-best spotty documentation available for ZenCart and am at my wit's end. I want to restructure product listings from the simple "tile" display into a table-based listing with details for each product. Here is an example from another site:

Attachment 13318

It would be easy to populate such a table through a php loop but I could not for the life of me figure out how the product variables are exposed and parsed in the listing code.

Help?

Cheers,
Peter M Dodge

7 Nov 2013, 4:32 PM
#2
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Attempting to restructure product listings

Are you using the Classic template? The row styled layout is standard in zen-cart unless you have a special template. However modifying it to show the other options you have in the screen shot included are not. But that can be pretty easily added, as long as you know which table to call them from. You may need to add additional columns to your databases product tables to record those additional features.

7 Nov 2013, 4:33 PM
#3
peter_m_dodge avatar

peter_m_dodge

New Zenner

Join Date:
Nov 2013
Posts:
24
Plugin Contributions:
0

Re: Attempting to restructure product listings

Hello,
I am not sure if what I am using could be considered the "Classic" template. I am using the boilerplate template that comes with 1.5.1 that the FAQs suggest using as the basis for a new template.
Cheers,
Peter M Dodge

7 Nov 2013, 4:42 PM
#4
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Attempting to restructure product listings

under tools -> template selection should be the name of your template "Classic" is the one that is basically the default included.

I assume you have tried configuring your product listing, from here:
http://www.zen-cart.com/wiki/index.php/Admin_-_Configuration_-_Product_Listing

7 Nov 2013, 4:46 PM
#5
peter_m_dodge avatar

peter_m_dodge

New Zenner

Join Date:
Nov 2013
Posts:
24
Plugin Contributions:
0

Re: Attempting to restructure product listings

Good morning,
The information I want displayed for the product are displayed, it's a matter of formatting the listing into that sort of list style. In my distribution I only had "classic" and "template_default" templates. The latter of which the documentation suggests copying for creating your own template. I have been able to readily adapt it in just about every other way so far, but not to create the listing I want.

Where can I find this apparently-newer template code?
Cheers,
Peter M Dodge

7 Nov 2013, 5:16 PM
#7
peter_m_dodge avatar

peter_m_dodge

New Zenner

Join Date:
Nov 2013
Posts:
24
Plugin Contributions:
0

Re: Attempting to restructure product listings

That's essentially the template I started from. I should have been clearer, sorry, but I want the "what's new" section to follow the same list format.

Cheers,
Peter M Dodge

7 Nov 2013, 5:21 PM
#8
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Attempting to restructure product listings

ohh ok,
This is what i would do.

Copy the file includes/templates/template_default/templates/tpl_products_new_default.php
Save it to includes/templates/YOUR_TEMPLATE/templates/tpl_products_new_default.php and then modify it there, this will override the template_default in case you would want that in the future

7 Nov 2013, 5:26 PM
#9
peter_m_dodge avatar

peter_m_dodge

New Zenner

Join Date:
Nov 2013
Posts:
24
Plugin Contributions:
0

Re: Attempting to restructure product listings

Good afternoon,
Would simply copying the product listing code copy that formatting, or would it be more complicated than that?
Cheers,
Peter M Dodge

7 Nov 2013, 5:34 PM
#10
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Attempting to restructure product listings

It is slightly different from my experience. However you could take the stock versions of both do a comparison, and then add your changes to the version you wish.

7 Nov 2013, 5:48 PM
#11
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,869
Plugin Contributions:
7

Re: Attempting to restructure product listings

In my distribution I only had "classic" and "template_default" templates.
That is all there is.

a) template_default - do not touch these files, only copy elsewhere to modify. The source of the structure of every page UNLESS you create a modified version "elsewhere".

b) "classic" - an example of an "elsewhere". A fugly template who's only function is to demonstrate all the bells and whistles that can be displayed.
Also do not touch!
Why? - For when you get white screens of death and odd things happening due to your mods, you can revert back to classic, see if the problems go away and so prove its your modified template file causing the problem. Or not.

c) YOUR_TEMPLATE: your changes to the default css and templates files. Single files copied here only as you need to modify them.

Really the way to go is design your own website style in a graphics program and then implement, not try and tweak classic bit by bit.

The product listing code is very complicated, no doubt about it. I stick <?php echo __LINE__; ?> everywhere to get more idea what bit of code is producing what bit of the page.

7 Nov 2013, 5:52 PM
#12
peter_m_dodge avatar

peter_m_dodge

New Zenner

Join Date:
Nov 2013
Posts:
24
Plugin Contributions:
0

Re: Attempting to restructure product listings

Good afternoon,
The classic template is no doubt very "90s" design. I copied that template_default design and have so far gotten a design I'm fairly happy with. It has a ways to go and I just got stumped on how to make the "new products" listing the same sort of list format as the general product listings.
Cheers,
Peter M Dodge

7 Nov 2013, 6:33 PM
#14
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,869
Plugin Contributions:
7

Re: Attempting to restructure product listings

There's this:

http://www.zen-cart.com/downloads.php?do=file&id=1047
The Single Listing Template....don't do it, I did.
It's still embedded in my site and I get ill when I come across it. It works but....it's very complicated and the mod is not maintained.

Maybe drop it into a test site and it will give you some clues how it all works, in fact I think the readme is useful (I did it!)

There's SNAF which has support

http://www.zen-cart.com/showthread.php?191943-Snaf&highlight=snaf

7 Nov 2013, 6:54 PM
#15
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Attempting to restructure product listings

As I usually say when I point to a mod, I haven't used it. SNAF is the better option.

8 Nov 2013, 4:00 PM
#16
peter_m_dodge avatar

peter_m_dodge

New Zenner

Join Date:
Nov 2013
Posts:
24
Plugin Contributions:
0

Re: Attempting to restructure product listings

That mod seems like it would fit the bill well, thanks for that.

Is there a way to change it so that the "Item Name" field in the listings only displays the name, not the item description as well?
Cheers,
Peter M Dodge