I managed to do it with the original version but as the results are pulled from a different php page now with different scripting, i can no longer use what I have already to get products into columns rather than rows?
It used to work by sorting the product template and using this to force a new row..
$itemCount++;
if ($itemCount == 3)
{
print "";
print "";
$itemCount = 0;
}
}
I cant get the products into columns at all now, they just keep falling into rows for some reason?
Any ideas on how this can be done again?
Thanks
Adam
HI David,
If i want to do the same thing above, i.e. show products in 3 columns, do i need to comment out anything in html/searchresults.php?
And where should i add the "
<?php
if ($count++ == 3): $count = 0;
?>
thanks in advance!
Henry
I also found another thread about this. The thread is at http://www.pricetapestry.com/node/2880
But the download link for the html/searchresults.php is not working...
Hi Henry,
I've re-instated the file from the other thread!
Cheers,
David.
--
PriceTapestry.com
Hi David,
Thanks! Just to summarize what i did, so that others who face this problem can DIY easily.
If you want to display products in columns of 3 instead of one column now, do this
1) download searchresults.php from http://www.pricetapestry.com/node/2880
2) edit the file if you want to change the no of colums (default is 3)
3) upload and replace the file at html/searchresults.php
and it work like a charm!
I just have two things to do
1) increase the font size to fit the enlarged product pictures (for some reason, all my product pics went from the small size (one column size) to huge
2) either that or to edit the picture size.
David can advise?
Henry
p.s David > if i seem too busybody, pls let me know. I thought the information on this forum is GOLD!! except that sometimes information are scattered all over, and it would take someone to go through all threads on one topic to piece everything together. So i thought i just contribute what i have.
Hi Henry,
The search results are output within the CSS class "searchresults", so you can style any part of it via default.css as required (you'll find existing styles defined in there for searchresults which you can use as a starting point), or override those as in the grid version within style tags. For the product name front size for example look for the following style on line 26:
style='font-size:x-small;font-weight:bold;'
...similarly, to fix the image size, add a height tag on line 37 immediately after border='0', so you would have:
border='0' height='80'
When using the grid view it's best to fix the height so that the layout appears uniform across the page.
Cheers,
David.
--
PriceTapestry.com
Hi Adam,
Sorry about that..! The new code is in html/searchresults.php; and I think the reason you're having problems is because the table row code is within the foreach loop. What you need to do is move it outside the foreach loop; and then use code similar to before to count up to the max number of columns and start a new row if necessary. The outline should be something like this.
<?php $count = 0; ?>
<div class='searchresults'>
<table width='100%'>
<tr>
<?php foreach($searchresults["products"] as $product): ?>
<td>
<!-- display product info here -->
</td>
<?php if ($count++ == 3): $count = 0; ?>
</tr>
<tr>
<?php endif; ?>
<?php endforeach; ?>
</tr>
</table>
</div>
Let me know if that helps...
Cheers,
David.