Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

customising the product listing page


xlilo

Recommended Posts

Posted

hi,

 

i have been scraching my head for a week now trying many diffrent ways of customising the page that shows the product list before the product description,

 

the page i am trying to change is:

 

http://www.homeofbathrooms.co.uk/index.php/cPath/143_146

 

this is the standard os commerce setup,

 

i have seen the next link bellow on the net and this is the page that i am trying to get mine to look like, all i wont to change is the way the products are layed out, here is the example page of what i am trying to achieve:

 

http://www.taps4less.com/Bath-Screen.html

 

is there a way of doing this? is it within the stylesheet.css? i cant seem to find were this page is controlled.

 

thanks,

 

Andy

Posted

You should be able to get the below to do what you want. This will split your display in two seperate columns then just format the display as you wish. This is not stock code so you will need to adjust the vars as required.

 

Back up your index.php page before making any changes. Sorry I can't provide more help but I am on the fly.

 

Take care.

 

	
<td align="center">
<?php
$number_of_columns = '2'; // the number of columns you want to display
$row_num = '1';
$col_num = '1';

$all_teams_query = db_query("SELECT team_id, name FROM teams WHERE noplay = '0' ORDER BY name");
$number_of_rows = ceil(db_num_rows($all_teams_query)/$number_of_columns);
$arr_cells = array();

while ($all_teams = db_fetch_array($all_teams_query)) {
// here is where you monkey with the html to display
		$arr_cells[$row_num][$col_num] = '<h2>' . $all_teams['name'] . '</h2><a href="team-roster.php?team=' . $all_teams['team_id'] . '" target="_blank"><strong>Team Roster</strong></a><br><br><strong>Representatives</strong><br><table width="300" border="0" cellpadding="5">' . get_reps($all_teams['team_id']) . '</table><br><br><br><br>';
	$row_num ++;
	if ($row_num > $number_of_rows) {
		$row_num = '1';
		$col_num ++;
	} 
}

echo '<div align="center"><table border="0" width="100%" cellpadding="10">';
foreach ($arr_cells as $row) {
echo '<tr>';
foreach ($row as $cell) {
echo '<td align="left" width="50%" valign="top">' . $cell . '</td>';
}
echo '</tr>';
}
echo '</table></div>';
?>
	</td>

How do you know when you know what you want to do for the rest of your life?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...