Dealing With Slow Loading of Zen Cart Admin Dashboard in Zen Cart 1.5.7

While working on a recent Zen Cart upgrade, we ran into an issue where the admin dashboard went from loading nearly instantaneously to taking at least 5 seconds to load in Zen Cart 1.5.7. The page loading would pause when the “New orders” section was next to be shown, so that seemed to be the source of this. That seemed to either be because of a bug or a change that significantly increased the amount of data being processed.

It turns out to be the later, as Zen Cart 1.5.7 by default queries attribute data for products when generating that section, which can significantly slow things down in some circumstances.

As of Zen Cart 1.5.7a, there is a simple way to disable that and return to previous load times for those that don’t require that data to be queried. In the file /[admin directory]/includes/modules/dashboard_widgets/RecentOrdersDashboardWidget.php, near the top is the following line:

$includeAttributesInProductDetailRows = true;

Switching that from “true” to “false” will disable the queries and restore the previous load time.

Leave a Reply

Your email address will not be published.