opencart Icon Logo
me@grafxflow

Written by me@grafxflow

27 Sep, 2012

0

3,082

Change number of products per row on search results page

The problem I had was to change the number of products on each row on the search results page from 4 to 3.

I was also using version 1.4.9.3 of OpenCart and I couldn't find a way via the admin, but after searching I managed to solve the problem by changing some code instead.

The page can be found in either

catalog/view/theme/default/template/product/search.tpl

or

catalog/view/theme/[your_theme_name]/template/product/search.tpl

Then find the following segment of code.

<table class="list">
    <?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ? >
    <tr>
    <?php for ($j = $i; $j < ($i + 4); $j++) { ? >

and change it to the new number in both places

<table class="list">
    <?php for ($i = 0; $i < sizeof($products); $i = $i + 3) { ? >
    <tr>
    <?php for ($j = $i; $j < ($i + 3); $j++) { ? >

Add comment

Smart Search

133 Following
50 Followers

me@grafxflow

Hull, United Kingdom

I am a Full-stack Developer who also started delving into the world of UX/UI Design a few years back. I blog and tweet to hopefully share a little bit of knowledge that can help others around the web. Thanks for stopping by!

Follow