I'm using 1551 on default black.
My related products grid shows 4 across but I want to change it to 5 or 6 - no matter what the image size it still only ever shows 4 products per line in the grid.
I can't find any way to set this in the back end so I would appreciate a little help please
Thanks !
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
The problem isn't the width - I can make the pics smaller so that 6 could easily fit in the space allotted, but when I do it still only shows 4 per row, so increasing the width of the div won't help unfortunately. It seems to me that the grid is being told to only display 4 in a row no matter what the width is. Thanks for trying though
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
In the other grid displays (specials / latest etc) the number of products per row is regulated by their size and changing that size changes how many will fit and therefor how many are displayed per row, but in related products it's not working like that - there's some code somewhere that's limiting it to 4 per row no matter how much space there is.
Hope that's more clear
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
Ok .. so what I really need to do is to decrease the space between each related product in the row a bit - just enough to fit the extra one on and make it look ok instead of 4 products left justified and a hunk of wasted space at the right side of the row. Css ?
Cheers !
Oh yeha - this must not affect any other grids (they're fine) - only the related products.
Edit:
Found it around line 200 on the default black style sheet ...
column-right .box-product > div,
#column-left .box-product > div { width: 158px; margin-right: none; }
#content .box-product > div { width: 130px; margin-right: 10px; }
Playing around with that and the image sizes I've managed to come to an almost happy medium, however the related products grid is indeed controlled by the same bit of css as the other grids, so tweaking one screws up the others.
I suppose the best thing would be to make a new class and edit the relevant tpl file to look for it instead of the global one - anyone know where/what file to edit ? I can't find any file like related.tpl or related-products.tpl or anything that looks like it might be it.
Which is what I meant when I said you had to change the div width.hillfish wrote: #column-left .box-product > div { width: 158px; margin-right: none; }
#content .box-product > div { width: 130px; margin-right: 10px; }
Playing around with that and the image sizes I've managed to come to an almost happy medium, however the related products grid is indeed controlled by the same bit of css as the other grids, so tweaking one screws up the others.
Copy the box-product section in your css and rename to say related-product, set it how you want. If you are using the default related products that shows in a tab on the product page, you need to edit product.tpl and change the class for that section to your newly renamed class.
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
Ok so I copied the .box-product block and renamed it, creating a new class called .box-related - the following is the block of code I copied and edited ...
Code: Select all
.box-related {
width: auto;
text-align: center;
overflow: hidden; }
#column-right .box-related,
#column-left .box-related { padding-left: none; }
#content .box-related { padding-left: 15px; text-align: center; }
.box-related > div {
width: 128px;
margin-right: 15px;
margin-bottom: 15px;
text-align: center; }
#column-right .box-related > div,
#column-left .box-related > div { width: 158px; margin-right: none; }
#content .box-related > div { width: 130px; margin-right: 10px; }
.box-related .image img { border: 1px solid #353535; }
#column-right .box-related .image img, #column-right .box-related .image img { }
.box-related .price { color: #ddd; }
I uploaded the new files and the result was not as expected - the related products 'grid' now displays only one row vertically down the left side (so it's a column now rather than a row, if you see what I mean).
The only difference between the block of code I copied and the original is a size value and a 'center' command - just for ease here is the unedited code block (the 'latest' grid is using this block of css and it looks fine) ...
Code: Select all
.box-product {
width: auto;
text-align: center;
overflow: hidden; }
#column-right .box-product,
#column-left .box-product { padding-left: none; }
#content .box-product { padding-left: 15px; text-align: left; }
.box-product > div {
width: 128px;
margin-right: 15px;
margin-bottom: 15px;
text-align: center; }
#column-right .box-product > div,
#column-left .box-product > div { width: 158px; margin-right: none; }
#content .box-product > div { width: 139px; margin-right: 15px; }
.box-product .image img { border: 1px solid #353535; }
#column-right .box-product .image img, #column-right .box-product .image img { }
.box-product .price { color: #ddd; }
So if someone could put me out of my stupidity and point me in the right direction I would be most grateful
Cheers
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
width: 128px; is the part you should have to change. Make it a few px bigger than the photo size you set and it should do it. You might need to adjust the img section width in the css to make the related images a different size than your other box product items. Be sure you keep them smaller than the photo size you set in the admin section so they don't get pixelated.
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
Users browsing this forum: No registered users and 196 guests