Template Data Feed
Copyright © 2006, William Weiland
Overview
Create a flat file of your products which can be used to populate external databases, e.g. Froogle, Yahoo, Shopzilla, and others.
Setup
1) In admin, click Add Modules
2) Click the file upload button
3) Browse to find the exprodf.mvc file on your hard drive and upload
4) Click Add to add it to the domain
5) Then in admin click on Stores
6) Click the image to the left of your store name
7) Click on Utilities
8) Check the box next to the Template Data Feed
9) Click Update
10) Click on the link for Template Data Feed and fill in the configuration variables as needed










Usage
1) In admin, click on Stores
2) Click the image to the left of your store name
3) Click the image to the left of Utilities under your store
4) Click the link to the Template Data Feed
5) Select the feed to export
5) Click on the data exporting button
6) If successful, the file path will appear as a link


Comments
The module will attempt to resolve images for your thumbnails. If you use the full path url for images in your store, it will use them. If you use a virtual path below your Merchant2/ directory it will add the root directory for graphics that is defined in your admin domain settings. If you preceed the image urls with ../ it will replace the ../ with the domain root determined from your server root.

It will export all products unless they are in a category which you have excluded AND they are in no other non-excluded category. You can also exclude uncategorized products by excluding a blank category code. So a string of excluded codes could be ABC|XYZ||CDE. This will exclude products in ABC, XYZ, CDE and all products that have no category.

Inactive and deleted products will not be exported. Products with zero quantity can be exported. The presumption being that if they are exported they will be searchable in indexes. Once the customer reaches your store, it is up to your policy to decide what to tell them. This way, products will not be missed by search engines just because they are out of stock the day the export is run. Some search indexes do not want you to include out-of-stock products.

You can exclude products from export by listing them in the admin input for excluding products. Conversely, you can include only specific products by putting the + character at the beginning of the list of product codes.
ABC|
DEF|
XYZ|
would export all products except these three.
+ABC|
DEF|
XYZ|
would export only these three products.

You can limit the products by category by listing the category codes to exclude from product export. As with the product exclude/include above, if you put a + character at the beginning of the list, only products that are in those categories will be exported.

You can specify a price range and/or weight range of products to export. If you leave these entries as 0.00, that feature will be skipped.

Products will be included in the datafeed even if they are in availability groups and are supposed to be restricted viewing unless you check the box to block their export.

You may find the affiliate code generation useful, even if the file is not going to an affiliate. By creating a dummy affiliate account, you can track where sales are coming from by checking the affiliate commissions.

Be sure the file name that you choose for the export is a valid file name (ie letters, numbers, underline and hyphen - no spaces).

Additional fields. Many search indexes have additional optional fields which you may want to include in the export. Those fields are not among the standard fields which are in MIVA Merchant. However, you can use the built in MIVA Merchant Custom Product Fields module to provide the data. You will need to assign the custom field module under the store utilities. Then in each product record you can assign values to those fields. Below is a list of fields which Shopzilla will import. The fields, marked with an asterisk, are the additional fields which you can include data if you have assigned values in the product records for those custom fields.
Category
*Mfr
Title
Description
LINK
Image
SKU
Stock
*Condition
Ship Weight
*Ship Cost
*Bid
*Promo Des.
*Other
Price
Fortunately, you do not need to call your custom fields the same names as Shopzilla uses. You may have other exports which would name them slightly different. So in the export module you can map your custom fields to match the six optional fields that Shopzilla can use. In the export you will have tokens like %custom:condition%. When the export is run, if the product has "condition" defined, it will fill in a value. If not, it will insert a space so the column will still be there. This example is for Shopzilla; other search indexes may have different custom field needs.

