Columnar Layout for Product Listing pages

Presenting products in a Grid

Since 1.5.7, Zen Cart includes a configuration setting called Columns Per Row. This setting allows you to display multiple columns of products per row on the Product Listing page.

Note: Your template must also support this setting. Both the Responsive Classic and Bootstrap templates support this setting. Many older templates use a version of the Column Grid Layout plugin, which is deprecated by this setting.

This is what it looks like when Columns Per Row is set to 3. 3 Columns per Row



This is what it looks like when Columns Per Row is set to 1. The value 1 may be considered to be “rows mode.”

1 Column per Row

Note that the setting Columns Per Row only applies to Product Listing pages, not other listing pages such as All Products or New Products.

In the Bootstrap template, the recommended value of Columns Per Row is 0, which allows the template to determine how many columns will fit on the screen dynamically. A smaller window will have fewer columns, and a larger window will have more.

Here’s a Bootstrap listing page in a wide window (around 1500px):

Wide window - 4 columns

And here’s what the same page looks like when the window is narrowed to 1024px (iPad width):

Tablet window - 3 columns

And finally, here’s what the same page looks like when the window is narrowed to 500 px (mobile phone):

Tablet window - 1 column

Developer Tip: the number of columns shown at each window size may be adjusted by editing includes/modules/bootstrap/product_listing.php and modifying for $grid_classes_matrix.




Still have questions? Use the Search box in the upper right, or try the full list of FAQs. If you can't find it there, head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified July 15, 2021 by Scott C Wilson (780be01).