Forums / Templates, Stylesheets, Page Layout / How to change my category product listing to look like this?

How to change my category product listing to look like this?

Views: 4,747

Results 1 to 9 of 9
30 Jan 2008, 6:00 PM
#1
sternelu avatar

sternelu

New Zenner

Join Date:
Jan 2008
Posts:
2
Plugin Contributions:
0

How to change my category product listing to look like this?

Hi,

Can anyone instruct me (or provide some samples of code) to modify my category produst listing to look like the following link:

http://osc2.template-help.com:8081/zencart_15792/index.php?main_page=index&cPath=12

All I want is to make "category produt listing" to look like "feature product", "special" or "new arrivals". I understood I need to modify temptelate/mytemplate/templates/tpl_modules_product_listing.php and /common/tpl_tabular_display.php. I thought I could use the coding of tpl_modules_featured_products.php to make it happen, but they are quite different.

Please help.....

Thanks

30 Jan 2008, 6:11 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: How to change my category product listing to look like this?

You don't want to change tpl_tabular_display.php, as that file is used for other purposes as well.
tpl_modules_product_listing.php won't really do the right job.

What you need to edit is /includes/modules/your_template/product_listing.php.

It will be fairly involved, since as you noted the listings use very different coding. There have been discussions of making this kind of change before - search for relevant keywords. I have to go now, but will give some pointers later if you still need help.

31 Jan 2008, 1:05 AM
#3
skdesigns avatar

skdesigns

New Zenner

Join Date:
Jan 2008
Posts:
3
Plugin Contributions:
0

Re: How to change my category product listing to look like this?

I have actually been struggling for the past couple days to get my product listings to display in the exact same manner. Any help anyone can offer is greatly appreciated.

31 Jan 2008, 9:31 AM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: How to change my category product listing to look like this?

The Heavily modifying Product Listings Page thread has some info and links that will be useful here.
Familiarize yourselves with that, try some things and post again, and I'll go into specifics.

1 Feb 2008, 9:28 AM
#5
sternelu avatar

sternelu

New Zenner

Join Date:
Jan 2008
Posts:
2
Plugin Contributions:
0

Re: How to change my category product listing to look like this?

Hi Gjh42,

Thanks for your help.

Afterward, I modified some coding in tpl_modules_product_listing.php and include/module/product_listing.php. It now looks like the way I want. I don't know if my coding will work for everybody. My key solution is to modify tpl_modules_product_listing.php. For your reference, here are some coding i did in tpl_modules_product_listing.php :

//line 35

<?php /** * load the list_box_content template to display the products */ if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') { require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php'); } else {// (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') //require($template->get_template_dir('tpl_tabular_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_tabular_display.php'); //***** Beginning OF Sternelu's version ?> <table width="100%" border="0" cellspacing="2" cellpadding="2">
<?php

for($row=1; $row<sizeof($list_box_contents); $row++) {

	echo '<tr><td rowspan=3 valign="top">' . $list_box_contents[$row][0]['text'].'</td>'; 
	echo '<td colspan=2>' . $list_box_contents[$row][2]['text'].'</td></tr>';
	echo '<tr><td>Model: ' . $list_box_contents[$row][1]['text'].'</td></tr>';
	echo '	<tr><td>' . $list_box_contents[$row][3]['text'].'</td><td>' . $list_box_contents[$row][9]['text'].'</td>	</tr>'; 

	echo '	<tr><td colspan=3><hr/></td></tr>'; 

}
?>

</table> <? //******** End oF Sternelu's version } ?>
1 Feb 2008, 7:08 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: How to change my category product listing to look like this?

Thanks for posting that. A link to your site would be useful for understanding the results of your code.

Note for anyone looking to replicate this: This is the Column Grid mod version of tpl_modules_product_listing.php, not the stock version (the new coding would be the same, but the surroundings look different). It bypasses tpl_tabular_display.php and puts the basic display code in tpl_modules_product_listing.php.

It is being used in "rows" mode, not "columns" mode, or else there would not be individual elements in $list_box_contents[$row][n] but whole products. (So this code would not work in columns mode.)

The code given is dependent on the display order set in admin, so the $list_box_contents[$row][2] will apply to whichever element you have set to display third (counting from 0). Parameter (class) and alignment settings from product_listing.php are discarded.

12 Mar 2011, 12:37 PM
#7
amolelite avatar

amolelite

New Zenner

Join Date:
Mar 2011
Posts:
16
Plugin Contributions:
0

Re: How to change my category product listing to look like this?

Hello every one,

Actually i am looking for the different solution.....

Can any one here will tell me how to create our own page of product listing as in the zencart's product listing...

I have created my own page but i am unable to display the product in my new page...

Can any one suggest me any solution....

thanks in advanced..

12 Mar 2011, 2:00 PM
#8
amolelite avatar

amolelite

New Zenner

Join Date:
Mar 2011
Posts:
16
Plugin Contributions:
0

Re: How to change my category product listing to look like this?

Can any one tell me what this code

$listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id', 'page');

in

includes/modules/product_listing.php does...exactly

it's giving me the error as

1109 Unknown table 'p' in field list
in:
[select count(p.products_id) as total ]

when I am linking it to my new page...

Thanks in advanced....

14 Mar 2011, 6:52 AM
#9
amolelite avatar

amolelite

New Zenner

Join Date:
Mar 2011
Posts:
16
Plugin Contributions:
0

Re: How to change my category product listing to look like this?

Cheeeeeeerrrrrrs Guys,

I have succesfully fixed my bug and have achieved my task..

Thanks every one over here for the help....

:clap::clap::clap::clap::clap: