Sorting of translated categories in list view
|Status:||Under Review||Start date:||2011-10-24|
|Priority:||Should have||Due date:|
|Category:||Bug||Spent time:||0.10 hour|
If a list of translated products is shown list view, the order depents on the original order of not the translated products. This means the list isn't sorted alphabetically.
Updated by Roman Schürmann over 1 year ago
If a list of translated products is shown list view and the option: sortAllitems.type=alphabetiDesc
is choosen, the order of the translated products is like the order of not the translated products.
This means the list isn't sorted alphabetically anymore.
Updated by Georg Schönweger 10 months ago
- File class.tx_commerce_db_category.patch added
- Status changed from Resolved to Under Review
Sry but this change should be reverted/changed because;
a) function get_child_categories(): it will sort ALWAYS categories by title (when using multiple languages and current language is not default language). I guess most users do not want this behaviour ...
b) function get_child_products(): when current language is default language it will double query the products
IMO standart way of sorting translated items is to use the sorting of default language, so this patch does not make sense for me.
Sorting by title is a special case and should be queried and only then it should use different sorting for translated items.
Think also about shops which are NOT using "hideNonTranslated" mode (see http://forge.typo3.org/issues/31772). It will become difficult to handle this translation mode when translated items are sorted different than default ones.
Because sorting by title is a special case it should be done by using hooks.
For Products there exists already a hook which could be used for this; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_db_category.php']['productQueryPostHook']
For Categories a hook could be added.
Attached patch introduces new hook categoryQueryPostHook for this purpose and deletes changes from patch file patch_31226.patch.