Following the article about importing locations to DJ-Classifieds here's tutorial on how to import categories and subcateogories same way!
Creating one easy .csv will allow you to import all your categories and subcategories to DJ-Classifieds.
To do it you’ll need to be able to access your database via phpMyAdmin.
Firstly prepare the .csv file with all the categories and subcategories you want to add (You’ll find the exemplary .csv file at the end of the article).
The structure of the .csv file you'll need is quite straight forward:
- "id" - id
- "name" - category name
- "parent_id" - parent category id
- "price" - price for the category
- "description" - description of the category
- "icon_url" - not used - buy need to stay in .csv
- "ordering" - category ordering
- "published" - published or not
- "autopublish" - set if ad should be automaticaly published (0 - global setting, 1- yes, 2 - no)
- "metakey" - meta keywords
- "metadesc" - meta description
- "access" - access to submission of adverts restricted for specific joomla groups
- "alias" - link alias
- "points" - price in points
- "ads_disabled" - setting if adverts can be submitted or not to this category.
- "theme" - theme for category
- "access_view" - joomla group restriction for viewing this category
- "access_item_view" - joomla group restriction for viewing adverts from this category
- "restriction_18" - adults restriction
Once you’re ready with your .csv file you can move to importing it to the database.
First open your cpanel account, open phpMyAdmin
When in phpMyAdmin:
- open your database
- and find dj-classifieds categories table and open it (the name of the table will be [yourdbprefix]_djcf_categories)
Next (when in categories table) click „Import” in the top bar
Now you’re ready to import the .csv file
- browse for the .csv file here
- make sure to skip the firest row (insert „1”)
- insert „;” (semicolon) in Columns seperated with:
- click „Go”
Imported categories/subcategories are now visible in your DJ-Classifieds installation :)
You can download exemplary .csv file with regions here: DJ-Classifieds categories / subcategories exemplary .csv (3.44 kB 2015-05-18 06:42:16)
Above example is for installations that were updated from previous versions of DJ-Classifieds, if you're using fresh installation of DJ-Classifieds you may need to use this file:
There's slight difference in columns order. Below you can find video tutorial on how to reorganize columns in phpMyAdmin if needed.