Configurations Front End

Merchant OrderForm Web Based Shopping Cart System @ 2001
Documentation for Front End Configuration Settings <mof.conf>

Table of Contents | FAQ | Installation | Security Issues | Building Input Pages | Formatting
Configurations1 | Configurations2 | About Configurations | Troubleshooting | Customizing

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:

Use this as a reference for the settings in mof.conf. Settings are listed and explained in the order they appear in the mof.conf configuration file. We've also included a How Do I list for some of the frequently asked questions about settings. For beginners information on how to work with Perl configuration files, see Docs : AboutConfigurations.html.

How Do I .. ?


Major sections in the mof.conf configuration file

  1. HOW TO HANDLE ERROR MESSAGES ?
  2. CONTINUE SHOPPING IS FIXED LINK ?
  3. SECURITY SETTINGS
  4. FILE SETTINGS - FILE LOCATIONS
  5. OUTPUT TEMPLATES
  6. MISCELLANEOUS SETTINGS
  7. CART SETTINGS
  8. USER INPUT OPTIONS
  9. SHIPPING DESTINATION FIELDS TO USE/VALIDATE ?
  10. COUNTRY/STATE LIST SETTINGS
  11. COMPUTING A PRIMARY DISCOUNT
  12. COUPON DISCOUNTS
  13. ARES v2.4 SETTINGS
  14. HANDLING FEES
  15. INSURANCE OPTIONS
  16. DEFAULT SHIPPING
  17. USER SELECTED SHIPPING METHODS
  18. TAX COMPUTATIONS

Note: The Formatting settings are in the Docs > Formatting.html

 

1. HOW TO HANDLE ERROR MESSAGES ? Sections LIst How Do I ?

Use: Allows you to switch between troubleshooting messages for installation feedback and customer friendly error messages when ready to go live

0 Troubleshooting mode only, messages are not customer friendly. If you are running in ?test mode set ERRORMODE to zero for troubleshooting tips and info.

Security Warning: you must always set ERRORMODE to 1 or 2 when ready to go live, else those operating the cart from the web can see all your troubleshooting information when they get an error.

1 Return a Generic customer friendly error message for all errors.
Does not redirect to moferrors.html or custom page
This message provides a Click Here to return to the site Link as defined in $ErrMsgLink

2 Redirect all Error messages to a custom page as defined in the $ErrMsgRedirect URL
If you provide a ViewCart link (../mof.cgi?viewcart) in your custom page, then you must specify a URL for your site's main shopping area in the $ErrMsgViewCart URL. MOF will reset the continue shopping memory to the URL defined
Otherwise "continue shopping" will lead back to the error page, not good.

$ERRORMODE = [0/1/2];
$ErrMsgLink = 'URL for Click Here to return to the site on ERRORMODE 1';
$ErrMsgRedirect = 'URL to custom Error page for ERRORMODE 2';
$ErrMsgViewCart = 'Reset continue shopping memory to this URL for ERRORMODE 2';

 

2. CONTINUE SHOPPING IS FIXED LINK ? Sections LIst How Do I ?

Use: You have a central page like a store portal, index page, or table of contents page, and you want to always send a customer there when they click on MOF's various continue shopping buttons and links.

If you want continue shopping to be a fixed link set this to a valid URL
continue shopping buttons and links will always lead to this URL
$ContinueShopURL = 'Some valid URL';

Comment out or set to NULL to disable this setting
continue shopping will be remembered by MOF as the page where the buy or add to cart click took place
$ContinueShopURL = '';

If you need to specify a Returning URL

Use the variable "RET_URL" and submit as hidden input from any MOF input page, and MOF will pick that up as the Returning URL, and adjust the "continue shopping" button to that URL

<INPUT type="hidden" name="RET_URL" value="http://www.url ..">

 

3. SECURITY SETTINGS Sections LIst How Do I ?

Use: Allows you to define exact domains, or exact pages that are authorized to submit INPUT data to the cart, preventing anyone from tampering with product input, changing prices on your products, submitting bogus products that you don't sell.

Security Warning: You must have both of these settings enabled and operating correctly to prevent any tampering with your product INPUT. See this support notice.

1 Enable POST only input to be accepted into the cart
0 Allow any kind of input to be accepted into the cart
$POST_ONLY = 0;

Provides a list of valid domains that have permission to interact with the cart
@ALLOWED_DOMAINS = ('http://localhost');

A page from anywhere can submit INPUT data to your cart
@ALLOWED_DOMAINS = ();

 

4. FILE SETTINGS - FILE LOCATIONS Sections LIst How Do I ?

Use: Settings necessary for MOF's file operations. These directories store scratch information on orders and shipping information for each customer.

Where are the two main scripts located ?
The next two settings are either single file names or URLs - not absolute paths

Where is the MOF Front End cart script ?
- A simple filename should always work for this
$programfile = 'mof.cgi';
$progormfile = 'http://www.yoursite.com/mcart/mof.cgi';

Where is the MOF Back End Payment processing script ?
- If not running under SSL a simple file name is good
- Must be a valid HTTPS URL if switching off to SSL for Payment processing
$paymentfile = 'mofpay.cgi';
$pay-orntfile = 'http://www.yoursite.com/mcart/mofpay.cgi';
$pay-orntfile = 'https://secure.somesite.net/your/site/mofpay.cgi';

Where are the data scratch directories located ?
The next two settings are always absolute paths - not a URL. These settings define your server's full path to the ../orderdata/ and ../orderinfo/ directories that contain scratch data. Assign the full server path to these settings. Make sure these directories have full write permissions by your cgi scripts. On unix/linux chmod 777, on NT use your admin access or contact admin to set permissions. For help on absolute paths see: Docs > Installation.html

An example of an absolute path for UNIX/Linux
Note the opening and ending forward slashes in the path
Do not use relative addressing in this ../ or ../../

$datadirectory = '/home/sites/site14/orderdata/';
$infodirectory = '/home/sites/site14/orderinfo/';

An example using the cgi Environment Document Root variable
Note: this is relative to where a server is configured for your root access

$datadirectory = $ENV{DOCUMENT_ROOT} . '/orderdata/';
$infodirectory = $ENV{DOCUMENT_ROOT} . '/orderinfo/';

An example of an absolute path for NT
Note the opening Drive ID and ending double backslash

$datadirectory = 'D:\HTTPd\yoursite\orderdata\\';
$infodirectory = 'D:\HTTPd\yoursite\orderinfo\\';

What file name extension to use for scratch files ?
Allows you to specify what file extension to use for scratch data files

$data_extension = 'order';
$info_extension = 'prevw';

Security Warning: It's best to locate these scratch directories outside your public web space, above the www or public web access via the web server. Some servers will not allow you to create directories in your account root, and so your only option is to locate these directories inside the www or public web access areas. If you do this then you should password protect these directories, to allow only the scripts to access them, and prevent any web access to the data in these directories. These directories don't contain any billing information, but they do contain shipping addresses that are remembered. For more on this see: Docs > SecurityIssues.html section.

 

5. OUTPUT TEMPLATES Sections LIst How Do I ?

Use: Settings necessary for MOF's file operations. These templates allow you to custom design the look and feel of all the cart screens. For help on creating your own templates see: Docs > Formatting.html

