Forums / Templates, Stylesheets, Page Layout / changing the product listing page

changing the product listing page

Locked

Views: 1,113

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
10 Feb 2009, 7:52 PM
#1
madcobra avatar

madcobra

New Zenner

Join Date:
Feb 2009
Posts:
6
Plugin Contributions:
0

changing the product listing page

Hello, I am trying to change the layout of the page that displays products in a catagory. For example, if you have a catagory full of parts in your store, and you click that catagory on the left, it takes you to a page that lists the products, i call this page the product listing page. I have seen various layouts where the price is under the description, or to the right, or the title is above the image or to the right of it. I was wondering which file contained the code to change the arrangement of that information?

What version of Zen Cart are you using? Zen Cart 1.3.8a
Has your site been upgraded? When? From what version(s)? no , fresh Zen Cart 1.3.8a install
What addons have you installed? When? none
In what ways is your site customized or different from a brand new uncustomized install? just changing the css and added some graphics to the top of the site

10 Feb 2009, 9:37 PM
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: changing the product listing page

Chages to the product listing are made in override copies of includes/modules/product_listing.php or includes or includes/templates/template_default/templates/tpl_modules_product_listing.php

There is also a module available in the downloads section that allows for column-type product listing as well as the default row-style listing.

Neville
An assumption is what you arrive at when you get tired of thinking...

10 Feb 2009, 9:48 PM
#3
madcobra avatar

madcobra

New Zenner

Join Date:
Feb 2009
Posts:
6
Plugin Contributions:
0

Re: changing the product listing page

bunyip:

Chages to the product listing are made in override copies of includes/modules/product_listing.php or includes or includes/templates/template_default/templates/tpl_modules_product_listing.php

There is also a module available in the downloads section that allows for column-type product listing as well as the default row-style listing.

Looking into it further after some trial and error, the tpl_modules_product_listing.php file covers everything above and below the actual product rows. It looks like if you want to re-arrange the actual title/description/image format for each product listing you have to edit the "tpl_tabular_display.php" file. However...it uses an array with rows and columns to display the info from the database. I am trying to make it so the title of the item is on top, then under that the image is on the left, and the description is on the right. However. The title and the description are saved as one array item. So they cannot be split it seems.

Which leads me to my next question...how would you make the listing page look like this http://osc.template-help.com/zencart_22650/index.php if you cannot split the title and the description apart? Im guessing somewhere in the tpl_modules_product_listing.php file there will be a change in the way it saves the info to an array that is passed to tpl_tabular_display.php?

10 Feb 2009, 10:04 PM
#4
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: changing the product listing page

You'll need to be editing includes/modules/product_listing.php, remembering to save it as includes/modules/YOUR_TEMPLATE/product_listing.php

Neville
An assumption is what you arrive at when you get tired of thinking...

10 Feb 2009, 10:05 PM
#5
madcobra avatar

madcobra

New Zenner

Join Date:
Feb 2009
Posts:
6
Plugin Contributions:
0

Re: changing the product listing page

more specifically, the array im looking at that stores the (picture/title&description/qtybox&price) info in 0/1/2 array placing like that is $list_box_contents

so for example, $list_box_contents[1][1]['text'] would contain the title AND description together. I could do what i need to do if they were seperate. But i cant seem to find where this $list_box_contents array is initially created.

am i going about this the right way? its the only way that makes sense to me

10 Feb 2009, 10:07 PM
#6
madcobra avatar

madcobra

New Zenner

Join Date:
Feb 2009
Posts:
6
Plugin Contributions:
0

Re: changing the product listing page

bunyip:

You'll need to be editing includes/modules/product_listing.php, remembering to save it as includes/modules/YOUR_TEMPLATE/product_listing.php

ill try that and get back to you thanks

10 Feb 2009, 10:59 PM
#7
madcobra avatar

madcobra

New Zenner

Join Date:
Feb 2009
Posts:
6
Plugin Contributions:
0

Re: changing the product listing page

bunyip:

You'll need to be editing includes/modules/product_listing.php, remembering to save it as includes/modules/YOUR_TEMPLATE/product_listing.php

this is proving to be more difficult than i expected. I am decent with php.

But it seems like i need to make seperate array columns for the title and the description, and im not sure how to do that.

I see that there is a 'for loop' that iterates through the columns setting the values. but i dont really get where to set a title column and where to set a description column seperately

11 Feb 2009, 12:24 AM
#8
madcobra avatar

madcobra

New Zenner

Join Date:
Feb 2009
Posts:
6
Plugin Contributions:
0

Re: changing the product listing page

well I got it working, for anyone else looking to do this, I had to modify the /includes/modules/product_listing.php page to tack on the description as a new array column, (i just called it column 10 because i knew it was out in the middle of nowhere but im sure you could have just appended it to the end arbitrarily, but if i set it at column 10 i could call it back out directly later)
at the same time, i deleted the description line out of the title&description column so it was just a title column. then i had seperate title columns and description columns.

then going to the tpl_tabular_display.php, i completely deleted the loop that runs through the columns in what appeared to be the most complicated table loop ive ever seen, and just card coded the double row template that i wanted to repeat for each item...

thanks for pointing me to the right files.