VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: FICBA on May 13, 2012, 12:03:26 PM

Title: Order category - products by newest product first
Post by: FICBA on May 13, 2012, 12:03:26 PM
Hi All,

I've looked and looked but I dont seem to be able to find a way of automatically displaying the products in a category by the newest added product first....

For example:-

Category (Summer) -

Product3
Product2
Product1

I know you can click the +/- to reorder the list, but I would like it to show the latest producted added at the top of the list automatically.

Thanks in advance.

Using VM 2.0.0 on Joomla 1.7.3

Julian
Title: Re: Order category - products by newest product first
Post by: FICBA on May 15, 2012, 11:36:53 AM
Anyone please?

Julian
Title: Re: Order category - products by newest product first
Post by: renegadesk on August 20, 2012, 09:21:16 AM
Hey buddy, you probably already have this fixed (or gave up!) by now but here's a solution that's worked for me based on the help within this thread http://forum.virtuemart.net/index.php?topic=97284.0

In Product Order Settings I've got Default product sort order set to Creation date and Default category sort order set to Creation Date.

Within /administrator/components/com_virtuemart/models/product.php on after line 366 add this:
$this->filter_order_Dir = 'DESC';   //PL temporary bug fix

so it WAS:


case 'created_on':
$orderBy = ' ORDER BY p.`created_on` ';
break;


NOW it's:


case 'created_on':
$orderBy = ' ORDER BY p.`created_on` ';
$this->filter_order_Dir = 'DESC';   //PL temporary bug fix
break;


That's working for me for showing latest products within category view. Hope that helps and I hope if I need to do this again I can find this post.
Title: Re: Order category - products by newest product first
Post by: giupi on August 30, 2012, 11:08:44 AM
Hello,

(Joomla 2.5.6 + VM 2.0.10)

I would also like to get the products view with the latest on top... this fix it didn't worked for me: no matter if I put DESC or ASC I always get the ordering from oldest to latest and it does not make sense... I have to click on the "order" to get the latest on top.

From what I've read on the forum it seems a VM bug that (maybe) will be fixed on 2.1.

Can someone confirm that or there is something I still miss in renegadesc fixing?

Thanks
Title: Re: Order category - products by newest product first
Post by: giupi on September 03, 2012, 10:30:58 AM
Found a (partial) solution here: http://forum.virtuemart.net/index.php?topic=99753.msg330929#msg330929
Title: Re: Order category - products by newest product first
Post by: namangarg88 on September 04, 2012, 06:29:41 AM
@ renegadesk
Your solution is working for back end of Virtuemart product listing but in the front end it is not working.