Breadcrumbs

Home / Support Center / FAQ / Tutorials / DJ-Classifieds FAQ / How to import locations/regions to DJ-Classifieds

Top Menu

Content

How to import locations/regions to DJ-Classifieds
How to import locations/regions to DJ-Classifieds 5.0 out of 5 based on 8 votes.

0061

Ever wondered how to import regions/locations to DJ-Classifieds?

When you have many of them it can be hard to add them one by one this is why we created this tutorial on how to import all the locations at once directly to your database.

To do it you’ll need to be able to access your database via phpMyAdmin.

First you need to prepare the .csv file with all the regions you want to add (You’ll find the exemplary .csv file at the end of the article).

 

Let's go

The structure of the .csv file you'll need is quite straight forward:

"id";"name";"parent_id";"country";"city";"published";"latitude";"longitude" 
"1";"Africa";"0";"0";"0";"1";;

01-db-structure


in Microsoft Excel it will look like this:
02-db-structure

 

In the first row you see the labels of the columns:

  • id - ID of the region
  • name - name of the region
  • parent_id - if the region is child item of other region you put the parent region ID there
  • country - if the region is a country you need to use 1, otherwise use 0
  • city - if the region is a city you need to use 1, otherwise use 0
  • published - use 0 or 1 to determine if the region will be published after import
  • latitude - latitude coordinates (you don’t need to use them but it’s needed to have that column in .csv)
  • longitude - longitude coordinates (you don’t need to use them but it’s needed to have that column in .csv)

There’s no „other” column, right? That’s because it’s not needed. If you wont select the region as a city or country it’ll appear as „Other” in your DJ-Classifieds.

 

In following rows you insert the values basing on the scheme.

 

Once you’re ready with your .csv file you can move to importing it to the database.

First open your cpanel account, open phpMyAdmin

03-phpmyadmin

When in phpMyAdmin open your database and find regions table and open it (the name of the table will be [yourdbprefix]_djcf_regions)

04-phpmyadmin

Next (when in regions table) click „Import” in the top bar
05-phpmyadmin

 

Now you’re ready to import the .csv file

06-phpmyadmin

  1. browse for the .csv file here
  2. make sure to skip the firest row (insert „1”)
  3. insert „;” (semicolon) in Columns seperated with:
  4. click „Go”

 

Woot woot! Imported regions/locations are now visible in your DJ-Classifieds installation :)

07-dj-classifieds-backend

You can download exemplary .csv file with regions here: DJ-Classifieds regions / locations exemplary .csv (9.34 kB)


Found this article interesting? Subscribe for more.
Or share this article with your friends.
Wednesday, 06 May 2015 11:35
 
User Rating:  (8)
PoorBest
 

Footer Menu