Related Products Import and Export
Copyright © 2001, William Weiland
Overview
Import Related Product linkage into your Merchant store directly from a flat file.
Initial Setup and Usage
1) In admin, click Add Modules link (fig 2)
2) Click the file upload button
3) Browse to find the relprdim.mvc file on your hard drive and upload (fig 3)
4) Click Add to add it to the domain
5) In admin, click Add Modules link (fig 2)
6) Click the file upload button
7) Browse to find the relprdex.mvc file on your hard drive and upload (fig 3)
8) Click Add to add it to the domain
9) Import and Export modules automatically reside in each store within a domain so there is no need to update them to the store

Export: Click on the plus to the left of the word Utilities under the store. Then click on the plus for Export Data. Then click on the link for Related Product Export (fig 5). The prompt will ask for the flat file name. Only put the file name, no path. For example, relprdim.dat

Import: Click on the plus to the left of the word Utilities under the store. Then click on the plus for Import Data. Then click on the link for Related Product Import (fig 4). The prompt will ask for the flat file name. Only put the file name, no path.

Headstart
If your store already has related products associated with your products, use the export module, relprdex.mvc to create a flat file in the proper format. This can also serve as a backup (archive) copy of your related products linkage. The default name of the export file is relprdim.dat. Keep a copy off-line along with your other backup copies of data.


Understanding the Flat File Format
The data elements which comprise the related products links are pulled from the flat file in a specific order. Since there is no artificial intelligence involved in this flat file import, it is imperative that the data be placed in a flat file in the same order that the program expects it to be. Any variance from that is likely to result in corrupt data in your database.

Creating the Flat File
If you are starting from scratch and have no related products in your store yet, you can create the flat file in your text editor. Create the flat file and upload it through the related products import module's admin screen. The default name should be relprdim.dat.

Format the Flat File
Only two elements are on each line for each product linkage. They are the primary product code and the product code that is to be linked to the primary.

Basic Example:
ABC123|XYZ123
ABC123|XYZ456
ABC456|CPC123

Alternatively, you can format it like:
ABC123|XYZ123^XYZ456
ABC456|CPC123
This will relate each of the products to the right of the | with the product to the left of the |

With module version 5.006 or newer you can also do recursive relations. The format is:
ABC123|XYZ123#XYZ456
ABM321|CPC123#DMX234#XYZ987
This will relate all products in each line with each other.

When importing, be sure that the last line of the flat file is a blank line.

When you import, each product code is checked to see if each product exists and if the related product linkage already exist with that product code. Thus only valid codes are linked and duplication of links is avoided.

Beginning with version 5.003 of the import module, you can delete related products while importing. If you want to delete related products associated with specific product codes, you simply put the product code and the delimiter followed by the minus character. For example:
ABC123|-
ABC456|-

If you are having time-out problems with importing, you may need break up your flat file into smaller flat files.

I highly recommend adding only a couple related product links in the flat file until you are sure you thoroughly understand the flat file format. Since a related product export module is supplied with this system, it would be best if you export your existing related product links to a flat file before you add any. Then you can study that file for proper format.

Fig 1: Main admin screen

Fig 2: Add a new module

Fig 3: Upload the module to the server

Fig 4: Category Import

Fig 5: Category Export