Re: Column Layout Grid for Product Listing
thornhillguy - The Column Grid mod only applies to the product listing page, not the all products, featured, etc.
Develop&Promote - There is code in product_listing.php that sets the width of products based on the per-row setting, or the total number if less than that. You could disable the alternative calculation to have say 2 products aligned to the left. Search the forum to find where this has been discussed before; I will be back later if you still need help.
Re: Column Layout Grid for Product Listing
hi gjh42,
Thankyou for taking the time to help me out. I am still having issues with this problem. I am not great at PHP...I just know the basics...
I will carry on tinkering with it. Hopefully I will sort it. I am sure other people have had the same issue. I cant be the only one. I have searched so much, but not much info.
I wish my site was live so i could post the link.
Basic problem is that the 2 products are out of alignment. The images are pushed to the right. I hate that zen cart's width are percentages.
I look forward to your reply
Re: Column Layout Grid for Product Listing
Re: Column Layout Grid for Product Listing
Hey...just letting you know that ive fixed it.
line 238 from includes/modules/(template)/product_listing.php
PHP Code:
// Following code will be executed only if Column Layout (Grid Layout) option is chosen
if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
$lc_text = implode('<br />', $product_contents);
$list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' . ' ' . 'style="width: 200px' . $col_width . '%;"',
'text' => $lc_text);
$column ++;
if ($column >= PRODUCT_LISTING_COLUMNS_PER_ROW) {
$column = 0;
$rows ++;
I gave the box a width of 200px.
PHP Code:
' . 'style="width: 200px' . $col_width . '%;"',
Then changed css to suit.
Thanks for everyones help
Re: Column Layout Grid for Product Listing
You have left the $col_width and % in there, which ought to cause an error and probably have the inline styling ignored. Did you put a 200px width in the stylesheet?
A better way to alter this would be around line 100 in the Column Grid product_listing.php:
PHP Code:
// Used for Column Layout (Grid Layout) add on module
$column = 0;
if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
if ($num_products_count < PRODUCT_LISTING_COLUMNS_PER_ROW || PRODUCT_LISTING_COLUMNS_PER_ROW == 0 ) {
$col_width = floor(100/$num_products_count) - 0.5;
} else {
$col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 0.5;
}
}
// Used for Column Layout (Grid Layout) add on module
Change to
PHP Code:
// Used for Column Layout (Grid Layout) add on module
$column = 0;
if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
//if ($num_products_count < PRODUCT_LISTING_COLUMNS_PER_ROW || PRODUCT_LISTING_COLUMNS_PER_ROW == 0 ) {
//$col_width = floor(100/$num_products_count) - 0.5;
//} else {
$col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 0.5;
//}
}
// Used for Column Layout (Grid Layout) add on module
The remaining line
$col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 0.5;
will automatically make all products width according to the per-row setting, so if you were to change it to 3 per row you would not need to re-edit the code.
Re: Column Layout Grid for Product Listing
Hi,
I just installed this mod to a 1.3.9c cart, with 3 columns and it looked like what I was trying to achieve (I will need to play with the spacing, but I have columns instead of rows).
However, if there is an excess of a multiple of 3, the products are right aligned and not left? Ive tried it on the classic template and it appears to be correct so Im assuming its my templates stylesheet. Could someone guide me to how to get the correct alignment please?
Example: http://nemesisgifts.co.uk/index.php?...ort=20a&page=4
Thankyou
Re: Column Layout Grid for Product Listing
I don't see a clear answer if this mod works with 1.3.9 so I will toss my two cents in the pot.
I installed this on a fresh 1.3.9d install and it seems to work fine and as expected
I did not test with php 5.3 (5.2.9)
Re: Column Layout Grid for Product Listing
For Product Listing, is there a way to line up the title, desc, price, and more info (add to cart button)?
The only post I found suggested using a fixed image height with width at 0, but even then some products have very horizontal width pics and it looks even worse. :no:
At the very least I would like to be able to align my price and More Info button.
Thanks :smile:
Re: Column Layout Grid for Product Listing
hey everyone I too would like to know how to set up my products listings in GRID.
im using zencart 1.39d and this is how my products look like right now http://hlcstore.com/index.php?main_page=index&cPath=1
i was in ADMIN and Product listing but never found that option
wat shoul i do? i cant scan all 12 pages in this thread. can somebody help me? :oops:
Re: Column Layout Grid for Product Listing
Did you copy the files to your template folders?
Try double checking that you changed the names of the YOUR_TEMPLATE folders to the actual name of your template folders (includes/templates/yourtemplate). Its probably the most common mistake.
Another thing you could check is that you installed the SQL statement correctly, if at all.
If none of those are the problem, you may need to ask your website designer about it, they may have used some custom code that could be stopping it from working properly.
Hope that helps,
DB