AutoDirector forum

The AutoDirector support and advice forum

How to ORDER BY

Post Reply

Page: 1

Author Post
Member
Registered: Nov 2008
Posts: 7
There are already a few options under the drop-down box, "Order By" but my client would also like to have the option to "order by" the VIN number or registration number.

Is there an easy way to implement this? I tried messing with /client/carlist.js but I couldn't get anything working...
Administrator
Registered: Apr 2008
Posts: 324
I'm afraid that it's a little trickier than you suspect because the VIN is never shown outside of the control panel - it was implemented so dealers could identify a vehicle.

It would be possible to implement in future versions. Would anyone else be interested in such a feature? If not, then we could create a custom solution for you, but would need to charge for that service.
_______________
AutoDirector administrator
Member
Registered: Nov 2008
Posts: 7
Hmmm... I see.

Well, what she really is trying to accomplish is having the ability to sort by "stock number" and we were going to use VIN data field for the stock number instead. Right now she just has the stock number in the description field, followed by the actual description itself.

On a similar note, is it possible to set a default "order by" value, maybe via the code that you use for integration? Maybe something as simple as adding "&orderby=___" to the URL?

Thanks!
Administrator
Registered: Apr 2008
Posts: 324
That should be possible in carlist.js. Take a look at var sortTypes on line 60 - following it is the sort functions in the order that they appear on the page. You can add, remove or amend any. You could possible use "a.info, b.info" to sort by the more information field.
_______________
AutoDirector administrator
Member
Registered: Nov 2008
Posts: 7
That works! Thanks!

Post Reply

Page: 1