Jump to content

PS 1.7 Slow Categories Page because of Top Category


maestrobo

Recommended Posts

Hi there,

Just wanted to share my findings. PS 1.7 is very slow on the categories Page. Tested on 1.7.6.7

I have found it why. It is because of the little info about the "TOP CATEGORIES".

 

I found the culprit, it was a SQL query that was taking too much time.

It is in controllers/admin/AdminStatsController.php

Look for top_category and comment the section. You will speed really fast your categories page.
 

 case 'top_category':
            /*
                if (!($id_category = AdminStatsController::getBestCategory(
                    date('Y-m-d', strtotime('-1 month')),
                    date('Y-m-d')
                ))) {
                    $value = $this->trans('No category', array(), 'Admin.Stats.Feature');
                } else {
                    $category = new Category($id_category, $this->context->language->id);
                    $value = $category->name;
                }

                ConfigurationKPI::updateValue('TOP_CATEGORY', array($this->context->language->id => $value));
                ConfigurationKPI::updateValue(
                    'TOP_CATEGORY_EXPIRE',
                    array($this->context->language->id => strtotime('+1 day'))
                );
            */

break;

I have reported the bug:

https://github.com/PrestaShop/PrestaShop/issues/21106

 

Edited by maestrobo (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 years later...

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