MOF uses nine templates to present the various cart screens that you see in traveling through the cart: viewing the cart, validation messages, error messages, shipping info, order summary, billing info, order confirmation, invoice copy. The templates are standard HTML web pages, with a special insertion marker embedded as an HTML comment.

Where are the 4 templates for the Front End cart screens ?
Again, these next settings are always absolute paths - not a URL. These settings define your server's full path to the ../mofcart/ directory that contain MOF's template files. For help on absolute paths see: Docs > Installation.html

Note: UNIX/Linux the path opens with forward slash and ends with the filename.html
For NT you would typically start with Drive ID and end with filename.html
Do not use relative addressing in this ../ or ../../

Template for the View Cart or Ordering online is easy screen
$accept_order_template = '/home/sites/site14/web/mofcart/mofviewcart.html';

Template for the Validation Message screen, Please Try Again message
$validation_template = '/home/sites/site14/web/mofcart/mofvalidate.html';

Template for the Shipping, insurance, tax, discount coupons information screen
$preview_info_template = '/home/sites/site14/web/mofcart/mofshipping.html';

Template for the Order summary screen
$preview_template = '/home/sites/site14/web/mofcart/mofsummary.html';

What is the Insertion Marker to look for ?
Note: this exact string must appear as an HTML comment in the location where you want MOF to mix dynamic output with the HTML template. MOF will grab the template defined above for a given function, and insert all its dynamic output where this marker is located in the template.

$insertion_marker = '<!--MOF-INPUT-AREA-->';

 

6. MISCELLANEOUS SETTINGS Sections LIst How Do I ?

Use: Some various settings for formatting date, time, currency, weight, delimiter

GMT offset time in seconds:
5hrs AHEAD = 5X60X60 = 18000, 3.5hrs BEHIND = -3.5X60X60 = -12600
For a GMT offset reference see: Docs > GMT_offsets.txt
Put a zero to use your server's localtime
Example: Austin, Texas (summer) USA CST
$gmtPlusMinus = -18000;

Formatting the date-time line
0 date display off
1 Sunday, June 17, 2001
2 Sunday, June 17, 2001 8:29:41 AM
3 06/17/2001
4 06/17/2001 8:30:12 AM
$format_date = 2;

What to do with that long Order ID number ?
0 Do not show that long Order ID number in the cart screens
1 Go ahead and show that long Order ID number
$show_order_id = 0;

What currency symbol to use ?
$currency = '£';
$currency = '€';
$currency = '$';

What weight symbol to use ?
$weight = "lb";

What delimiter to use for product input field separation
Note: be careful about changing this and don't use MOF reserved characters :: or | or [ ]
Also don't use any string that has a common occurrence, like the comma
And don't use any special Perl characters either, like ; or || or {}
$delimit = "----";

What eMail address is listed on ERRORMODE 2 messages ?
$merchantmail = 'merchant@yourdomain.com';

 

7. CART SETTINGS Sections LIst How Do I ?

Use: Allows you to set the carts behavior with regard to cookies, keeping carts, keeping shipping info, incrementing duplicate items, handling zero amount orders, allowing fractions, sub total display

How long (in hours) to hold/initialize cart ?
0 Forget the customer as soon as they close their browser
XXX Remember the customer for XXX number of hours (8760 = 1 year)
$holdtime_data = 2400;

Note: We recommend remembering your customers. The cart simply works more professionally that way. If a customer doesn't finalize the order, their items are still in the cart the next time they visit the site. This could even be used with a simple SSI or PHP script that checks the cookie and lets the customer know they still have UN-purchased items in their cart.

How long (in hours) to hold/initialize Order summary info ?
0 Forget the customer as soon as they close their browser
XXX Remember the customer for XXX number of hours (8760 = 1 year)
$holdtime_info = 2400;

Again, we recommend keeping this to a healthy setting. It provides MOF with the ability to remember your customers' shipping information, so they don't have to keep entering their shipping address each time they use your cart.

Redirect message if Browser refuses cookies
MOF performs some checks to see if the Browser cookies are operating correctly, and if not, the customer will receive a message, which you can customize at this URL
$cookieredirect = 'http://localhost/mofcart/mofcookies.html';

Does Add to Cart increment duplicate items ?
1 Prevents AddToCart from incrementing duplicate item
0 AddToCart will increment any duplicate items by the quantity input
$item_no_increment = 0;

Allow Fractions in Quantity Boxes
1
Allow fractions: (1.2) (0.1) as quantity input
0 Allow only integers, round to lowest integer if fraction entered
$allow_fractions = 0;

Note: When enabled, this setting will always trigger a sub total line for each item in the cart, so that computations will be correct. The product's original price as set in the input is always assumed to be one unit. Hence, apples input price is $ 0.35 (per pound), then someone can enter 0.5 of that item and the correct sub total will compute, purchasing 1/2 pound of apples.

List the Main Item in the sub total lines ?
1 Prints sub total lines: Sub Total 2 of The Item at $ 50.95 each
0 Prints sub total lines: Sub Total 2 ( $ 50.95 per unit )
$item_in_subline = 10;

Note: You may want to disable this if using HTML [pseudo tags] in the Item Field input. Otherwise, the HTML will show up in the sub total line, as in src images, etc.

Zero based invoice bypass
If Order summary final amount = $ 0.00, this setting can pass a preliminary request to the Back End payment processing script to bypass the Billing information screen
1 Request to bypass the Billing info screen
0 Stop on the Billing info screen (even if final amount = $ 0.00 and no payment required)
$zb_passthrough = 1;

Note: This setting only passes the Front End request. The final approval to bypass the Billing information screen is controlled by the Zero based invoice bypass companion settings in mofpay.conf

companion configs in mofpay.conf

1 Bypass Payment Method section
0 Treat a zero based invoice as any other, ask for configured Payment Methods
$zb_no_method = 1;

1 Bypass billing/receipt name, addr, etc
0 require billing/receipt fields as configured in mofpay.conf
$zb_no_billing = 1;
$zb_no_receipt = 1;

In the example settings above, in both mof.conf and mofpay.conf, a final order = $ 0.00 amount will not stop on the Billing information screen, but proceed directly to the Order confirmation screen without asking for any billing information from the customer, since no payment is needed.

If you wanted the comments box to display, then leave the mofpay.conf settings as in the above example, but disable the $zp_passthrough in mof.conf. The customer will stop on the Billing information screen, but no method, address, etc, will be requested.

 

8. USER INPUT OPTIONS Sections LIst How Do I ?

Use: Allows you to associate dropboxes, checkboxes, text boxes, textareas, radio buttons, with your products for things like size, color, shape, descriptions, extra costs, etc.

How It Works: MOF can accept and associate input from the entire Forms collection. When you build the FORM for a product's extra input, you assign each INPUT field a name. In order for MOF to locate and correctly group the input with your product, the field names you use in your Forms must be declared in this section of settings.

Having Problems ? If you have extra user input in your Forms, but it does not show up in the cart, then you probably do not have this area of settings correctly configured to match your site Forms and input. For help on this see: Docs > BuildingInputPages.html. For help on Perl syntax for these settings, see: Docs > AboutConfigurations.html.

What settings do you need ?

A. First: All field names used for extra input must be declared in the master list
%product_fields

B. Then: you have the option to declare a given field name as required
@field_validation

C. And: you have the option to declare a given field name either:

  • Price Adjusting @field_adjustments
  • Direct Price Input @price_input_adjustments

