prashant2892 Posted September 8, 2016 Share Posted September 8, 2016 Hello, I want to show random products on each product category page. currently it's showing most visited / most popular product first.. Thank You, Prashant Link to comment Share on other sites More sharing options...
NemoPS Posted September 10, 2016 Share Posted September 10, 2016 classes/Category.phpLocate this if ($random === true) { $sql .= ' ORDER BY RAND() LIMIT '.(int)$random_number_products; } else { $sql .= ' ORDER BY '.(!empty($order_by_prefix) ? $order_by_prefix.'.' : '').'`'.bqSQL($order_by).'` '.pSQL($order_way).' LIMIT '.(((int)$p - 1) * (int)$n).','.(int)$n; } Just remove the condition and always leave the first statement as true 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