Optimizing the Operation Speed of the Function CleanPositions in Prestashop

Optimizing the Operation Speed of the Function CleanPositions in Prestashop

This tip will help you to optimize the operation speed of the function cleanPositions. This function is used in the standard import feature and it is loading the database pretty much due to a large number of ‘Update’ requests.

This can become a serious problem if there is a large number of products in the directory, while the updated function works much faster.

Thanks for this solution to our friend and colleague Alexander Deynichenko.

The second method is proposed by Pavel Novitsky:

Create a procedure

and run it in cleanPositions() as


3 comments

  1. lordbdp,

    This code should replace Product::cleanPosition($id_category) i.e. it is best to place it in the file override / classes / Product.php.

Post a new comment

top