Note: If your field is not listed in any of the three optional lists, then MOF assumes the extra input is not required, not price adjusting, not direct price input.

A. Create the Master List of all extra Field Names
%product_fields = ('name','value');

Notes:

  • Field names are case sensitive, follow proper naming conventions

  • Do not use the names: "order" or "quantity" They are MOF reserved names

  • You can use the same Field name throughout your site, on multiple pages. The Field name color can be used for cars and shirts, where the listed colors are different for each, and MOF will print the input value, from any list named "color" for a product.

  • Think about sorting potential when assigning Field names: aZebra, bCars, cXrays forces that order, whereas, Zebra, Cars, Xrays sorts (Cars, Xrays, Zebra) when printing. Remember, it is not the Field name that MOF prints, but the input or selected value

  • For QUANTITYBOXES mode, use only the root field name. Do not include the numbering that appears in your Forms. MOF does not need the numbering sequence, only your Form input needs that.

B. List any Field Names that will be required input
@field_validation = ('name');

Notes:

  • MOF will require input from these fields (as listed in master list)

  • If using a dropbox (option list) then make sure and set the SELECTED value to ""
    The "" empty quotes submit a Null value which is the signal nothing was selected

    <SELECT NAME="color">
    <OPTION SELECTED VALUE="">Select Color
    <OPTION VALUE="Green">Green
    <OPTION VALUE="Orange">Orange
    </SELECT>

  • All validation is simple True/False. So text boxes and textareas will clear validation with one character; therefore, checkboxes and dropboxes (options lists) are the best candidates for strict validation.

  • Radio buttons pose a special problem in validation. If at least one item is not checked in the radio button group, then the group name is not parsed; therefore, MOF cannot validate an empty radio group You must set up a dummy radio option with a Null value as default, so MOF will know nothing was selected.

C - 1. List any Field Names that will be Price Adjusting
@field_adjustments = ('name');

Notes:

  • MOF compiles input from these fields (from master list) a special way.
  • Input will be in the format: value="description----0.00"
  • MOF will adjust the Main price of the product by the 0.00 value
  • The value can be a positive or negative number
  • For help on how to build this type of input see: Docs > BuildingInputPages.html

  • A field cannot be a member of price adjustments *and* direct price input

  • If your input does not follow the format above then a Null price adjustment is assumed

  • Do not use this input format unless the field is listed here as price adjusting, else the product information will be distorted in the cart

C - 2. List any Field Names that will be Direct Price Input
@price_input_adjustments = ('name');

Notes:

  • This is only used to allow a customer to enter a direct price in a text box
  • MOF compiles input from these fields (from master list) a special way
  • The product's main price will be adjusted as per text box input
  • This input prints as part of the product's description, similar to price adjusting
  • For help on how to build this type of input see: Docs > BuildingInputPages.html

  • If you want the customer to enter the main price, see the setting below
    $price_input = 'PriceInput';

  • A field cannot be a member of price adjustments *and* direct price input

How to allow Direct Price Input as main price

Notes: This setting identifies a special field name that you can use in your Forms to tell MOF you are sending direct price input for the product. Do not declare this field name in any of the array settings above. Once defined, it becomes a MOF reserved field name, and MOF will attempt to adjust main price when this field is present. Set to Null to disable.

$price_input = 'PriceInput';

Will you allow 0.00 amounts in direct price input ?
0 Zero (0.00) price input is not allowed
1 Zero (0.00) price input is allowed
$allow_zeros = 0;

Note: For this to work on a required field, list the field in the required list
Exception: Do not list $price_input in the required list, it is a reserved name

How to format the extra user input ?
0 No additional formatting
1 Make user input options separated by lines as <li> and /n
$makelist = 1;

Note: For most installations, you'll want this turned on. If you are doing some creative embedding of HTML [pseudo tags] in the input and you don't want MOF messing with your formatting, then disable this setting, and it's all yours. Our Example_TextArea.html input looks much cleaner with makelist formatting turned off.

What order to sort the extra user input ?
0 Sort ascending (default)
1 Reverse sort order to descending

$sortdescending = 0;

Note: Only the Keys are sorted, not values. So you can use naming schemes like 'aName' 'bName' to get a sort and the Title description header will show not the field name

 

9. SHIPPING DESTINATION FIELDS TO USE/VALIDATE ? Sections LIst How Do I ?

Use: Allows you to set which fields are displayed and required for Shipping Destination on the Shipping, insurance, tax, and discount screen

For help with Perl syntax for this setting, see: Docs > AboutConfigurations.html.

Syntax:
%shipping_destination_fields = ('name',[validation value]);

How It Works:

  • Include a field name (with validation value) to print it on Shipping screen
  • Set the validation value to zero (0) to *not* require input
  • Set the validation value to any positive integer to require that string length input
  • Do not set a validation value to Null, the field will not display
  • Remove the field's name and validation value from the list to disable its use
    - or - you can simply comment out the line

Example:

%shipping_destination_fields = (
   'Ecom_ShipTo_Postal_Name_First',2,
   'Ecom_ShipTo_Postal_Name_Middle',0
);

This defines that two fields will display. The First Name Field requires at least 2 characters entered, and the Middle Name Field is not required. No other fields will display.

Master List: Shipping Destination fields

You can have up to 15 fields for Shipping Destination. 
We are using the [Ship To] Fields in the ECML specs v1.0: http://www.ecml.org/
We substituted "Company" for the ECML "Line3" because they did not have company
We also added a "Region" to better manage world lists

  1. Ecom_ShipTo_Postal_Name_Prefix
  2. Ecom_ShipTo_Postal_Name_First
  3. Ecom_ShipTo_Postal_Name_Middle
  4. Ecom_ShipTo_Postal_Name_Last
  5. Ecom_ShipTo_Postal_Name_Suffix
  6. Ecom_ShipTo_Postal_Street_Line1
  7. Ecom_ShipTo_Postal_Street_Line2
  8. Ecom_ShipTo_Postal_Company
  9. Ecom_ShipTo_Postal_City
  10. Ecom_ShipTo_Postal_StateProv
  11. Ecom_ShipTo_Postal_Region
  12. Ecom_ShipTo_Postal_PostalCode
  13. Ecom_ShipTo_Postal_CountryCode
  14. Ecom_ShipTo_Telecom_Phone_Number
  15. Ecom_ShipTo_Online_Email

 

10. COUNTRY/STATE LIST SETTINGS Sections LIst How Do I ?

Use: Allows for external lists to populate the Country and State/Province dropboxes, and provides settings to manage the validation rules between Region and State/Province combinations.

What list to use for dropbox ?
Define the filename.txt to use in dropbox list for Country-State/Prov
Set this to Null "" to display a textbox for Country-State/Prov
$use_country_list = 'countries.txt';
$use_state_list = 'states.txt';

Note: We recommend using a dropbox if you are doing any shipping, tax, insurance computations. A textbox allows for too much input variation to be reliable in matching.

How to validate Region and State/Province combinations ?

What countries (as listed in countries.txt) have corresponding State/Province listings in states.txt ? In our package example, the states.txt list has all the States and Provinces listed for United States and Canada. Similarly, the corresponding setting is:

force state selection via the State/Prov dropbox for these countries
@force_state_select = ('United-States','Canada');

why ?

