Logo

Import from CSV


To help you populate your database much more easily, you can use the Import CSV feature. With it you can import data from the admin backend as a bulk upload, which will append the data to your existing database.

To access this page go to Components/Swap Factory/Settings/Import/Export and click on Import CSV. There you will find 2 fields which will allow you to upload a ".csv" file and an archive with images corresponding with the uploaded CSV respectively.



The ".csv" file needs to be written in a specific order and format to be eligible for upload and to have no errors, since each value will be inserted in the database.
For the CSV file you will need the header on the first row containing all the names of the fields and on the next rows, details and parameters regarding the ads that will be added in those respective fields.
It is also very important that the information is separated by tab spacing.

The names of the fields found in database are defined by the "ad.php" file found on "components\com_swapfactory\helpers".
You need to also define the column headers in the file.
To know exactly how the structure of the file must be, here is a list of the fields and how they need to be ordered on the .csv file:

Name Description Example
Title Text which will be used as the name of the ad 2005 Polaris 900 RMK Red
Short_description Short descriptive text regarding the ad which will be displayed on listings Well kept model
Description Larger descriptive text regarding the ad which can also contain HTML and that will be displayed on the details page This is a very nice well kept 2005 Polaris 900 RMK with 3121 miles on it, it has an SLP pipe, can, and hot air elimation kit put on it, factory pipe and can go with it
Userid This is the ID displayed next to the username in the userlist 976
Ad_type Parameter regarding the type of the ad: 1=Public Ad ; 2=Private Ad 1
Askprice Price asked for the item represented in the ad 1880
Currency Currency used for the item price, use one that is available on the Currency Manager list (USD, EUR, AUD, etc.) USD
Start_date Date of when the ad starts which is required to be filled in (Y-m-d H:i:s) 2013-05-14 00:00:00
End_date Date of when the ad ends which is required to be filled in (Y-m-d H:i:s) 2014-02-13 15:00:00
Picture Name of the image representing the respective item, be sure that the extension of the file is supported on ads polaris.jpg
Cat Name of one of the available categories, you can see them all on the Manage Categories page Power Sports
Tags Names of relevant tags related to the ad, add them separated by comas bike,polaris
Images Names of additional images, add them separated by comas if more than one front.jpg,back.jpg


Be sure that the images names added on the .csv file match with the ones from the archive.

To help you even further to understand the structure of the CSV file, you can download swap_import_sample.csv


(!) Documentation based on Swap Factory version 2.0.0