Page 1 of 1

Products sortby="f:fieldname" not working

Posted: Wed Mar 05, 2014 6:56 pm
by americanlotus
I can't seem to get the summary list from the Products module to sort based on a custom field I created. Basically, it's a list of horses that are going up for auction, and we want to sort the list by lot number. I placed the following code in the {content} block on my page:

Code: Select all

{Products sortby="f:LotNumber"}
However, the list only sorts based on the default setting in the Products module itself. I get no errors; all the items display as they should... just not sorted the way I want them to.

Any suggestions are greatly appreciated. Thanks!

CMSMS 1.11.9
Products 2.20.1
CGEcommerceBase 1.4.3
CGExtensions 1.38.1
CGSimpleSmarty 1.7.1

Re: Products sortby="f:fieldname" not working

Posted: Thu Apr 10, 2014 10:10 am
by thomahawk
Hi
Did you get this solved?

I also have that problem. I have all the recent versions of CMSMS and plugins installed.

I tried
{Products sortby="f:sku" sortorder="desc"}

but it always only shows products listed in the order of ID.

Thom

Re: Products sortby="f:fieldname" not working

Posted: Thu Apr 17, 2014 9:33 am
by paulbaker
@americanlotus, this rang a bell with me, I had trouble with this initially. I think it's to do with CaSe of the field. I have just checked one of my Products installs which sorts perfectly and the sortby field is all lower case. Try that?

@thomahawk, I believe sku is a standard field so you don't need the "f:" bit - that is only required for custom fields.

Re: Products sortby="f:fieldname" not working

Posted: Thu Apr 17, 2014 10:34 am
by thomahawk
Thanks, Paul

Yes I thought so, but I tried {Products sortby="sku" sortorder="desc"} and it did not make any difference. I could not find a solution to this, so I changed all 25 items product ID (in MySQL) into the right order and I let frontend product list sort by ID now.