|
|
These programs are protected by copyright and may not be resold or distributed. Please see the copyright notice for more information on your end user license for this program. What's In This Document: This is a beginners reference for understanding the syntax of all the settings in the mof.conf and mofpay.conf configuration files. About Perl Configuration Files
MOF v2.4 uses two configuration files. The configuration files supply MOF with settings and information that govern its behavior. As they come in the package, both configuration files have many of MOF's settings turned off, to minimize installation problems. The idea is to get the system up and running in simple mode, and then begin to turn on features one at a time so any problems can be traced back to a particular function or setting.
The most important rule: Use an ASCII editor only, do not use a rich text, or fancy word processor to edit the files unless it lets you work in ASCII mode only. It's nice to use an ASCII editor that will store the file in Unix format, if you are working from a Windows machine, but this is not necessary. Most of the files are too large for the regular Windows Notepad. Therefore, you may have to find a good ASCII text editor. Don't use the Windows Word Pad, Word, or an HTML editor to edit the configuration files I use Edit Pad Pro for windows. Very powerful, loads multiple files fast, does global search-replace, and has syntax color schemes, one for Perl. Find it at: JGsoft.com. They also have a free lite version that may do the job for you. How to get started
Some other basics:
MOF configurations use four different types of settings. You can tell what type of setting it is by the very first symbol preceding the setting. Here's a brief table on the four types of settings. After the table we'll cover some of the more detail rules for working with these types of variables and arrays. If you are having trouble with a setting and creating a syntax error, the detail rules for each type of setting will help you sort through where the problem might be.
$ precedes a scalar variable (Type: 1, 2)
Stick to the syntax rules that you find already in place for a setting. If it is surrounded by single quotes, double quotes, or no quotes, then use that same syntax. Remember that the line always ends with the semicolon.
A simple On/Off switch is On (positive number) or Off (0) (Null)
These types of settings can be both: On/Off switch and contain usable information:
Here's an On/Off setting that contains usable text
information
The above setting not only turns on the feature, but also tells MOF how to print an identifier for taxable or non taxable items.
If you wanted to turn Off that feature it would look like this:
Note: (null) is a set of double quotes "" (or single quotes) '' with nothing (null) between them. Zero is not the same as (null).
Stick to the syntax rules that you find already in place for a setting. If it is surrounded by single quotes, double quotes, or no quotes, then use that same syntax. Remember that the line always ends with the semicolon.
These types of settings can identify a filename
These types of settings can identify html attributes: Note: the example above uses single quotes to surround a text string. When single quotes are used then everything between them is treated as exact text. So, although the embedded double quotes are Perl sensitive characters, it works because single quotes tell Perl to treat everything as text.
Here's another example of an html setting, but surrounded in double quotes:
Note: if any of these type settings surrounded by double quotes use special characters within the double quotes, then the Perl escape character \ must precede any occurrence of a special character. The above example must precede the inside use of a double quote with the backward slash. This tells Perl to treat the very next character as text. Otherwise, Perl would be looking at a broken string, not knowing what to do with 4 sets of double quotes on a single line. This is a common oversight with beginners.
An array setting can have one element:
Or it can have multiple elements of both text and numbers Notice the rules of surrounding the text in single quotes, numbers without quotes, separated by commas, enclosed in parentheses. You don't have to keep everything on one line, you can break it all up on individual lines. Perl allows for liberal white space if it will help you make things more readable. All rules described above appear in the following example, yet each element is placed on a different line, making it more readable. Remember to end the list with the ending parenthesis and semicolon );
@field_validation = ('HatColor', Here's a list of US states and Canadian Provinces. This example sets all these states and provinces as domestic for shipping computations.
@domestic_state =
Important: When making these types of arrays, you must always keep order with your name=value pairs. To explain: Perl will read the associative array beginning with the first item in your list, the next item in the list is paired with the first .. the third item is paired with the fourth .. the fifth is paired with the sixth .. and so on. If you have your pairings mixed up then you will get unexpected results.
Here's an example from the tax settings:
You can see the pairings: Here's an example using the shipping configurations. This setting instructs MOF what fields to list for shipping, and if that field is required or not. It also acts as the overall On/Off switch for using the whole shipping information and computations. In a few short lines, this settings is able to supply MOF with some very complex instructions for handling shipping information input.
%shipping_destination_fields = ( Notice all the rules are followed: surrounding the text in single quotes, numbers without quotes, separated by commas, enclosed in parentheses, ending in semicolon. We even placed each name=value pair on a separate line for readability. Here's a last example taken from the tax settings. This setting identifies different tax rates for specific postal code areas. What's a little different about this one is that the zip code looks like a number, but is surrounded in single quotes--meaning it is actually treated like text. This is very important, because MOF uses this list to match zip code areas that may not always be numbers for different countries. MOF also uses this pattern to match the starting string, which could not be done with numbers
%use_zipcode_tax = (
These programs are copyright @ MerchantOrderForm.com, MerchantPal.com 2001 |
|||||||||||||||||||||||||||||||||||||||||||||