Jump to content

Home Page slow down after enable "Randomly display featured products"


Recommended Posts


i install new one PS1.7.7.1 and disable the cache, because the randomly method not worked.

If i enable "Randomly display featured products" it work fine with 8 demo products. But when i import lot of products, the home page opening 13-15 seconds!

This happens with only 8 number of products to be displayed and about 500 featured (1500 total). If i disable Randomly display, it work fine again (loaded for 1.2s).

So, maybe it have some error in the algorithm. In both settings, with the same products, worked without delay. 

Link to comment
Share on other sites

  • 1 year later...

For some reason the process is slower in prestashop 1.7 but basically the module uses the getProducts function in the category class that makes a mysql query that when random has this code:

$sql .= ' ORDER BY RAND() LIMIT ' . (int) $randomNumberProducts;

This is a bad option in programming as it slows down the query a lot. Read this post for more information:


  • Like 1
Link to comment
Share on other sites

Good morning here. Prestashop is now a kind of hybrid between the old system and symphony, that means that before what was a simple sql in prestashop 1.6, there are now several classes involved with the consequent slowdown. To give you an example, for your issue I had to trace several classes until I reached the code of the category class. Making a mix between both versions is possible and you would speed up the processes a lot, but you lose the functionality of the new additions to the featured products module.

Link to comment
Share on other sites

7 hours ago, chipset said:

Heh, i am still on 1.6 and i am happy about this, just want to be  "modern".  30B is good alternative, but still no enough templates.

have you had the time tp compare shops on a mobile device? They all look the same. Its the product which needs to be in the center. Themes you can use from Prestahop, not all though, but there are template makers all over the world. In the end you need to invest in your business and its a tough sale on a cheap server with a free theme plus no IT staff.  

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