If "United-States" is selected as country then a State/Prov will be required from the State/Prov list, and any validation rule for Region is bypassed. Both State/Prov and Region will print.

If the country selected is not in the force_state_list, then validation for State/Prov is bypassed and the validation rule for Region is observed. Only Region will print, because the country does not have State/Prov listed

This allows us to use the dropbox State/Prov list and validation side by side with options for International Regions

Show this message if using both Region and State/Prov input:
$force_state_message = "Use Region for country other than USA or Canada.";

The Country List

The countries.txt list in MOF's package was carefully assembled to work round the globe, listing preferred Country names. It is a compilation of Amazon.com's Country List (as of 4-5-2001), USPS countries for Air Shipping and Global Priority Mail (March 2001), and the ISO Countries.  The list contains exact matches for USPS Global Priority Mail "Destination Countries," in case you're trying to match USPS shipping tables.  The list has long names so they appear with the full country name in all printable areas.  We have United-States set as the default country to be listed, as per the "selected" attribute, which you can reset to any country. If you do not use the "selected" attribute, then the first country on the list will be the default. Make sure the first Country in the list has a value = "" (null).

Use hyphens <option value=name-must-be-hyphenated> for spaces in the <option value> but not in the printable display text.

If you do not ship globally, then simply delete Countries that you do not ship to and they will disappear from the Country dropbox.

The State-Province List

The states.txt list in MOF's package has all US states and Canadian Provinces listed by their 2 letter ISO code.  It also has the first value of value="" (null), which is the default selection, because the "selected" attribute is not present.

Important: <option value=""> must be left as the first or "selected" option for validation to work correctly.

