texxo Posted November 24, 2017 Share Posted November 24, 2017 Hello guys, i am trying to customize a theme i bought to suit my needs. My current problem is that when i click on a category, the products are being listed with the same order each time. I would like for them to be listed randomly but i dont know which file is responsible for this so i go and "touch it". Any help or direction would be highly appreciated. Thank you. Nikos Link to comment Share on other sites More sharing options...
col_vert Posted November 29, 2017 Share Posted November 29, 2017 Hey, i am on 1.6.0.9, in /classes/category.php around line 603: public function getProducts($id_lang, $p, $n, $order_by = null, $order_way = null, $get_total = false, $active = true, $random = false, $random_number_products = 1, $check_access = true, Context $context = null) ==> replace $random = false by $random = true , and also $random_number_products =30 or 50 .. Hope it ll works cheers 1 Link to comment Share on other sites More sharing options...
texxo Posted November 29, 2017 Author Share Posted November 29, 2017 Will try this and will reply. Link to comment Share on other sites More sharing options...
texxo Posted November 30, 2017 Author Share Posted November 30, 2017 Didn't do the work, even if i put it out from the variables declaration. Maybe it is also messing up with the options about the products listing from the back office and they are overriding it? I don't know but it would be really nice to be displaying randomly the products in the categories listings that to always be the same items in same positions. (gets boring) Link to comment Share on other sites More sharing options...
gokturk Posted May 1, 2021 Share Posted May 1, 2021 On 11/29/2017 at 6:15 AM, col_vert said: Hey, i am on 1.6.0.9, in /classes/category.php around line 603: public function getProducts($id_lang, $p, $n, $order_by = null, $order_way = null, $get_total = false, $active = true, $random = false, $random_number_products = 1, $check_access = true, Context $context = null) ==> replace $random = false by $random = true , and also $random_number_products =30 or 50 .. Hope it ll works cheers Thank you so much dude, code is working :) Link to comment Share on other sites More sharing options...
JoJo! Posted November 3, 2021 Share Posted November 3, 2021 (edited) anyone have the tip for 1.7.6.5? Because this one does not work ^^ Thank you Edited November 3, 2021 by JoJo! (see edit history) 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