tout2004 Posted June 15, 2014 Share Posted June 15, 2014 (edited) Hello I am trying to adapt the bestsales page to display most recent orders (our products are all unique so there are no top sellers as such), it should be quite simple but don’t know what variable to place in the orderby of BestSalesController.php instread of my current date_upd (tried many variables such as invoice_number etc none retreive any products) self::$smarty->assign(array( 'products' => ProductSale::getBestSales((int)(self::$cookie->id_lang), (int)($this->p) - 1, (int)($this->n), "date_upd", "desc"), many thanks for any help Edited June 15, 2014 by tout2004 (see edit history) Link to comment Share on other sites More sharing options...
Ronaldo Perez Posted June 15, 2014 Share Posted June 15, 2014 it's not built-in functionality, so you can't just place new parameter in method call. Instead you must override getBestSales from ProductSale class and change mysql query by joining orders and order_detail tables Link to comment Share on other sites More sharing options...
tout2004 Posted June 15, 2014 Author Share Posted June 15, 2014 I was hoping it was easier than that - the tmbestsellerblock displays them as I would like - with the most recent sold first (but just not on the bestsales page) The tmbestsellerblock gets the code from getBestSalesLight which has ORDER BY sales_date DESC Is there not a way to copy that layout to the main page? I will start the look at what you suggested but my only coding experience is adapting my shop so I will need to do some reading Thanks for your reply Link to comment Share on other sites More sharing options...
tout2004 Posted June 15, 2014 Author Share Posted June 15, 2014 Ive done it, well pleased with myself!!! added ps.`date_upd` as sales_date in getBestSales and chaged ORDER BY sales_date DESC dont think that is the correct way but it works, recently sold products at the top oldest at the bottom Link to comment Share on other sites More sharing options...
Recommended Posts