After running the export, the link will appear in the admin window. That link uses another window to display your text file results. When you go to that other window, be sure you refresh/reload the screen as the previous export may still be in the cache. Save that file to your PC and then upload per the search provider's instructions.
Tokens
%^% delimiter header, product, category, footer
%lf% line feed header, product, category, footer
%e-&% & (entity encoded) header, product, category, footer
%store:code% store code product, category
%category:code% category code product, category
%category:name% category name product, category
%category:match% search index category match product
%category:names% category breadcrumb product
%product:name% product name product
%a-product:name% product name (attribute encoded) product
%product:code% product code product
%product:price% product price product
%product:cost% product cost product
%product:descrip% product description product
%product:image% product image (thumbnail or full) product
%product:weight% product weight product
%product:quantity% product quantity when using MIVA's built in inventory system product
%product:url% product url product
%e-product:url% product url (entity encoded) product
%product2:????% added product field in the products database (altered structure), replace ???? with the field name product
%custom:????% custom product field (Merchant's built-in custom fields module), replace ???? with the field code product
%custom2:????% custom product field (OpenUI custom fields module and Template Data Feed version 4.59 or newer), replace ???? with the field code product
%list_categories% insert the category input loop into another section header, footer
%a-category:name% category name (attribute encoded) category
%e-category:name% category name (entity encoded) category
%category:header% category header category
%e-category:header% category header (entity encoded) category
%category:footer% category footer category
%e-category:footer% category footer (entity encoded) category
%category:url% category url category
%e-category:url% category url (entity encoded) category
%year:XX% YYYY expires XX days from now, e.g. 30 header, product, category
%month:XX% MM (01-12) expires XX days from now, e.g. 30 header, product, category
%cmonth:XX% Month (Jan-Dec) expires XX days from now, e.g. 30 header, product, category
%day:XX% DD (01-31) expires XX days from now, e.g. 30 header, product, category
%dow:XX% Day of week (Sun-Sat) expires XX days from now, e.g. 30 header, product, category
%time% Current GMT time as HH:MM:SS header, product, category


Frequently Asked Questions
Q: I ran the data feed and the screen turns blank after a period of time.
A: There are a couple issues that could cause this. First, try running it with a lower number of products to export with each screen refresh. If it still fails, change the directory depth to 3. If it still does not work, change it to 0.

Q: I inserted the expires tokens and they did not convert to a date.
A: This token was added in module version 4.55. Update your module from the store you originally got it from.

Q: I inserted the time, dow, cmonth tokens and they did not work.
A: These tokens were added in module version 4.068. Update your module from the store you originally got it from.

Q: Froogle added new fields, do I need to be concerned?
A: While the old format can still be uploaded through the Google Base panel, you can now have a lot of new fields. Here is an example of the new header line.
link%^%title%^%description%^%image_link%^%price%^%id%^%expiration_date%^%brand%^%condition%^%product_type
Change your product field export tokens accordingly. If your products are not all the same for brand, condition, and product type, you may need to use Merchant's built-in custom product fields module to populate those columns. The simpliest idea is to use a constant for the value of brand and condition, eg NA and New. For the product_type column, often the %category:name% token will work ok to describe the product_type. An example of the product section might look like
http://www.yourdomain.com/mm5/merchant.mvc?Screen=PROD&Product_Code=%product:code%&Category_Code=%category:code%&Store_Code=%store:code% %^%%product:name%%^%%product:descrip%%^%%product:image%%^%%product:price%%^%%product:code%%^%%year:30%-%month:30%-%day:30% %^%N/A%^%New%^%%category:name%
Be sure to change "yourdomain.com" if you choose to use this example. This will suffice for many products. However, if your store contains certain item types, you may need even more custom fields. See the info page at
http://base.google.com/base/products.html to see the attributes required for specific item types.

Q: Can I run the Google Base export late at night without having to log into admin?
A: In many cases, yes. See the article in the MivaMerchant forums at http://extranet.mivamerchant.com/forums/showthread.php?t=14739&highlight=cron.

Q: My custom field data is not showing up in the export.
A: The TDF uses the MIVA supplied, built-in custom fields module. It does not use 3rd party custom fields modules. Make sure you are using the built-in module. This module was provided with MIVA Merchant, beginning with version 4.23. If you have version 4.14-4.22, you can still install the module in that older version. You will need to get the customfld.mvc file from: 1) your host if you have Merchant as part of hosting, or 2) MIVA if you bought your license directly from them.

Still have a question?