Import Routines

Overview
Batch import routines are a time saving mechanism that enables you to add multiple products/attributes in a single routine. This is useful if you are migrating from another cart or have a large product inventory. Maian Cart uses standard CSV structure for importing, along with field mapping for easier uploads.
CSV with Header
Files must be standard CSV format. Text files are also fine providing the structure is the same. CSV file MUST have a header row at the top of the file for the field mapping routine. This is a reference for the column names. For example, your product name column might be 'name', 'product' or 'product name' etc. Names are not that important, so long as you know what each column is.

It doesn`t matter if columns in your CSV are not going to be used by Maian Cart. Nor does it matter what order the columns are in. If you don`t specify a header row, you`ll see previews of the first row, but may not be able to see what it relates to.
Field Mapping
After you have uploaded your file you will be presented with field mapping options. This will be a list of your header column names along with the database fields from the cart system. You need to select the correct field in the database with the corresponding column in your CSV. Data will be taken from that row and inserted into the correct field. If there are any fields in your CSV that are not going to be used, simply leave the corresponding field selection blank.
Field Data Types
It is important that the field you select matches the data type used by Maian Cart. For example, if you specify a string field for a DATE column this will revert to the default setting for that field. In the case of DATE fields its 0000-00-00. If the data type doesn`t match, the import should still run but you may have to make product edits after to correct some data.

Data types are as follows:

[Boolean] = True or false, 0 or 1, Yes or No.
[Integer] = Numeric value only. Default 0.
[Decimal] = Decimal value or integer. eg: 34.76 or 34
[String] = For text field values.
[Date] = Valid US date. Due to restrictions in PHP/MySQL, date must be a US formatted date. If it cannot be converted to a timestamp it will revert to 0000-00-00. Examples: YYYY/MM/DD or YYYY-MM-DD or MM/DD/YYYY or MM-DD-YYYY
[Monetary Value] = 0.00 default.

If your columns don`t match the data type entry, the default will be imposed and you`ll have to re-edit after. Try some small test imports first.
Product Import Columns
Your import file can have the column data in any order as the field mapping routine will map the relevant position to the database. The product import file will map the following database fields:

Product Name (String)
Product Alternative Browser Title (String)
Product Short Description (String)
Product Full Description (String)
Product Meta Keywords (String)
Product Meta Description (String)
Product Tags (String)
Product Rewrite Slug (String)
Downloadable Product (Boolean)
Local/HTTP/FTP Path to File (String)
Product Download Limit (Integer)
Product Facebook Video Code (String - Alphanumeric)
Product Vimeo Video Code (String - Alphanumeric)
Product Stock (Integer)
Product Min Purchase Qty (Integer)
Product Max Purchase Qty (Integer)
Product Low Stock Notify (Integer)
Product Hit Counter (Integer)
Product Code (String)
Product Weight (Decimal)
Product Retail Price (Monetary Value)
Product Cost Price (Monetary Value)
Product Offer Price (Monetary Value)
Product Offer Expiry Date (Date)
Product Expiry Date (Date)
Product Drop Shipper (Integer - Drop shipper ID from admin drop shippers page)

Not all columns are required in your import file. Ideally a product name and a price should be enough to import the product. Give it a few test runs first. Descriptions of data that should be in the csv relates to the same as the Add Product info. Use the link for more information after you have uploaded a file.
Attribute Import Columns
Your import file can have the column data in any order as the field mapping routine will map the relevant position to the database. The attribute import file will map the following database fields:

Attribute Name (String)
Attribute Weight (Decimal)
Attribute Stock (Integer)
Attribute Price (Monetary Value)

Not all columns are required in your import file. Give it a few test runs first.

Once you have imported attributes you can go to the relevant product page and batch copy attributes to other products in your store. Use the link for more information after you have uploaded a file.
Product Image Import Columns
Your import file can also include image paths to your product images. These must be relative paths to the Maian Cart installation. Remote images are not supported. To include images, you must do the following:
1 Create a new folder in your Maian Cart installation and place all your product images inside this folder (JPG, GIF, PNG ONLY). If you prefer, they can be in sub folders. Note that after successful adding of products you can remove this folder.

2 Add a column in your CSV and specify the paths delimited by a pipe (|). You must specify ONLY the folder(s) and the images. So, for example, if you add the following structure for product X

myproductimages/image1.png
myproductimages/image2.png
myproductimages/image3.png

In your CSV column for product X you would specify the following:

"myproductimages/image1.png|myproductimages/image2.png|myproductimages/image3.png"

The system will check the files exist in the location you specify and if they are valid images (JPG, GIF, PNG ONLY). If they don't they will be ignored. Ideally you should make sure that image file names contain ONLY alphanumeric,hyphen or underscore characters with NO spaces. If the images are ignored, you'll need to add them manually via the product images section.

The same thumbnail restrictions (resize, rename etc) apply for images. They will be created the same as if you had uploaded them manually. When adding images via the import routine, it will create a new product folder with the ID number of the product prefixed with 'p'. Example: p1. If this folder already exists, images will be placed into the existing folder (for advanced users, this can be changed in the "admin/control/classes/class.products.php" file).

3 When uploading your CSV, the image column should be set as "Product Images" from the drop down selection.

Once you have imported your products you can remove or archive the images folder you created.
Select Categories, Brands and Other Options
Same options as on the Add Product page. Use the help tips for further information.