[TYPO3] How to reverse tt_product list order

Liu Jiansong jiansong.liu at gmail.com
Fri Jul 7 11:15:36 CEST 2006


Nguyen Duc Hung wrote:
> Liu Jiansong wrote:
>   
>> Hi all,
>> The default tt_product list view is orderBy=pid
>>    Product [pid=1]
>>    Product [pid=2]
>>    Product [pid=3]
>>    ...
>>    Product [pid=n]
>>
>> I want it display the list reversed, the newest product show first,
>>    Product [pid=n]
>>    ...
>>    Product [pid=3]
>>    Product [pid=2]
>>    Product [pid=1]
>>
>> Is there a way to reverse the order ?
>> Thanks a lot.
>>
>>     
> You find the file class_tt_product which contain tt_porduct/pi . Change 
> the query from 'ASC' to DESC .
>
>   
Thanks for your reply.
I searched the tt_product fold over, only 
"class.tx_ttproducts_single_view.php" have some ASC/DESC statements at 
line 190 and 196 as below,

            if ($this->conf['orderByItemNumberSg']) {
                $itemnumberField = $viewTable->fields['itemnumber'];
                $queryPrevPrefix = $itemnumberField.' < 
'.intval($row[$itemnumberField]);
                $queryNextPrefix = $itemnumberField.' > 
'.intval($row[$itemnumberField]);
                $prevOrderby= $itemnumberField.' DESC';
                $nextOrderby= $itemnumberField.' ASC';

            } else {
                $queryPrevPrefix = 'uid < '.intval($this->uid);
                $queryNextPrefix = 'uid > '.intval($this->uid);
                $prevOrderby = 'uid DESC';
                $nextOrderby = 'uid ASC';
            }

it seems not a right way (I want change the list view, not single view ).
Any ideas ?

-- 
Thanks & Best regards,
Liu Jiansong




More information about the TYPO3-english mailing list