Jump to content

Changing best sellers block to recently sold


Recommended Posts

Hi, Ive fixed most of my problems in adapting my theme using this forum but there is one which i am stuck on.

 

With the best sellers page they are displayed by highest price first (as is the preference for the rest of my store) but I would like it to be displayed by order date so it can be turned in to a recently sold page.

 

Im using 1.4.5.1, am I on the right track in editing classes/productsale.php???

 

public static function getBestSales($id_lang, $pageNumber = 0, $nbProducts = 10, $orderBy=NULL, $orderWay=NULL)
{
 if ($pageNumber < 0) $pageNumber = 0;
 if ($nbProducts < 1) $nbProducts = 10;
 if (empty($orderBy) || $orderBy == 'position') $orderBy = 'sales';
 if (empty($orderWay)) $orderWay = 'DESC';

 

I tried

if (empty($orderBy) || $orderBy == 'position') $orderBy = 'invoice_date';

but that didnt do anything.

 

(I could find order date to put there so thought invoice date would do just as well???)

 

So I need to edit the dispaly order to date sold - most recent first and remove the pagination on the bestsales page only - not the entire site. Im quite new to code but hopefully someone can help.

 

Many thanks

Link to comment
Share on other sites

×
×
  • Create New...