1. Industry & Trade

How To Merge Data Into a Product Catalog

Part One: Preparing the Data

From , former About.com Guide

Product Catalog

Product Catalog

© Claire Condra

If you have ever composed a "Dear First Name" mail merge letter, you will have no trouble learning how to produce a catalog from your store database, because the process is basically the same. Here's how! First you start with a list of data – which in this case, is your product information, and combine it with a document template that has been prepared with placeholders for the information you want to include.

In this example, you will learn how to merge the Item Number, Name, Description, Image and Price from your database into a catalog template. If you were to export this data and open it in a spreadsheet such as Microsoft Excel, you would have one product per row, with columns for each type of information. To merge the data into a catalog template, you will use a variable name as a placeholder to represent each column of information that is to be included in the catalog. Then that information is repeated for each product in the database.

Exporting the Data

Most database-driven websites provide an easy way to export data. The Export utility is probably located in a reasonably logical place somewhere in the backend Admin interface of your website. It may support a variety of formats, including comma-separated, tab-delimited values (CSV), which is a widely-support format that we'll in this example.

So go ahead and give it a try. And don't worry — you're not going to break anything!

If your Export utility allows you to select the fields to be exported, by all means choose only the fields you will need for the catalog — but don’t worry if it doesn’t give you that option. All you really need to do is export the data, give it a unique filename, such as "catalog-test.csv," and save it — ideally to the hard drive of your local computer. Some platforms such as Magento, save the exported data file to the server, rather than to your desktop, which is . a minor inconvenience that requires you to FTP the file from the server down to your computer.

Column Headers

Once you have the exported data, open the file in Excel (or any other spreadsheet) to see what you have. Take note of the column headers, because that is how you will reference the merged data. If the exported file doesn't include column headers, you can add them, if you want. You're going to have to reference them one way or the other, and a logical name is a lot easier than a column number.

This is also a good opportunity to remove any unnecessary columns of exported data that you don't want in the catalog. Although this is not required, it does make the file smaller and easier to manage. To delete a column, simply right-click the column header and select Delete from the pop-up Context menu.

Image Paths

Notice that the data in the Image column contains a path and filename, rather than the actual image. Your catalog layout program must be able to follow this path to find the image. Make sure that the path references a corresponding file on your local computer. The easiest way to do this is to keep a current copy of your website on your hard drive. That way, you'll always have a duplicate of each product image, in the same relative directory structure as on the server where your website resides.

Another solution is to strip off the path and include only the filename in the Image column. Then, make sure that all the images can be found in a single folder on your computer. This is a good solution for Magento users, who may have inadvertently created duplicate copies of the same product image, which are now buried multiple levels deep in a seemingly infinite number of subdirectories. (Magento users know what I mean!)

Sorting Order

While you are in there, take a look at how the data is sorted. Right now, it's probably sorted by record number, which is the sequence that the data was originally entered. As a result, your newest products may be at the bottom of the list. This is a good time to think about how you want the catalog entries to be organized. Should they be organized alphabetically by product name, or grouped into broader categories, and then alphabetized by product name within each category? How are people most likely to look for product in your catalog? The sorting order of the data controls how it is merged into the document and determines the organization of the Table of Contents. You don’t have to worry about the sorting order just yet, because you'll take care of that later. At this point, it's just good to understand what's going on "under the hood."

©2012 About.com. All rights reserved.

A part of The New York Times Company.