Jump to content

[SOLVED] Change number of items in "same category" module


Recommended Posts

Hello,

 

is there a way to limit the number of displayed items in the default "same category" module that comes with PS 1.4?

 

Having categories with many items creates a considerable number of links on the page, which according to Google Webmaster tools is a no-no.

 

Any ideas or recommendations?

 

Your help is much appreciated.

 

Kindly,

 

Dan

Link to comment
Share on other sites

Hi Dan,

In your modules/productscategory/productscategory.php, change the value from 100 to whatever you would prefer in this line:

 

$categoryProducts = $category->getProducts((int)($cookie->id_lang), 1, 100); /* 100 products max. */

 

Please let me know if that works for you.

 

-Mike

Link to comment
Share on other sites

Hi Mike,

 

thanks for your incredibly fast reply, I'll give it a try.

 

Do you happen to know how the items are selected, i.e. by date added, alphabetically, etc... ?

 

Thanks!

 

Dan

 

I don't know that off the top of my head, but give my suggestion a try and let me know if that works for you!

 

-Mike

Link to comment
Share on other sites

Hi Mike,

 

this works perfectly, BUT I still have a question: is it possible to make it so it sorts by the newest items first from the same category only?

 

Like for example, limit this module to show the 5 latest items from the same category?

 

Currently it looks like it shows the items chronologically, as added.

 

Thanks again for your help!

 

Dan

Link to comment
Share on other sites

Hi Mike,

 

this works perfectly, BUT I still have a question: is it possible to make it so it sorts by the newest items first from the same category only?

 

Like for example, limit this module to show the 5 latest items from the same category?

 

Currently it looks like it shows the items chronologically, as added.

 

Thanks again for your help!

 

Dan

 

Hi Dan,

It's certainly possible, I just couldn't give you a code suggestion off the top of my head. Since that is a separate topic from this one, I'm going to go ahead and mark this as solved per the rules of the PrestaShop forums, but please feel free to create a new thread to get help on that question as well.

 

Happy selling!

 

-Mike

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...