Jump to content

product sorting in bestsales


Recommended Posts

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 by tout2004 (see edit history)
Link to comment
Share on other sites

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

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

×
×
  • Create New...