Rhobur Posted December 19, 2011 Share Posted December 19, 2011 Hi, Did anybody found a working solution for randomly listing of products in categories (PS 1.4.6.2) ? Link to comment Share on other sites More sharing options...
Carl Favre Posted December 19, 2011 Share Posted December 19, 2011 Hi Rhobur, What is your problem exactly? Link to comment Share on other sites More sharing options...
doekia Posted December 19, 2011 Share Posted December 19, 2011 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 Link to comment Share on other sites More sharing options...
Rhobur Posted December 20, 2011 Author Share Posted December 20, 2011 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 More sharing options...
Rhobur Posted December 20, 2011 Author Share Posted December 20, 2011 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 More sharing options...
doekia Posted December 20, 2011 Share Posted December 20, 2011 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 Link to comment Share on other sites More sharing options...
Rhobur Posted December 21, 2011 Author Share Posted December 21, 2011 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 More sharing options...
doekia Posted December 21, 2011 Share Posted December 21, 2011 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 More sharing options...
Rhobur Posted December 21, 2011 Author Share Posted December 21, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now