Post by jnixus » Sat May 02, 2009 11:39 pm

Hi all,

In opencart 1.2.6 what would I need to do to get more than 12 products showing on my product pages? The shop I am building has sometimes 28 pages in a category and I can't split it up any further.

Could I change this to 96 as a maximum rather than 12 before pagination starts?

Anyone knows how?

User avatar
New member

Posts

Joined
Fri Apr 17, 2009 3:26 am
Location - London

Post by jnixus » Mon May 04, 2009 6:19 am

everyone off celebrating bank holiday weekend? :)

just a pointer will do.

Been looking in the php and tpl files for product and there seems to be an if loop which does something like $i + 4

Is this where I should get it right for it to show more products?

I have set the css to auto on height on all elements covering the content section just in case.

Am I barking up the wrong tree. Advice would be appreciated.

User avatar
New member

Posts

Joined
Fri Apr 17, 2009 3:26 am
Location - London

Post by jnixus » Tue May 05, 2009 2:22 am

Anyone?

User avatar
New member

Posts

Joined
Fri Apr 17, 2009 3:26 am
Location - London

Post by phpuk » Tue May 05, 2009 8:28 am

I have had a quick!!! look for you...

Script: catalog/controller/product/category.php
Line: 107

The line reads:

Code: Select all

$results = $this->model_catalog_product->getProductsByCategoryId($category_id, $sort, $order, ($page - 1) * 12, 12);
Change to what ever you need in increments of 4 for example:

Code: Select all

$results = $this->model_catalog_product->getProductsByCategoryId($category_id, $sort, $order, ($page - 1) * 24, 24);
Then you must match this with line: 195
The line reads:

Code: Select all

$pagination->limit = 12;
To match the above you would enter 24 for example:

Code: Select all

$pagination->limit = 24;
You will need to also change...

Script: catalog/controller/product/manufacturer.php
Line: 58
and line: 146 to match.

There may be others to change but you get the idea now...

Phil.

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by jnixus » Tue May 05, 2009 1:21 pm

Great stuff.

Thanks for that phpuk.

I will have a try and let you know how I am getting on.

User avatar
New member

Posts

Joined
Fri Apr 17, 2009 3:26 am
Location - London

Post by jnixus » Sun May 10, 2009 5:55 pm

Hi Phil,

Thanks for that. I forgot to get back to you but yes that was the trick I needed.

User avatar
New member

Posts

Joined
Fri Apr 17, 2009 3:26 am
Location - London

Post by phpuk » Mon May 11, 2009 12:53 am

Your welcome.

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by Leon » Thu Jul 23, 2009 10:12 pm

I'm having a bit of trouble with this code now.
The page still displays correctly as it should, but the pagination doesn't quite work correctly.

It doubles the amount of products, and it doubles the amount of pages, so there are no products on the last pages.

I've taken a look at the code, and i really can't see what's changed in the new version of opencart to affect this :(

Active Member

Posts

Joined
Tue Apr 07, 2009 1:20 am

Post by webstudent1 » Tue Mar 16, 2010 10:55 am

All ok on opencart 1.3.4

Look like you forgot to edit this line to 24 from 12
$pagination->limit = 24;

New member

Posts

Joined
Thu Jan 07, 2010 2:24 am
Who is online

Users browsing this forum: No registered users and 13 guests