It's a nice looking contribution, but we ran into a big problem with it. I caused our hosting account to be suspended!!!
Here is what happened: I loaded the box, it looked fine, no problems, nice scrolling. Then I noticed that the website's main page takes a long time to come up. I just thought my internet connection is acting up again, so I ignored it. Then, the website went down completely and I received an e-mail from the hosting provider informing me that my account has been suspended for excessive use of resources (not bandwidth or space limit).
So, I checked the logs:
Before installing this contribution:
Parse Time: 0.819 - Number of Queries: 495 - Query Time: 0.195765625717
After installing this contribution
Parse Time: 35.289 - Number of Queries: 22706 - Query Time: 4.02439738457
It seems this contribution loads all the specials into memory - we have over 1,500 products and they are all marked special (sale), so it was opening all of them.
Maybe it only does it like this if you have Image Handler installed. Perhaps it's a combination of other factors that would not be reproduced in other Zen Cart stores...
We are running Zen Cart 1.3.7 and Image Handler2.
I wanted to share this information with other Zen Cart users because having slow page loads or even worse, having your account suspended is not a very pleasant experience.
The contribution can be restricted from loading all the specials, like Louis suggests by adding "limit 5" or "limit whatever" to the end of $random_product_query = ... but it will just truncate the list and load the same ones all the time, so it's not really a solution!
Perhaps someone can rewrite the contribution in such a way:
- Find all the products that are marked as special.
- Display a random list limited by a user defined value, something reasonable like 10 to 20 products by default.
Feedback is welcome!
Dan G.
Notebook Solutions Inc.