Laurine_srd Posted May 23, 2017 Share Posted May 23, 2017 (edited) Hello, I'm writing here because of some issues I encounter and I cannot seem to find the right answer. So I hope you can help me. Here's the thing : I'm using prestashop 1.6.0.1.4. We run a small shop on scale modeling online. The problem we have is mostly with the customer page in the back office. It takes more and more time to load, for example, for a customer with a lots of orders, messages and products. We did some researches, and we managed to limit the carts and the orders with some SQL requests. That works fine, and seems to speed up the loading. What I am trying to do right now, is to do the same thing with the products and messages. Tricky thing too, there are two lists of products. One sorted by ID, the other by date. I managed to disabled the IDs list, because I only wanted the last products sorted by date. For the products, I tried to overide the getBoughtProduct function in Customer.php; the request works fine in mysql, but not on the website. Here's the code : public function getBoughtProducts() { return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT * FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.id_order = od.id_order WHERE o.`id_customer` = '.(int)$this->id) 'AND `date_add` >= ( current_date( ) - INTERVAL 365 DAY ) ORDER BY `o`.`date_add` DESC '; } } So I was wondering is it some other function that blocks this one? Does someone has ever tried to reduce the customer's products or messages? Can someone give me a hand? Thank you. Edited May 23, 2017 by Laurine_srd (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now