View Single Post
  #2  
Old 11-26-2017, 09:01 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Show random products from a category

You can extend your widget from \XLite\View\ItemsList\Product\Customer\Category\AC ategory class - this will allow you to show products from a particular category.

But the random order is not that easy. Yes, you can use "ORDER BY RAND()" by returning "RAND()" as the "order by" parameter in getSortByModeDefault() method. But MySQL is too slow when doing this on more than 100 products. So, you will have to implement some tricks to speed up random queries.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote