Post by shahram » Wed Mar 10, 2010 1:50 pm

Hi all how i can show more then 8 products like i want to show 12 or 14 products on my home page Thank You

Newbie

Posts

Joined
Wed Aug 12, 2009 10:52 am

Post by Mirko » Wed Mar 10, 2010 5:58 pm

Hi!

In catalog/controller/common/home.php

Change the argument to getLatestProducts() on line 21. For example change:

Code: Select all

foreach ($this->model_catalog_product->getLatestProducts(8) as $result) {
to

Code: Select all

foreach ($this->model_catalog_product->getLatestProducts(12) as $result) {
HTH

Newbie

Posts

Joined
Fri Mar 05, 2010 5:59 am

Post by feriyo » Wed May 05, 2010 7:31 am

Mirko wrote:Hi!

In catalog/controller/common/home.php

Change the argument to getLatestProducts() on line 21. For example change:

Code: Select all

foreach ($this->model_catalog_product->getLatestProducts(8) as $result) {
to

Code: Select all

foreach ($this->model_catalog_product->getLatestProducts(12) as $result) {
HTH
This worked wonderfully, thank you!
I would like to know if there is a code I can change to show more than 12 products on categories section too.
Thank you in advance.

Newbie

Posts

Joined
Sun Apr 04, 2010 2:42 pm

Post by feriyo » Wed May 05, 2010 8:00 am

I just found how to show more than 12 products in categories, maybe this will help somebody else.

In catalog/controller/product/category.php

change the arguments on those lines:

$results = $this->model_catalog_product->getProductsByCategoryId($category_id, $sort, $order, ($page - 1) * 12, 12);

$pagination->limit = 12;

to

$results = $this->model_catalog_product->getProductsByCategoryId($category_id, $sort, $order, ($page - 1) * 16, 16);

$pagination->limit = 16;

Newbie

Posts

Joined
Sun Apr 04, 2010 2:42 pm

Post by Qphoria » Wed May 05, 2010 9:00 am

feriyo wrote:I just found how to show more than 12 products in categories, maybe this will help somebody else.

In catalog/controller/product/category.php

change the arguments on those lines:

$results = $this->model_catalog_product->getProductsByCategoryId($category_id, $sort, $order, ($page - 1) * 12, 12);

$pagination->limit = 12;

to

$results = $this->model_catalog_product->getProductsByCategoryId($category_id, $sort, $order, ($page - 1) * 16, 16);

$pagination->limit = 16;

This was already made configurable via admin in 1.4.7 and later

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Purebeads » Wed May 05, 2010 12:36 pm

Qphoria wrote:This was already made configurable via admin in 1.4.7 and later

In what section of admin is it configurable? I can't find it.

Actually, I think I found it. However, I want more than 8 latest products. The admin fix works for only categories and searches.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by Qphoria » Wed May 05, 2010 12:40 pm

Right.. for the latest products it will be added in 1.4.8
I was only saying for the example above and all other limits, that it was in the admin

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Purebeads » Wed May 05, 2010 12:47 pm

When will 1.4.8 come out? I really want that feature.

How about Add-to-Cart buttons on the main page?

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by navex » Wed May 05, 2010 1:48 pm

Try this one. You could figure it out with some php knowledge. link:http://forum.opencart.com/viewtopic.php ... art+button

New member

Posts

Joined
Sat Feb 06, 2010 4:15 pm

Post by Purebeads » Wed May 05, 2010 5:06 pm

Thanks, but I don't have any PHP knowledge. What do I do with what's in the zip file?

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by Qphoria » Wed May 05, 2010 7:28 pm

How often are you going to change the latest products? Maybe once or twice? You don't really want that feature.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Purebeads » Thu May 06, 2010 12:35 am

I post 30 new products a month. It's what drives traffic to my store.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by Qphoria » Thu May 06, 2010 1:19 am

But you won't likely change how many are shown on the page each month

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Purebeads » Thu May 06, 2010 2:03 am

I don't understand what you are saying. Right now, OpenCart lists 8 "latest" items (in the middle pane) when a person clicks on "Home". I want it to list up to 60 items. I am not using the Latest module because I don't want this information in a side column with small pictures.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by anshin » Fri May 07, 2010 11:30 am

I think I see what you are saying, this is how I changed mine.

I know you don't have much php experience, but it is easy to do.

Open the file catalog>controller>product>category.php and on line 116 you will see this:

Code: Select all

$results = $this->model_catalog_product->getProductsByCategoryId($category_id, $sort, $order, ($page - 1) * 30, 30);
The last two sets of numbers "30,30" are normally "12,12" ... so change them to what ever you want. Save the file and upload it to the path that I have shown above.

Also, if you want to change the amount shown on the main page, follow these directions.

Open the file catalog>controller>common?home.php and on line 21 you will see this:

Code: Select all

foreach ($this->model_catalog_product->getLatestProducts(12) as $result) {
The number in () ie: (12) was (8) and I changed mine to 12.

Have a go and good luck. :)

Newbie

Posts

Joined
Sat May 09, 2009 12:06 am

Post by Qphoria » Fri May 07, 2010 11:51 am

You are asking for something that was answered above. I am replying to your comments about "needing" it in the admin. Once you change it to 60, you won't likely be changing it that often so you don't "need" it. It would just be nice to have in the admin to change that 1 time. All the same.. it will be there in the next version.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Purebeads » Fri May 07, 2010 2:09 pm

Qphoria, you were absolutely right -- the answer was given above. For some reason I didn't see it, or I didn't understand what I was reading. Sorry to have bothered you unnecessarily.

You are right, I don't need it as a feature in the interface (although it will be nice to have).

Thanks! It is working perfectly. Now I just need "Add to Cart" buttons in the center column, and all my problems will be solved.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by i2Paq » Fri May 07, 2010 3:00 pm

Purebeads wrote:When will 1.4.8 come out?
Q is aiming for the 3rd week of May.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by stezza_007 » Thu Dec 16, 2010 7:28 pm

Hi all, does anyone know how to show more than 8 products in the latest Opencart version? 1.4.9.1

I can't find any new variables in the admin pages or any docs on it.

Thanks alot!

Newbie

Posts

Joined
Thu Dec 16, 2010 7:26 pm

Post by stezza_007 » Thu Dec 16, 2010 7:56 pm

Ok, don't worry, I solved it. In 1.4.9.1 you have to go to catalog > controller > module and edit latest.php, the line that reads:

$results = $this->model_catalog_product->getLatestProducts($this->config->get('latest_limit'));

Where is latest_limit set?

I didn't know so I just hard coded the current max number of my products like so:
$results = $this->model_catalog_product->getLatestProducts(20);

Newbie

Posts

Joined
Thu Dec 16, 2010 7:26 pm
Who is online

Users browsing this forum: No registered users and 17 guests