Use this method when your data contains over 100 products and the inventory varies by location.
If you have fewer products, then consider using our category system to create a product finder.
In product finders, the database consists of locations and products, where a given location may have a unique list of products. This is a many-to-many relationship that requires creating an additional, related table in MetaLocator. In this tutorial, we will take you through the basics of setting this up.
Importing this type of content involves 3 files. The unique list of stores, the unique list of products and a store-to-product file that contains a per-store inventory of product IDs. Examples of these files follow:
Before we import the above files, we must prepare the destination tables into which data will be imported. The first step is to add a unique identifier called an "External Key" to the master locations table. This key will uniquely identify the location, commonly a "store number" or "store id". In the example files above we use "StoreNo", so we will create this field as a new External Key field. To create this field, click Fields, then "New" in the upper right. Complete the form as shown here:
Click Save to complete the Field creation process.
Next, import store locations using the store_list.csv file using the typical import process. Click Data > Import, choose "Locations", then "Spreadsheet" and follow the prompts to import the data. This file contains a short list of 6 locations.
We will also import products, but before we do that, we need to create another table with its own External Key field. To create a new table, go to Data > Tables. If the Tables menu option is not available, please contact the helpdesk to request it.
Click New in the upper right, and complete the form according to this screenshot:
The next step is to add an External Key field to this new table. This External Key will uniquely identify the product. By default, new tables already contain a SKU field, so if your product is uniquely identified by another field, follow the same process to create that field as above, except notice that a table selection is now available when creating the new field as show below:
Now we can import Products. We'll use the product_list file which contains a unique list of products. Click on Import, and notice the new prompt to ask which table you are importing. Choose Data Table: Products, and complete the import process.
Once successfully imported, your products and locations can be viewed on the All Records screen. Notice the "Active Table" control now allows you to choose which data you are viewing:
Now that we have our products and our locations imported, we need to establish which products are available at which locations. This can be done in two ways. First, you can manually edit each record and designate which products should be at which location. To do this, you need to add another a field to your "Locations" table, that will allow you to connect the products to each location. To do this, go to Fields, then click "New" in the upper right. Let's call the field "Products at this Location", and choose Related Table Link as the field type and Products as the Related Table as shown here.
Now, when you edit a location, you will be able to browse Products, and associate them manually with that location.
Under Custom Fields, you will see a control similar to this one:
Attach Products to this location by clicking "Add Products"
As an alternative to manually associating products with locations, you can import a linking table. The linking table would contain only two columns, one to unique identify the product, and the other to identify the location associated with that product. Each column must be an External Key field, one from each table. The sample files in this tutorial each already have an External Key column.
Now we can import a linking table spreadsheet that contains only two columns, SKU and StoreNo.
Important: The ordering of these file import steps is important. For example, do not import the linking file before importing the products and locations.
We can import that file, and associate products with locations in bulk.
Once your products, locations and linking file are correctly imported, this completes the import process. You can now build an interface that represents your product finder.
To create a "Where-to-buy" link for a product page, first create an Interface by clicking Interfaces, then "New". Then deploy that Interface to your Web site.
To create a "Where-to-buy" link for a product page, use this syntax:
Where To Buy
Notice the External Key value is provided in the link. This instructs MetaLocator to search for all locations with this product SKU in their inventory. This syntax is describe in further detail on this page.
To add a drop-down list of Products to the Location search form, add this option to your Form Settings:
The mltable attribute instructs the system to pull the drop-down list contents from the products table. Since SKU is an External Key, the drop-down list will contain a list of product names, but the actual drop-down list value will be the key value.