- August 31, 2016 at 08:59 #3222
This is question from one of our customers. We share it so other may use this solution.
When importing ads from other source all locations and categories are scrambles, not alphabetical order, the only way I see to reorder is manually so it is too hard. How to update order of locations and categories to match order by name.
Currently as of Classibase version 1.7.8 we do not have built in bulk updating order feature.
To order all locations in alphabetic order please execute following query in mysql using phpmyadmin or any mysql client. This will work if you have less than 56k locations / categories.
SET @rank:=0; UPDATE cb_location SET pos=@rank:=@rank+1 WHERE 1=1 ORDER BY slug;
Similar query for categories
SET @rank:=0; UPDATE cb_category SET pos=@rank:=@rank+1 WHERE 1=1 ORDER BY slug;