Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!

Importing Gift Certificate Balances

The problem

You have or had separate system that creates or created Gift Certificates, and you are wondering how they can be redeemed on your ProductCart-powered store. That is: you need the balances that exist on those gift certificates to be imported into the system, and for customers to be able to use them during checkout.

The solution

Although ProductCart does not have an Import Wizard for existing Gift Certificate, the process is quite simple. Here are the steps:

Create a "Gift Certificate" product

Create a Gift Certificate “product” in ProductCart. This will be used to give a description to the gift certificate codes that you will be importing. Otherwise ProductCart would not know how to refer to the Gift Certificate used on an order. For example, it could be “MyStore Gift Certificate”. When you add the product to the database, note the product ID. You will need it below.

Prepare the data to be imported

Next, you need to prepare the purchased gift certificate data to be imported. To do so, create a spreadsheet with the following columns, with these column names, in the following order:

  • pcGO_IDProduct = the product ID mentioned above
  • pcGO_IDOrder = 0 (i.e. the Gift Certificate was not purchased on your store)
  • pcGO_GcCode = unique gift certificate code (e.g. if you have 1,000 gift certificates, you'll have 1,000 records in your spreadsheet, plus the header)
  • pcGO_ExpDate = expiration date: if none, enter 1/1/1900
  • pcGO_Amount = the amount available on that Gift Certificate (e.g. enter 100 for $100)
  • pcGO_Status = 1 (active Gift Certificate, 0 if inactive)

Save the file as a CSV file (comma separated).

Import the data

Use the import tools that are built into MS SQL and MS Access to import the spreadsheet into your store database. The table that you will be importing the data into is called “pcGCOrdered”. You will be prompted to map the columns in your spreadsheet to the table fields during the import.

GoDaddy Instructions

If you are using GoDaddy as the Web hosting company, here are detailed import instructions as of November, 2011. Similar instructions might apply to other Web hosting Control Panels, which often include similar database management tools.

  1. Log into your GoDaddy account
  2. Launch the hosting control panel
  3. From the “Database Menu”, click “SQL Server”
  4. Locate the database that is being used with your ProductCart-powered store and click on the link “Manage via Web Admin”
  5. Enter the user name and password. This is the same information used in the database connection string used by your store to connect to the database, and can be found in the file “includes/storeconstants.asp”.
  6. Under “Tools”, click on “CSV File Import”
  7. Under “Table”, select the “pcGCOrdered” table
  8. Under “Columns”, leave all 6 columns selected (the correspond to the ones mentioned above under “Prepare the data…”
  9. Under “Column Delimiter”, leave it “as is” (the comma is the default delimiter)
  10. Under “Options”:
    1. Enable identity insert: leave unchecked
    2. Column names on first line: check
    3. Remove trailing ',' from data rows: leave unchecked
  11. Click on “Import” to import the data. A “success” message will indicate that N records were added to the database.

Verifying a successful import

Check the Control Panel

In the ProductCart Control Panel, select “Products > Manage Gift Certificates > View Generated Gift Certificates”. From the drop-down menu on the search page, select the product whose product ID you used in the CSV file, then run the search. You should see the gift certificates that you just imported in the search results (the gift certificates most recently imported are listed first).

Check the storefront

Try going through the checkout process and redeeming one of the Gift Certificates that you imported, using one of the unique gift certificate codes that were imported. Gift Certificates are redeemed during checkout, before submitting payment for an order.