Page 2 of 2

Re: PRODUCTS Sorting in summary doesn't work

Posted: Tue Jun 29, 2010 1:01 pm
by scooper
Just had this same problem and have narrowed it down (for me at least) to an issue with the module preferences.

When you make any changes on the preferences tab then various values are created in the 'cms_siteprefs' table of the db. One of these is 'Products_mapi_pref_sortorder' which is always set to the value 'in' no matter what you chose in the Default Sort Order drop down.

If you change this value manually using phpMyAdmin or similar to either 'asc' or 'desc' then the error doesn't occur (or you can delete the Products_mapi_pref_sortorder pref entirely).

I guess this pref isn't looked up when the sortorder is set to random hence which is why that works and other sortorders don't.

Obviously next time you change a preference then this value will be overwritten again with 'in' so it's not a great fix but if don't need to change your preferences then hopefully it will keep you going until the next release of the module.

s.

UPDATE::

Ok - after actually looking properly for the bug, the issue is the fact that the same param name is being used for 'Length Units:' as sortorder.  Hence the 'in' ... which is 'inches'... about time we all went metric imo.

So. If you want to change the param name then edit the function.admin_prefstab.php file. At about line 92 you'll have:

Code: Select all


    $smarty->assign('input_lengthunits',
		    $this->CreateInputDropdown($id,'sortorder',$opts,-1,
					       $this->GetPreference('products_lengthunits')));

change that to

Code: Select all


    $smarty->assign('input_lengthunits',
		    $this->CreateInputDropdown($id,'lengthunits',$opts,-1,
					       $this->GetPreference('products_lengthunits')));

and then you should be able to change preferences correctly.

I'll log this so hopefully it will be fixed for next version.