Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Sort order based on 2 list columns product listing

Sort order based on 2 list columns product listing

Locked

Views: 709

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
18 Mar 2010, 11:14 AM
#1
bikeforce avatar

bikeforce

New Zenner

Join Date:
Sep 2009
Posts:
73
Plugin Contributions:
0

Sort order based on 2 list columns product listing

Hi

I am Creating a new website using latest zen 1.37.

I have created some custom fields and displayed them in the product listing. They can be sorted individually.

I was wondering if it is possible to have the default sort order so one column is sorted in ascending order but then so is the another one.

for example I have a field which is text called thread - it is thread size.

I can sort by this easily enough. But then there is another column called length (whic is decimal) - I can sort this easy enough.

However I when I click to sort thread I want length to be sorted in ascending order too as asecondary measure

Currently

Thread length
M10 12
M10 40
M10 6
M11 12
M11 2

I want

Thread length
M10 6
M10 12
M10 40
M11 2
M11 12

I will be adding lots of products so I dont want to spend lots of time fidling with the sort orders when adding a product.

Does anyone know how to do this?

18 Mar 2010, 11:57 AM
#2
bikeforce avatar

bikeforce

New Zenner

Join Date:
Sep 2009
Posts:
73
Plugin Contributions:
0

Re: Sort order based on 2 list columns product listing

Update Think I worked it out by modifyying the default filters

case 'PRODUCT_LIST_THREAD':
$listing_sql .= "p.products_Thread " . ($sort_order == 'd' ? 'desc' : '') . ", p.products_L";
break;