Rules for making your own lists

  • Set up the ASCII list files just like you're creating an HTML OPTION list
  • Do not include the <select></select> lines, MOF does that
  • Do not use any periods or special characters in your lists (.";)
  • The first value="" (null) should be the only occurrence of quotes

  • Syntax: <option [selected] value=Whatever>Anything or Whatever
  • Only one option per line

  • If you use "selected" to default to a specific value:
    Do it this way <option selected value=WHAT>
    Not this way
    <option value=WHAT selected>

  • For State/Prov *only* MOF is set to recognize value=NOTINLIST> as a non printable value. If NOTINLIST is selected as the State-Province, then MOF will not print it. This is an old MOF feature. Newer versions use the Region input to handle a State/Prov "not in list," however, the feature is still there if needed

  • Use hyphens <option value=name-must-be-hyphenated> for spaces in the <option value> but not in the printable display text. This is used to prevent any parsing-matching-html encoding errors.

Browser Note: Here's some browser specific stuff: The Mac Internet Explorer v5+ must have first option defined exactly this way in the list file:

<option value="">Select State
<option value="">Select Country

The Mac IE browser will read the "Select State" on the right side as the value if you do not specify (null) as a set of double quotes for this option.

But be careful not to enclose any of the other <option>s in your list with quotes, else the Mof script cannot process the pattern matching it needs to do to remember what was selected.

Note: MOF attempts to recall and use any saved shipping information, so if you change lists, then delete all the scratch files in ../orderinfo/. This will reinitialize everyone's shipping information, and prevent any conflicts between old data and new lists.

 

11. COMPUTING A PRIMARY DISCOUNT Sections LIst How Do I ?

Use: You can set up simple discount schemes here.

Note: If you need more complex computations for this feature, consult the general online support area for custom code packages, or, with a valid license (support levels only please), just send an email to: support@merchantpal.com and I can probably help.

Syntax: 
@use_discount = ('amount/quantity/custom', rate, increment);

  1. set the method to compute by [amount/quantity/custom]
  2. set the rate applied at each increment [numeric value]
  3. set the increment (dollar amount or quantity of products)

Notes:

  • no user input is needed
  • computed from initial product sub total (before SH&I, etc)
  • will not trigger if the sub total price = $ 0.00
  • default increment is 1, if not otherwise defined

Examples:

Discount 5% of subtotal (amount) on the penny 
@use_discount = ('amount',0.0005,0.01)

Discount 5% of subtotal (amount) default (per dollar) 
@use_discount = ('amount',0.05)

Discount 2.5% of subtotal for each $ 100.00 spent
Note: this example only applies the computation at $ 100 increments

@use_discount = ('amount', 0.025, 100);

Discount $ 1.25 for each 10 products purchased
Note: this example only applies the computation at 10 product increments

@use_discount = ('quantity', 1.25, 10);

Do not use any primary discounts
@use_discount = ();

Defer to custom code for discount
@use_discount = ('custom');
For help on customizing discount computations see: Docs > Customizing.html

Note: If you enable custom computations, you will get the pre installed custom example:

  • No discount if < 50 products purchased
  • Discount $ 6.00 if 50 - 99 items purchased
  • Discount $ 9.95 if 100 - 199 items purchased
  • Discount $ 12.50 if 200 - 349 items purchased
  • .. and on with an UN even scheme

Note: If this setting isn't set up correctly, the worst that can happen is MOF will compute a zero.  MOF is set to compute zeros on anything it sees a setting for, but can't figure out what rules are being sent to it.  When zeros are computed for a setting, then the item is not added to the overall computation math. 

Note: If you set an increment that is greater than the initial price or products one actually purchases, then no discount will compute, because the increment condition has not been satisfied.

 

12. COUPON DISCOUNTS Sections LIst How Do I ?

Use: Allows you to set up a simple system where you can issue coupon numbers (stored in a flatfile) that customers can use for discounts when they shop on your site.

How It Works:

If enabled, MOF will prompt shoppers to enter their coupon numbers on the Shipping, insurance, tax, and discount coupons screen. If the coupon number is matched in the coupons.txt list, then MOF applies the discount as set for that coupon.

How to compute the discount ?

percent : associated rate in coupon file is a percent multiple, X percent of subtotal
dollar : associated rate in coupon file is an actual dollar amount discount per invoice

@use_coupons = ('percent');
To disable this feature set to null
@use_coupons = ();

Where is the coupon file ?
$coupon_file = 'coupons.txt';

Note: set the /full/path/to/file/coupons.txt if the file is not located in the native directory your scripts are running in

Security Warning: make sure the coupons.txt file is secure if you use one.  That means keep it out of range of any public web access If you must locate it inside a public web area, then password protect the file, or give file a name no one can guess, to make it difficult for web visitors to peek in it. Check that you are not able to peek into the coupon.txt file from your web browser.

How to set up the coupon file

Important: edit the coupons.txt file with a plain ASCII editor, and make sure there are no extra lines at the end of the file, else the coupon computation fails. Your very last coupon entry should have no extra blank lines after it

Set up the coupons.txt like the packaged example
Each line has three elements, delimited by the
"|" character:
Coupon-Number|Discount-Rate|Affiliate-Rate

  • Coupon-Number (any alphanumeric string)
  • Discount-Rate can be a percent rate or dollar amount
  • The Affiliate Rate : set to zero (0)

Note: Affiliate Rate belongs to an old referral tracking system, RTS (Referral Tracking System) v2.0, which should still work with MOF ver 2.4, and can be found in the MOFcart developer's area. We have replaced the old RTS v2.0 with ARES v2.4, an automated, web based Affiliate Referral Earnings System. If you use ARES, you cannot use the manually issued coupon numbers.

What default coupon to display for New customers ?
$default_coupon = "New Member";

This sets the default coupon code to display when someone enters the Shipping information, insurance, tax, discount coupons screen.  This allows you to give away a particular coupon number, with a rate that you designate in the coupon file, to anyone that comes to your site and doesn't have a Real Coupon number.  If you don't want to give away a coupon number, then just set this to "None."  It's best to set this to something, because that field won't validate without something in it.  It doesn't have to be a valid coupon number to clear the form, but it does have to be a valid coupon number to compute any discount.

Notes:

  • user input is entered on the Shipping, insurance, tax, discount coupons screen
  • a button is provided on the Order summary screen "Have any Coupons"
  • discounts are computed from initial product sub total (before SH&I, etc)
  • a discount will not trigger if the sub total price = $ 0.00
  • each coupon can have a different rate, but you must use only one method [percent/dollar] throughout the coupons.txt settings

More ideas for using this feature:

You can do a mail out for a particular promotional and assign a designated discount rate for that campaign.

Set up coupon names to match some question you ask your customers. What's the best site on the net? Answer: www.yoursite.com. If they put in "yoursite" then give them a discount. Or, who sent you to this site? Answer: Roger. If they put in roger, give them a discount

 

13. ARES v2.4 SETTINGS Sections LIst How Do I ?

Use: ARES v2.4 (Affiliate Referral Earnings System) is a powerful companion affiliate program that runs exclusively with MOF. It is a fully automated, web based, two tier system that provides purchase tracking for affiliate earnings, representative earnings, customer discounts, real time sign-up, web based Admin, web based account management for affiliates, and more. It is an exclusive MOFcart companion program, available in the MOFcart developer's area for anyone licensed at the developer's level.

The best way to see it in operation is to sign up as an affiliate with MerchantPal.com services, where all MOFcart products are distributed. That will give you a tour of the system, and if you decide to actually use your affiliate links, you can earn real money.

You won't be able to access the Admin control panel, but you can view a complete set of the ARES v2.4 documentation here, which may give you an idea of how the Admin works

The ARES v2.4 installation docs explain how to make these settings in mof.conf

$use_ARES_default_number = ('percent');
$coupon_file = '/path/to/couponcode.dat';
$use_ARES = 1;
$aresCookieID = "ARESv24";
$lockfiles = 1;

Note: You cannot use both ARES and the Coupon file feature together. ARES takes control of the secondary discount routines and overrides any other coupon files you may have. You must have ARES settings disabled to use the manual coupon file as a secondary discount.

If you are using ARES, we recommend that you set up a catch all default affiliate number (yourself) to handle any orphan transactions. This makes ARES a powerful tool to track all ordering activity on the site, not just click through affiliate activity. Some folks might want to set up the system just to track ordering activity without collecting real affiliates.

$use_ARES_default_number = 'YourAffiliateNumber';

 

14. HANDLING FEES Sections LIst How Do I ?

Use: You can set up a simple handling fees scheme here.

Note: If you need more complex computations for this feature, consult the general online support area for custom code packages, or, with a valid license (support levels only please), just send an email to: support@merchantpal.com and I can probably help.

Syntax: 
@use_handling = ('amount/quantity/custom', rate, increment);

  1. set the method to compute by [amount/quantity/custom]
  2. set the rate applied at each increment [numeric value]
  3. set the increment (dollar amount or quantity of products)

Notes:

  • no user input is needed
  • computed after all discounts are applied
  • line item is a part of SH&I computations
  • default increment is 1, if not otherwise defined

Examples:

Compute Handling of 5% of subtotal after any discounts on the penny 
@use_handling = ('amount',0.0005,0.01)

Compute Handling of 5% of subtotal after any discounts default (per dollar) 
@use_handling = ('amount',0.05)

Compute Handling of 2.5% of subtotal after any discounts for each $ 100.00 spent
Note: the computation is only applied at each $ 100 intervals
@use_handling = ('amount', 0.025, 100);

Compute Handling of $ 1.25 of subtotal after any discounts for each 10 products purchased
Note: the computation is only applied at each 10 products intervals

@use_handling = ('quantity', 1.25, 10);

Don't compute any handling charges
@use_handling = ();

Defer to custom code for handling charges
@use_handling = ('custom');
For help on customizing discount computations see: Docs > Customizing.html

Note: If you enable custom computations, you will get the pre installed custom example:

  • Handling of $ 2.50 for under 6 items
  • Handling of $ 4.50 for under 11 items
  • No handling charge if over 10 items purchased

More ideas for using this feature:

The handling fee computations are a good candidate for adding a special line item in the summary, like a "Service Fee," etc. Enable custom computations, and you can reword the line item display. With some creativity, you could even tie it to only certain items, etc.

 

15. INSURANCE OPTIONS Sections LIst How Do I ?

Use: Allows you to set up a dropbox or radio button group of options on the Shipping, insurance, tax, coupon discount screen for shipping insurance rates and options

Note: If you need more complex computations for this feature, consult the general online support area for custom code packages, or, with a valid license (support levels only please), just send an email to: support@merchantpal.com and I can probably help.

For help with Perl syntax for this setting, see: Docs > AboutConfigurations.html.

Syntax:
%use_insurance = ('option listing','[code / rate]');
$type_insurance_options = "radio"; ("radio" or "dropbox")

How it works:

This feature is only available as custom code. For help on customizing insurance options see: Docs > Customizing.html

Notes:

  • the "option listing" is what prints
  • the code / rate are numeric values only
  • the list is sorted by values in ascending order
  • no commas in the array except for those separating key,val
  • no apostrophes-quotes except for surrounding text field
  • use plain text,  no html tags allowed in arrays

  • insurance options will not print unless some kind of shipping is enabled
    (you don't have to charge shipping, just enable it)


  • if you want to allow an option for customer to decline insurance, use zero 0
    It can't be Null but must be zero to clear the field validation

    If you don't have a option value set to 0, a customer will not be able to decline the insurance.  You can force insurance costs by setting all options greater than 0


  • same amount values are not allowed

Rule: Insurance will compute at face value of the option value, unless you adjust the custom code in moflib.pl to act otherwise.

Example:

%use_insurance = (
    'No Insurance',0,
    'Up to $ 500.00 ($13.25)',13.25,
    'Up to $ 1000.00 ($18.98)',18.98,
    'Up to $ 2500.00 ($26.00)',26.00,
    'FREE Standard Insurance','1000',
    'Compute Priority Insurance','2000'
    );

The insurance computation in the MOF v2.4 package moflib.pl has branch conditions for 1000 and 2000. If those option values are selected by the customer the code is set to apply no insurance for 1000, and apply $ 0.75 per item for 2000

You can set up a simple No (0), Yes (1) condition by rewriting the special conditions in moflib.pl, where 0 is like we currently have it, and the branch for 1 is anything you want to make.

 

16. DEFAULT SHIPPING Sections LIst How Do I ?

Use: Allows you to set up one method of shipping

Note: At time of ver 2.4 release, MOF does not have any real time shipping integration with USPS, UPS, etc. Please check the web site for any announcements if you need this. It is on my wish list, and considered a medium priority.

Note: I have tried to provide some basic settings for general shipping costs. This section is not intended to provide for all situations. It made more sense to simply include support for custom shipping code, where specific situations can be handled better.

Note: If you need more complex computations for this feature, consult the general online support area for custom code packages, or, with a valid license (support levels only please), just send an email to: support@merchantpal.com and I can probably help.

A. Set up shipping method and rates

Syntax:
@use_shipping = ('amount/weight/custom', domestic-rate, foreign-rate, increment);

  1. set the mode to compute [amount/weight/custom]
  2. set the Domestic Rate applied at each increment
  3. set the Foreign Rate applied at each increment
  4. set the Increment (dollar / number products) to apply rate

If the weight mode is specified, MOF will sum all ShipCodes found for products to compute overall weight of the order. Make sure you set up the ShipCode input for each product to reflect actual weights.

If the amount mode is specified, MOF will not use the ShipCodes, but use the total dollar amount on the invoice.

Specify custom to use custom shipping code
@use_shipping = ('custom');

Note: If you are not using domestic-foreign matching settings, then the default rate is the rate in the domestic-rate position in the setting.  Even if you don't use domestic-foreign matching, you still need a placeholder in the foreign position, otherwise the increment will not be identified correctly.

B. set up minimum rates

If you have minimum settings defined, and the increment in @use_shipping is not met, then the minimum rate will apply.  If you don't have minimum rates defined, and the increment is not satisfied for your shipping computations, then shipping charges will be zero.

$minimum_domestic = 0;
$minimum_foreign = 0;

C. set up any domestic flags

For help with Perl syntax for this setting, see: Docs > AboutConfigurations.html.

@domestic_city = ();
@domestic_state = ();
@domestic_country = ('United-States');

MOF will flag any shipping destination input that matches your settings here for city, state, or country. Important: make sure you use state and country values to correspond with the state.txt and countries.txt lists if you use those lists. Note the hyphen in United-States, United-Kingdom, etc.

Custom example, domestic, international

@use_shipping = ('custom');
@domestic_country = ('United-States');

If you enable the custom mode, shipping will compute as per the example code installed in the MOF package moflib.pl until you install your own code.

  • For any shipping destination matching your domestic settings: "United-States"
    • Shipping of $ 6.95 for under 6 items
    • Shipping of $ 8.95 for under 12 items
    • Any order with 12 or more items is Free shipping
  • Otherwise display message: International Shipping To Be Added

For help on customizing default shipping see: Docs > Customizing.html

Flat rate example

@use_shipping = ('weight',1,1,1000000);
$minimum_domestic = 12.95;
$minimum_foreign = 18.95;

This is a simple trick that will trigger the minimums. It says, if total weight is under a million pounds, then apply the minimum. The minimum settings are your flat rates.

Other examples

Add $ 2.95 (domestic) or $3.95 (foreign) for each $ 100 spent
Note: the rate computes at each $ 100 increment
@use_shipping = ('amount',2.95,3.95,100);

Add $ 1.35 (domestic) or $ 1.85 (foreign) per each pound
Note: Pounds are computed from your ShipCodes
@use_shipping = ('weight',1.35,1.85,1);

Just trigger the shipping screen, please

This is a trick if you need to trigger the Shipping, insurance, tax, coupon discount screen, but do not want any shipping costs computed.
@use_shipping = ('weight',0,0,1);

Domestic, foreign matching reliability

Forcing dropbox lists for State-Province and Countries is the most reliable matching. The "city" box is open text, allowing non standardized input.  Matching is case insensitive, and matches on word boundaries. The problem with the city list you make is that you wouldn't want to declare "LA" as a domestic city, and have someone enter "La Grange," which is a city in Texas, celebrated by ZZtop, but a far cry from LA.

List of US states and Canadian Provinces

This list matches the packaged states.txt list

@domestic_state = (
'AL','AZ','AR','CA','CO','CT','DE','DC','FL','GA','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA',
'MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC',
'SD','TN','TX','UT','VT','VA','WA','WV','WI','WY','AB','BC','MB','NB','NF','NS','ON','PQ','SK');

Global regions

MOF ver 2.4 added better accommodation for Regions, however, I did not add Region matching. So if you are in another country and trying to standardize the matching, I suggest you create your own states.txt list and go for just changing the title "State - Province" to "Region." You'll have to do that in the main scripts. Search for "State - Province" string in mof.cgi and mofpay.cgi, which should only come up 3 times.

 

 
17. USER SELECTED SHIPPING METHODS Sections LIst How Do I ?

Use: Allows you to set up multiple shipping methods for the customer to select from.

Note: At time of ver 2.4 release, MOF does not have any real time shipping integration with USPS, UPS, etc. Please check the web site for any announcements if you need this. It is on my wish list, and considered a medium priority.

Note: As with the default shipping settings, I have tried to provide some basic settings for general shipping costs. This section is not intended to provide for all situations. It made more sense to simply include support for custom shipping code, where specific situations can be handled better. Custom solutions are usually far more efficient than using the general settings for multiple methods here, however, these settings were in early versions of MOF, and so I left them in, but I never use them.

Note: If you need more complex computations for this feature, consult the general online support area for custom code packages, or, with a valid license (support levels only please), just send an email to: support@merchantpal.com and I can probably help.

For help with Perl syntax for this setting, see: Docs > AboutConfigurations.html.

1. Set up methods and descriptions

Syntax:
%use_method = ('MethodName','MethodName Description');
$default_method = "MethodName";
$type_method_options = "radio"; ("radio" or "dropbox")

2. Make shipping settings for each method

I recommend you read the section above on default shipping. These computations operate the same way with regard to mode, domestic-rate, foreign-rate, increment, and minimums. Here, you'll have to set those up for each MethodName defined in %use_method

Syntax:
%method_mode = ('MethodName','[amount/weight/custom]');
%method_domestic = ('MethodName',domestic-rate);
%method_foreign = ('MethodName',foreign-rate);
%method_increment = ('MethodName',increment);
%method_min_domestic = ('MethodName',minimum-domestic-rate);
%method_min_foreign = ('MethodName',minimum-foreign-rate);

Notes:

  • user selected methods override any default shipping computations
  • the "MethodName Description" is what prints
  • the code / rate are numeric values only
  • the list is sorted by "MethodName" in ascending order
  • no commas in the array except for those separating key,val
  • no apostrophes-quotes except for surrounding text field
  • no spaces in the Key names, use underscore as in the examples
  • use plain text,  no html tags allowed in arrays

Example

Here are the settings running on our demo sites.

Set up four methods
%use_method = (
  'Central_Freight_Lines','Ship by Central Freight Lines 3 day delivery',
  'Overnight_Flight','Ship by Overnight 747 Jet Overnight delivery',
  'Express_Delivery','Ship by Internet Express E-delivery',
  'Pick_Up','I will Pick it up at the Factory in my Pick Up Truck'
);

Set which method is the default selection
[any MethodName]
$default_method = "Pick_Up";

Set display to radio or dropbox list
[radio/dropbox]
$type_method_options = "radio";

Define the computation mode for each method
[amount/weight/custom]
%method_mode = (
    'Central_Freight_Lines','amount',
    'Overnight_Flight','weight',
    'Express_Delivery','custom',
    'Pick_Up','weight'
);

Note: each MethodName can have a different mode, however, if you define "custom" for any MethodName, then you must have the corresponding custom branch condition and computation code in the moflib.pl For help on customizing custom shipping methods see: Docs > Customizing.html

Define the domestic-rate for each method
[numeric value only]
%method_domestic = (
    'Central_Freight_Lines',0.0003,
    'Overnight_Flight',1.77,
    'Express_Delivery',0,
    'Pick_Up',0
);

Notice in the "Pick_Up" method, we have a zero there, because that method is actually FREE shipping. If that method is selected, the mode is weight, which says to charge zero shipping for whatever weight. The zero for "Express_Delivery" is simply a placeholder. You must at least have a placeholder for each MethodName listed. In this case, the zero is meaningless, because custom code really computes shipping for Express_Delivery.

Note: %method_domestic also defines the default rate if not using domestic, foreign matching. Important: domestic, foreign matching will be used as per these settings in 16. DEFAULT SHIPPING

@domestic_city = ();
@domestic_state = ();
@domestic_country = ();

Define the foreign-rate for each method
[numeric value only]

%method_foreign = (
    'Central_Freight_Lines',0.00035,
    'Overnight_Flight',2.35,
    'Express_Delivery',0,
    'Pick_Up',0
);

Note: You don't need to set these unless you are using foreign-domestic matching. If MOF looks for this and it is empty, shipping will be $ 0.00. You can also set a particular foreign rate to zero if you want $ 0.00 foreign shipping charges for a particular mode.  You must at least have a placeholder for each MethodName listed. Domestic, foreign matching will be used as per the settings in 16. DEFAULT SHIPPING

Define the increment for computations
[numeric value only]
%method_increment = (
    'Central_Freight_Lines',0.01,
    'Overnight_Flight',1,
    'Express_Delivery',0,
    'Pick_Up',0
);

Notes:

  • mode = "amount" : (rate * [integer of (SubDiscountAmount / Increment)])
  • mode = "weight" : (rate * [integer of (TotalWeight / Increment)])

You can compute things on the penny or hundredth of a pound, just like in the default shipping examples, or you can compute things on the dollar or each pound, or you can compute things for each hundred dollars or each 4.2 pounds.  You must have at least a placeholder for each MethodName listed.

Define any minimum settings
This is a dollar amount only 0.00, which is applied if the increment condition is not satisfied for a selected method. Want to do a flat rate for a given method ? See the trick above in default shipping for flat rates.

%method_min_domestic = (
    'Central_Freight_Lines',2.85,
    'Overnight_Flight',22.95,
    'Express_Delivery',0,
    'Pick_Up',0
);

%method_min_foreign = (
    'Central_Freight_Lines',4.85,
    'Overnight_Flight',27.95,
    'Express_Delivery',0,
    'Pick_Up',0
);

 

18. TAX COMPUTATIONS Sections LIst How Do I ?

Use: Allows you to set up various tax computation rules.

How it works:

Products with a non-zero TaxCodes are flagged for potential taxation. Any product with its TaxCode set to zero (0) is flagged as a nontaxable item. MOF will compute taxes on taxable items only and by the rules you have defined in the settings below.

Note: MOF does not have ability to identify different tax categories for products, like in some European countries, where items are taxed at different rates. MOF only allows you to designate whether an item is taxable or nontaxable.

1. Rules for how to compute tax

Allow tax exempt status
0
disable the tax exempt option
1 enable the tax exempt input box
$tax_exempt_status = 1;

If enabled, and a VAT or ID is entered by the customer, then all tax computes to zero and the VAT or ID number appears as line item on the Order summary screen. There are no validation rules built into this feature, it is just a way of overriding the tax computations via user input.

Print a flag to identify taxable items ?
$identify_tax_items = "<font size=1 color=gray>tax</font>";

Set to (null) "" if you do not want to show what items are being taxed, or set to any string or image to be printed next to all taxed items in the invoice.

Use a global tax on everything
$use_global_tax = 0;

This must be set to zero to use other tax settings. Enable it by defining a tax rate in raw percent format 0.0825 for 8.25%. If enabled, tax will be computed on all items with non-zero TaxCodes. Items with zero (0) TaxCodes are considered nontaxable items. The computation will conform to Tax Before-After and Exception list rules. A global rate overrides all other rates and matching.

Tax before or after shipping, handling, insurance ?
1
Do not tax SH and I -- Tax before the SH and I
0 Tax all the SH and I charges along with taxable items
$tax_before_SHI = 1;

Note: this rule is reversed if any of the @exception list conditions are matched

Note: the before-after rule is applied to the tax computation at large.  You cannot set before for city, after for state, etc ..

How to handle multiple rates found for city, state, zip, country
1 Do you want all possible tax area matches to consolidate to a total rate ?
0
Or do you just want to use the matched tax rate that is largest ?
$add_tax_rates = 1;

If MOF finds multiple matches in more than one area defined in the cCity, postal code, state, and country, then you can choose to consolidate all the rates into one rate, or you can make the rate whatever is the largest of all matched rates.

The consolidated rate is what you would use if you need to access a state tax, and a county tax, and a city tax.  You would define the area matching lists, and enable this switch to tell Mof to consolidate any and all rates it finds.

Note: Mof will quit looking in an area once it finds the first match.  That way consolidate rates can't come from a tax matching area more than once.

2. Lists for identifying taxable / nontaxable shipping destinations

The following lists can be set to identify taxable areas and rates by city, postal code, state, country. The lists can be as long as you want. If the shipping destination address matches anything in your lists, then MOF considers it a taxable shipping destination.

The @exceptions lists are used to reverse the $tax_before_SHI rule for a match. In other words, you have two lists each for city, postal code, state, country. A matched destination in the %use list says to tax according the the $tax_before_SHI rule. A matched destination in the @exceptions list says to reverse the $tax_before_SHI rule. Again, the before-after rule is applied to the tax computation at large.  You cannot set before for city, after for state, etc .. The prevailing rule is the one that emerges after all matching is performed.

Syntax:
%use_ lists = ('string to match on',rate);
@exceptions_ lists = ('string to match on');

Note: the rate is defined in raw percent format 0.0825 is 8.25% tax

Match city:
%use_city_tax = ('string',rate);
@exceptions_city = ();

Match postal code:
%use_zipcode_tax = ('string',rate);
@exceptions_zipcode = ();

Note: make the postal codes text by enclosing the pattern in single quotes.  Also MOF will match on the beginning of the string, with an open ending boundary, since 78745 is the same as 78745-8999. This is different from city, state, country, where MOF matches on the string boundary

Match State-Province:
%use_state_tax = ('string',rate);
@exceptions_state = ();

Match Country:
%use_country_tax = ('string',rate);
@exceptions_country = ();

Note: if you are using the drop lists in states.txt and countries.txt then make sure your lists are constructed from those values.

Note: matching is not case sensitive, but it is boundary sensitive, except for postal code.  When MOF finds the first match it aborts searching that list any further.  The match sequence is: City, PostalCode, State, Country.  Leading or trailing spaces, or extra characters can prevent a match. 

Example:

Destination : Austin, TX 78745 : taxable (yes) : rate (10.75%) before SH&I
Destination : Someplace, CO 08244 : taxable (yes) : rate (5.3%) after SH&I
Destination : Someplace, UK : taxable (yes) : rate (1.5%) before S&I
Destination : Someplace, WA : taxable (no)

$use_global_tax = 0;
$tax_before_SHI = 1;
$add_tax_rates = 1;

%use_zipcode_tax = (
    '78745',0.025,
    '78746',0.026,
    '78747',0.027,
    '78748',0.028,
    '78749',0.029,
    '78750',0.030
);

%use_state_tax = ('TX',0.0825,'CO',0.053,'CA',0.0922);
@exceptions_state = ('CO');
%use_country_tax = ('United-Kingdom',0.015);

Note: if you were really trying to tax United-Kingdom you would need to expand this list to include all the different listings in the countries.txt list, like Great-Britain, England, etc.

Computation integrity

If any discounts are applied to the invoice amount then an Adjusted Tax Amount is computed.  The "Adjusted Tax Amount" is used to compute the Tax.  Adjustments are made from the ratio of taxable amount to whole amount. That ratio of Discounted total(s) is subtracted from the Taxable Amount.   

What that means is this: Tax is computed less any discount, but only for those items that are actually taxable.  If all items are taxable then an entire discount (if there is one) is subtracted from the taxable amount, so that only the actual purchase amount is taxed. 

What if there are mixed items in the invoice? Both taxable and non taxable? And there is a discount?  Then MOF computes an adjusted taxable amount, from ratios between the taxable to non taxable items, the whole price of each, and the total discount applied to the invoice.

We did things this way because tax is applied or not applied per product, yet discounts are not applied at the product level, but at the invoice level.  So, when a discount is applied to an invoice of products, where each individual product may or may not be taxable, then we need to determine exactly how much of the actual taxable items will be discounted, so we can tax only the actual amount of those products and not the original price of those products prior to any discounts. 

 

HOW TO CHANGE WHAT THE SHIPPING INFO SCREEN ASKS FOR Sections LIst How Do I ?

Use: Explains how the many settings in mof.conf influence what is asked for on the Shipping, insurance, tax, discount coupon screen.

How It Works

MOF uses an intermediate screen between the ViewCart and Order summary screen to collect any customer  information that would be relevant to creating an accurate summary of the invoice: computations for shipping, tax, insurance, and coupon discounts.  The default discount and handling computations do not require any customer information other than your configuration settings.

The table below lists all the settings that are capable of directing MOF to trigger the intermediate page. If you have any of these settings enabled, MOF will decide that you need customer information, and therefore, enable the Shipping information, insurance, tax, discount coupon screen.

When all of the settings in this list are disabled, then MOF will not ask for any customer information, and when the customer clicks the "next" button, they will be taken directly to the Order summary screen.

Enabling any of these 10 settings will trigger the intermediate information screen

 

Anything to do with Shipping Information

setting how it works to trigger info screen
1 %shipping_destination_fields

These four settings enable shipping computations in one way or another.  Enabling combinations of these four settings will trigger the Shipping, insurance, tax, discount coupon screen

Examples below.

2 @use_shipping
3 %use_method
4 %use_insurance

Using the coupon discount feature

setting how it works to trigger info screen

5

@use_coupons This setting requires the customer to enter a coupon number on the Shipping, insurance, tax, discount coupon screen, unless you are using ARES

Anything to do with area specific tax computations

setting how it works to trigger info screen
6 %use_city_tax

If enabled, MOF will need input on the tax area, as collected in the shipping information Field(s)

If you are using shipping information, then you will already have the appropriate field(s) enabled, because you will likely want the City, State-Prov, Postal Code, and Country. 

Examples below.

7 %use_zipcode_tax
8 %use_state_tax
9 %use_country_tax
10 $tax_exempt_status

Examples of how shipping settings interact

If you enable either of the two shipping computations: the default shipping method
(2) , or the customer selected shipping method (3) , then MOF will expect the appropriate shipping fields enabled in the  %shipping_destination_fields (1) array.

Enabling the customer selected shipping method (3) , always overrides any settings in the default shipping method (2)

If you want to collect only the shipping address but don't want to compute any shipping charges, then enable both these settings:
  %shipping_destination_fields
  @use_shipping = (1);

To have the shipping destination field(s) display you need at least one of the shipping methods enabled: the default (2) or customer selected (3) method.

The insurance option requires that shipping fields (1) and at least one method (2) or (3) be enabled.  Shipping insurance won't trigger unless you're actually shipping something.

Example of using insurance, shipping fields, with real default shipping charges:
%shipping_destination_fields = ( define fields );
%use_insurance = ( define methods, rates );
@use_shipping = ('weight',0.35,0.55,1);

Example of using insurance, shipping fields, but no shipping charges:
%shipping_destination_fields = ( define fields );
%use_insurance = ( define methods, rates );
@use_shipping = (1);

Examples of how tax settings interact

The basic rule is this: If you enable any of the area specific tax computations (6) (7) (8) (9), or the tax exempt status (10), then MOF will trigger the Shipping, insurance, tax, discount coupon screen and ask for whatever field(s) are listed in the %shipping_destination_fields (1) array.

If you only want tax information and not any shipping destination address (you're not shipping products), then enable only the shipping destination fields to match tax areas for City, State-Prov, PostalCode, or Country. 

Note: if you configure MOF for tax only, then MOF will present messages that say "Tax Area" instead of "Shipping Information."  To force MOF to say "Tax Area" instead of "Shipping Info:" you can't have either of the shipping methods (2) (3) or insurance (4) enabled, else MOF thinks you are wanting to use shipping data too.

Real Examples

Let's say you don't ship anything, but want to be able to compute a tax on any orders in the Tax Area for six Postal Codes.  You must have two settings: configure the tax area to match zip codes (7) and present the zip code field so it can be entered by the customer (1).  This example asks for the Postal Code to be entered, and uses tax area settings to compute a 2.5% tax on any zip codes matching our list.

Settings (1) and (7) in the table above.

%shipping_destination_fields = ('Ecom_ShipTo_Postal_PostalCode',4);

%use_zipcode_tax = (
'78745',0.025,
'78746',0.025,
'78747',0.025,
'78748',0.025,
'78749',0.025,
'78750',0.025
);

Other examples:

You can enable only the Coupon Discount feature.  You can enable the Coupon Discount and one tax matching area.  You can enable only the Shipping area and insurance, with no shipping charges.  You can enable a global tax, with shipping restricted to only a local area.  You can enable shipping areas instead of shipping methods, where the customer selects the shipping area they are in.  You can set up any logical combination of the ten settings to collect information that may be pertinent to the Order summary screen.

Example: A computer distributor might charge shipping and tax.  So only the Postal code is needed from the customer.  Configure the ten settings to ask for only the Postal Code on the Shipping Information page.  The customer enters the zip code to get an exact Order summary with any applicable shipping or tax charges.

 


HOW TO GET RID OF THE SHIPPING INFO SCREEN Sections LIst How Do I ?

Disable all ten settings described in the above section.  Of course, doing this prevents you from collecting any information for shipping address, shipping computations, shipping methods, insurance, discount coupons, or tax matching information.  So, you won't be able to make any of those computations, but you will by pass the Shipping information, insurance, tax, discount coupon screen.  The Order summary screen will say "ORDER INFO" and not "SHIP TO" on the top left tab of the cart.

%shipping_destination_fields = ();
@use_shipping
= ();
%use_method
= ();
%use_insurance
= ();
@use_coupons
= ();
%use_city_tax
= ();
%use_zipcode_tax
= ();
%use_state_tax
= ();
%use_country_tax
= ();
$tax_exempt_status = 0;

 

 

 

These programs are copyright @ MerchantOrderForm.com, MerchantPal.com 2001