Table of Contents

Importing certificates

With this feature it is possible to import pre-created certificates into the system.

Using import

Import page can be reached via Customers→Gift Certificate Import

Menu

The page itself is very simple to use. You can edit your settings and save them, or you can edit and click 'Save and Import' button to perform the import. Simply clicking that button without any changes will result in an import in case that the file you have inputted exists. Files used for import should be in CSV format (Comma Separated Values). This format represents plain text files where first row gives column names and every next row gives column values. Fields are separated by separator character and optionally surrounded with enclosure character. By default separator is comma (,) and enclosing character is double quote (“). You can change this on import page.

Import Page

Settings that you can change are:

  1. CSV field delimiter - this is field separator character
  2. CSV field enclosure - this is enclosure character, you may omit it if the field text does not contain the separator character
  3. CSV file name - file name of the file to be used for import. You have the option to upload many import files, either to create new certificates or update existing ones. With this option you can choose which of the uploaded files to import.
  4. When importing allow only: - this field allows to choose whether to only create new certificates (you can simply add your new data to existing file), only update existing certificates or do both.

Bellow settings form is an upload widget, the same as the one used to upload product images. It allows you to select multiple files to upload, which can be time saver. The widget is set to allow filtering by file type (.txt and .csv files) which will help if you have to look for import files in a big folder with many files in it. It also allows only txt and csv file types to be actually saved to server. Files are saved in var/ugiftcert/import folder of the website. As for any other Magento installation you should make sure that var/ folder is writable by web-server.

Uploaded file

When you click Save and Import button, the file name you entered is looked up and if it exists, import is made. This means that you don't have to use on page widget for uploads, you can do this via FTP or any other means you want. After clicking the button you don't need to do anything else but wait for the import to finish. How long would that be depends on the number of certificates that you import. Our test imports showed good creation and update rate.

Import Result

If you have very great numbers to import, it might be good idea to separate import files to smaller size files which will be easier on your server memory consumption.

Allowed fields


NOTE: about date formats

Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.

Example:

sample.csv
"cert_number","pin","balance","expire_at","currency_code","store_id","status","sender_name","recipient_name","recipient_email","recipient_address","recipient_message","comments"
"A0002","1001","26","8.09.2012","USD","1","Active","Myself","Test User","test@email.com","123 Some Street","Cheers","Some comment"
"A0003","1002","27","8.10.2012","USD","","Active","","","","","",""
"A0004","1003","28","8.11.2012","USD","1","P","","","","","",""
"A0005","1004","29","8.12.2012","USD","1","i","","","","","",""