Jump to content

Random listings in categories


Rhobur

Recommended Posts

Hi Rhobur,

 

What is your problem exactly?

 

I would like to have products randomly listed in each (sub)category instead by id, date added or modification date in order to have fresh pages every time ( like random in featured products).

Link to comment
Share on other sites

select id_product from PREFIX_category_product where id_category = $my_category_id order by rand() limit 8;

Avoid removing the limit and if you increase the value, stays in some reasonable range - preformances are at stake here

 

Where should I put that, checked the category.tpl and product-list.tpl but found no Select there; I used to know that, shame on me :(

Link to comment
Share on other sites

That is just a snippet on how to get random list of product from any category. You need to integrate that in a module and build module code and display (template) arround it.

 

Best,

(d)oekia

 

I see ! Well, if no other easier way I might just try that.

Thank you !

Link to comment
Share on other sites

You may try searching the forum for "random product" there are a couple of thread giving you hint. Sorry I haven't read them. Just keep in mind performance when implementing such. I have corrected a number of shops that get more than penalties by implementing "using bad logic/coding" sort of code.

It seems to work at first then your shop growth then one morning you realise the pages are getting 50+ secs to load

 

Best,

(d)oekia

Link to comment
Share on other sites

You may try searching the forum for "random product" there are a couple of thread giving you hint. Sorry I haven't read them. Just keep in mind performance when implementing such. I have corrected a number of shop that get more than penalties by implementing "using bad logic/coding" sort of code.

It seems to work at first then your shop groth then one morning you realise the pages are getting 50+ secs to load

 

Best,

(d)oekia

 

I have searched the forum but found nothing useful. You may have a point regarding the loading time, this has to be considered as well.

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...