Re: ZCA Bootstrap 4 Template [Support Thread]
Quote:
Originally Posted by
Nick1973
Just a quick one, on the product listing...
modules/bootstrap/product_listing.php does not format correctly when setting the number of columns required.
this
PHP Code:
if ($product_listing_layout_style === 'columns' || $product_listing_layout_style === 'fluid') { $lc_text = implode('<br>', $product_contents); $style = ''; if ($product_listing_layout_style === 'columns') { $style = ' style="width:' . $col_width . '%;"';
needs changing to this
PHP Code:
if ($product_listing_layout_style === 'columns' || $product_listing_layout_style === 'fluid') { $lc_text = implode('<br>', $product_contents); $style = ''; if ($product_listing_layout_style === 'columns') { /* $style = ' style="width:' . $col_width . '%;"'*/;
Or you need to take out the line
PHP Code:
$style = ' style="width:' . $col_width . '%;"'
altogether
I'll review that, but why would you hard-code the number of columns instead of letting the bootstrap responsiveness do its thing?
2 Attachment(s)
Re: ZCA Bootstrap 4 Template [Support Thread]
Quote:
Originally Posted by
lat9
I'll review that, but why would you hard-code the number of columns instead of letting the bootstrap responsiveness do its thing?
The product listing when using columns doesn't fit 100% of the column width. For example, if I have it set to two columns it only fits 49.5% of the column width - or halfway across.
I didn't really hardcode it, just took out style="width:49.5%" or whatever as that will change if you have three, four or five columns and so on. The responsiveness works fine without it.
I've attached images so you can see before and after the change:
Before
Attachment 19749
After
Attachment 19750
Re: ZCA Bootstrap 4 Template [Support Thread]
Right, if you really want a fluid set of columns, you should set the product-listing's configuration for columns-per-row to 0.
Re: ZCA Bootstrap 4 Template [Support Thread]
ok but then it changes to four across, plus that isn't very clear in the admin. Perhaps just a simple text instruction on columns per row?
So how do I change it from 4 across to 3 across or 2 across?
Re: ZCA Bootstrap 4 Template [Support Thread]
Quote:
Originally Posted by
Nick1973
Just a quick one, on the product listing...
modules/bootstrap/product_listing.php does not format correctly when setting the number of columns required.
this
PHP Code:
if ($product_listing_layout_style === 'columns' || $product_listing_layout_style === 'fluid') { $lc_text = implode('<br>', $product_contents); $style = ''; if ($product_listing_layout_style === 'columns') { $style = ' style="width:' . $col_width . '%;"';
needs changing to this
PHP Code:
if ($product_listing_layout_style === 'columns' || $product_listing_layout_style === 'fluid') { $lc_text = implode('<br>', $product_contents); $style = ''; if ($product_listing_layout_style === 'columns') { /* $style = ' style="width:' . $col_width . '%;"'*/;
Or you need to take out the line
PHP Code:
$style = ' style="width:' . $col_width . '%;"'
altogether
I recall DrByte strongly suggested not to mess with that line (around 400 correct?), and to edit in case the lines around 180
PHP Code:
// set css classes for "row" wrapper, to allow for fluid grouping of cells based on viewport
// these defaults are based on Bootstrap4, but can be customized to suit your own framework
if ($product_listing_layout_style === 'fluid') {
$grid_cards_classes = 'row-cols-1 row-cols-md-2 row-cols-lg-2 row-cols-xl-3';
// this array is intentionally in reverse order, with largest index first
$grid_classes_matrix = [
'10' => 'row-cols-1 row-cols-md-2 row-cols-lg-4 row-cols-xl-5',
'8' => 'row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4',
'6' => 'row-cols-1 row-cols-md-2 row-cols-lg-2 row-cols-xl-3',
];
Re: ZCA Bootstrap 4 Template [Support Thread]
Quote:
Originally Posted by
keneso
I recall DrByte strongly suggested not to mess with that line (around 400 correct?), and to edit in case the lines around 180
PHP Code:
// set css classes for "row" wrapper, to allow for fluid grouping of cells based on viewport
// these defaults are based on Bootstrap4, but can be customized to suit your own framework
if ($product_listing_layout_style === 'fluid') {
$grid_cards_classes = 'row-cols-1 row-cols-md-2 row-cols-lg-2 row-cols-xl-3';
// this array is intentionally in reverse order, with largest index first
$grid_classes_matrix = [
'10' => 'row-cols-1 row-cols-md-2 row-cols-lg-4 row-cols-xl-5',
'8' => 'row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4',
'6' => 'row-cols-1 row-cols-md-2 row-cols-lg-2 row-cols-xl-3',
];
Thanks, @keneso, that's exactly what I was going to suggest. FWIW, products' listings with this template are best rendered either in row or fluid mode, since setting specific column widths doesn't play well with bootstrap's 'card' layouts.
Re: ZCA Bootstrap 4 Template [Support Thread]
Cindy, you have recommended this change to me in the past and it has worked like a charm. It is briefly mentioned in the documentation on Columnar Layout for Product Listing pages here:
https://docs.zen-cart.com/user/templ...sting_columns/
Re: ZCA Bootstrap 4 Template [Support Thread]
Quote:
Originally Posted by
swguy
Thanks, Scott, I didn't realize that that documentation exists!
Re: ZCA Bootstrap 4 Template [Support Thread]
Any chance someone has this as a demo that I can see? The original one listed in this thread says "domain for sale" lol
Re: ZCA Bootstrap 4 Template [Support Thread]
Quote:
Originally Posted by
g2ktcf
Any chance someone has this as a demo that I can see? The original one listed in this thread says "domain for sale" lol
Sure: https://vinosdefrutastropicales.com/zc157_bs4/