Design2Please Posted August 25, 2016 Share Posted August 25, 2016 (edited) Hi, I am currently building a site and I have imported all the orders from the old site into the new one, however when I navigate to the best sellers page https://www.sociablecook.co.uk/best-sellers it says that there are no top sellers at the moment. Does anyone know if there is there a way to generate the best sellers based on the historic orders I have imported or does Prestashop only base best sellers on orders that have been placed through the current site? Jon Edited August 26, 2016 by Design2Please (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted August 26, 2016 Share Posted August 26, 2016 Try calling the ProductSale::fillProductSales() function. That will copy data from the ps_order_detail table to the ps_product_sale table. Link to comment Share on other sites More sharing options...
Design2Please Posted August 26, 2016 Author Share Posted August 26, 2016 Hi Rocky, Thanks for the reply. Are you able to let me know how I go about calling the ProductSale::fillProductSales() function ? Thanks in advance Jon Link to comment Share on other sites More sharing options...
rocky Posted August 26, 2016 Share Posted August 26, 2016 You could create a file like fill.php in PrestaShop's root directory with the following: <?php require(dirname(__FILE__).'/config/config.inc.php'); ProductSale::fillProductSales(); Then run it in your browser. Hopefully, that will execute the function. Then you can delete the file when you're done. Link to comment Share on other sites More sharing options...
Design2Please Posted August 26, 2016 Author Share Posted August 26, 2016 Hi Rocky, Brilliant that has solved the issue. Thanks for your help with this. Jon Link to comment Share on other sites More sharing options...
rocky Posted August 26, 2016 Share Posted August 26, 2016 You're welcome. I'm happy it solved your problem. Link to comment Share on other sites More sharing options...
neoshop Posted October 27, 2016 Share Posted October 27, 2016 You're welcome. I'm happy it solved your problem. Thanks, it solved mine as well Link to comment Share on other sites More sharing options...
m3442a Posted October 31, 2019 Share Posted October 31, 2019 Hello, the script working very well. Is there any possibility to take the bestsellers just from the last year? And update daily over Cron? Is that possible? 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