[TYPO3-commerce] how to change sorting of articles in list view
toni milovan
tmilovan at efpu.hr
Thu Jun 4 18:01:01 CEST 2009
Hi Morten,
Thanks for replying to my question. However no matter how hard I try I
cannot seem to find the "articleOrder" hook you mentioned below. I have
the latest commerce version from svn meaning 0.11.10 and mentioned hook
ain't there (postinit is).
Regarding the question why should I need such functionality, well my
client just wants it that way. He is creating many articles by just
copying template product, and after copying sorting field are empty so
he has to click to the sorter to fill the sorting fields for articles
while he just wants the to be sorted by the order they were created.
Thanks,
Toni
On 2009-06-03 08:38:50 +0200, Morten Olesen <mo at idefa.dk> said:
> Hi Toni
>
> Not really sure why you would want to do this now that sorting is finally in...
>
> at any rate
> articles,products,etc have a postinit hook that allowes you to change
> stuff such as which fields to load or sortorder ($this->orderField)
> before the actual database call
> Hook:
> $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_product.php']['postinit']
function:
>
> postInit($ref)
>
>
> Article order even has it's own hook
>
> Hook:
> $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_product.php']['articleOrder']
function:
>
> articleOrder($originalOrder)
>
> so:
> $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_product.php']['articleOrder'][]='EXT:/yourextension/class_tx_yourextension.php:tx_yourextension';
<?php
class
>
> tx_yourextension{
> function articleOrder($originalOrder){
> return 'uid';
> }
> }
> ?>
>
>
> ps. even if a hook is not documented you can easily find it your self
> by grepping through the source;
>
> grep -nR classRef | grep foreach
>
> you can then grep through that result with what your looking for - in
> your case article & order:
>
> /Morten
>
> toni milovan wrote:
>> Hi,
>>
>> I need to change sotring of articles in in Listview so they are sorted
>> by uid instead of sorting field. Anyone can point me to where in the
>> code I can change this?
>>
>> Thanks,
>>
>> Toni
More information about the TYPO3-project-commerce
mailing list