If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
I was thinking someone else may have asked this question but I'm not finding it. Is it possible to include a custom field in the CTGY Page Sort by method?
There is currently nothing naively built in to sort by a custom field on the category page. There are a couple toolkit ways to do it. Are you looking to just have the custom field name in the drop down and sort alphabetically when selected, or something else?
The field is for the "grade" of an item - Fine, Very Fine, ect - which would make it difficult to be some sort of "alpha" sort. Guess I need to table this idea for a while.
This works: <mvt:item name="toolkit" param="asortmulti|l.all_settings:category_listing| :customfield_values:customfields:Illustration_Numb er|1" />
In my example this is on a cat page in the Category Product List Layout and located just before the <mvt:foreach iterator="product" array="category_listing:products">. The custom field code is Illustration_Number. I hope this saves you hours of trial and effort. I put a ticket in with miva and this is all they sent me. I did ask for sorting by custom field and there was no help with that part of it at all. I give them credit for being as good as they are but this answer would not help the average Joe at all. I guess that's what keeps us developers in business but I personally had to spend 30 minutes to figure this out.
Use asortmulti to sort a multidimensional array. The 2nd parameter is the array name. The 3rd is the column to sort on. It must be preceeded with the colon character. The 4th parameter is the direction of the sort. Use 1 for ascending and -1 for descending. Below is an example of sorting the category list in the Power Search display.
<mvt:item name="toolkit" param="asortmulti|l.all_settings:searchcats|:name| 1" />
The field is for the "grade" of an item - Fine, Very Fine, ect - which would make it difficult to be some sort of "alpha" sort. Guess I need to table this idea for a while.
If you entered the VALUE for the field as 1:Good, 2:Fine, 3:Very Fine, etc, you could use that field for sorting by first tokenizing the value using the first segment for sorting and the second for the display value.
Comment