Attribute Import and Export |
Copyright © 2000, William Weiland |
Overview Import attributes into your Merchant store directly from a flat file. |
|
Initial Setup and Usage Use the Merchant admin upload feature to upload the modules attrimpt.mv and attrexp.mv. As each are uploaded, click the Add button to add them to the mall/domain. 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 image to the left of the word Utilities under the store. Then click on the image for Export Data. Then click on the link for Export Attributes and Options to Flat File. The prompt will ask for the flat file name. Only put the file name, no path. Import: Click on the image to the left of the word Utilities under the store. Then click on the image for Import Data. Then click on the link for Attribute and Option Import from Flat File. The prompt will ask for the flat file name. Only put the file name, no path. Headstart |
|
Understanding the Flat File Format The data elements which comprise the attributes and options 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 When importing, be sure that the last line of the flat file is a blank
line. Format the Flat File
All of the other fields will contain actual data, not the words you see
in the following four lines. These 4 lines represent the exact format.
If a data element is blank, you still need to account for it, eg. || In
all additions, there must be 9 fields. With deletions, only 2 fields are
needed.
As examples, consider the following 6 lines from a flat file:
1st - Adds a required, radio attribute with code "version" to product 1AA00004
The 4th field in the attribute lines is "type". There are four types of
attributes used by Miva Merchant; radio, select, checkbox, and text. The
radio and select both require option lines. The checkbox and text do not
use option lines. Be sure the type is entered as lower case.
If for some reason you want to delete attributes or options, you can
include the D action for a product.
This line would delete ALL of the attributes and options associated with
product code 1AA00006. Only two fields are used in deletions; D and the
product code, separated with a | delimiter. Let's say you want to remove
an option from your existing attribute for a product.
Example: I want to remove the 1X and modify the 2X and 3X. I would put
the following in the flat file.
If all you want to do is change data in the line, you do not need to
delete the group first. For example, if you want to change:
Note: Simple modifications without deletion first can be made as long as
you are NOT changing the attribute or option CODE. Changing the code
requires removal of the old code or you will end up with two sets of
attributes and options doing the same thing for a product.
When you import, each product code is checked to see if the attribute codes
and option codes already exist with that product code. If they do, it
updates the store databases from the flat file. If they do not, it adds
them to the databases.
If you are importing many attributes, you may need to break your attrib.dat
flat file up into smaller files to prevent the Miva Engine from timing out.
If you are having time-out problems with exporting, you may need to run
that using MivaMia on your hard drive (where you have control of time-out
settings).
I highly recommend adding only a few attributes in the flat file until
you are sure you thoroughly understand the flat file format. Since an
attribute and option export module is supplied with this system, it would
be best if you export your existing attributes and options to a flat file
before you add any. Then you can study that file and add to it.
|