STEP THREE: Configuring the placeorder.cgi program This step goes over the configuration and options for the placeorder.cgi program, which does a variety of things, depending on the configuration. This program has the capability to take in the order information, validate credit card numbers, assign reseller id, compute commissions, and send emails. By far, this program gives you the most options, hence, could take the longest to get setup. By default, this program is setup to do all the above functions at one time. If you want to be able to split out the order form and reseller form, you will need to do a little more configuring (see below).
ABOUT THE SCRIPT NAME
Each of the scripts within Affiliate Master are NOT limited to the given file name. In this example, we use placeorder.cgi as the name of the script. You name rename this file to anything you desire, except it must end with .cgi or .pl (example: order.cgi, signup.pl). If you change the name, just ensure you use the new name anywhere placeorder.cgi is stated below. NOTE: Because of the number of different options with this script, you may end up installation multiple copies of the script under different names. For instance, if you want the order form and resellers form on separate webpages, you will need to install a copy configured to just take in order information and compute commissions, and a second copy that creates a reseller id record.
The best place to setup the placeorder.cgi script is in the root directory of your server, as this gives the shortest website URL address (example: http://www.yourserver.com/placeorder.cgi). If you are not able to run cgi scripts from your root directory, you will need to install the program in your cgi-bin directory (sometimes called cgibin or just cgi). The website URL would then be: http://www.yourserver.com/cgi-bin/placeorder.cgi
NOTE: This default configuration option explains how to configure the placeorder.cgi to take both the ordering information and assign the reseller id. Further examples are given below on how to split out the order form and reseller form. Pull up the placeorder.cgi file in your favorite text editor. The first key item to review (and this holds true for all the cgi programs) is the very first line of the program. This is the path to Perl5, which we looked up in STEP ONE.
Be sure this path is pointed to Perl5 on your server. The path should look like:
Scroll down to line 14 in the program, to the line that is: This setting can be set to YES or NO. This tells the script whether or not it should act as an order form and calculate commissions for the reseller. Set this to NO if the script should not calculate commissions.
Scroll down to line 17 in the program, to the line that is:
This setting can be set to YES or NO. This tells the script whether or no it should
create a reseller id record for the new user. Set this to NO if the script should
not create a reseller id. (only needed if $create_reseller is set to YES) This file is used to assign the reseller id. The reseller id is assigned by taking the first letter of the first name plus the first letter of the last name plus the id number from this file.
Example:
Scroll down to line 23 in the program, to the line that is: (only needed if $create_reseller is set to YES) This setting is used to define the name of the reseller database file, which stores all the resellers information. You may configure this setting to point to a Virtual Server Path, as discussed in STEP ONE. This will add a little more security if you are able to place the file below the website root directory.
Example: NOTE: This file name should be the same in the placeorder.cgi, commissions.cgi and commissions_admin.cgi files.
Scroll down to line 26 in the program, to the line that is: (only needed if $track_commissions is set to YES) This file is used to assign an order number to the order.
Scroll down to line 29 and 30 in the program, to the line that is: (only needed if $track_commissions is set to YES) This setting is used to determine how commissions are calculated for the reseller. The # at the beginning of the first line means that line has be commented out. If you use the flat dollar amount line, be sure to remove the # and place # in front of the second line. Example 1: Use this format to assign a flat dollar amount as the commissions for each sale.
Example 2: Use this format to assign a percentage of sale as the commissions for each sale.
Scroll
down to line 33 in the program, to the line that is: (This field is always required) This is used to tell the script which fields in the form are required fields. The script will not allow successful submission of the form until all required fields have been filled in. To add fields, simply place a comma (,) and the field name in quotes ("). Example:
Add website Simply list all fields required on the form in this setting. Scroll
down to line 36 in the program, to the line that is: (the above should all be on one line) This setting is optional. It is used to list out which emails will be sent when the form has been successful submitted. This example will look in the emails directory for three email files: touser.txt (sent to the new user/reseller) tosupport.txt (sent to support) and tosponsor.txt (sent to the sponsor of the webpage). To add emails to be sent, simply place a comma (,) and the text email file in quotes ("). Example:
Add welcome.txt (the above should all be on one line) Be sure to upload a file called welcome.txt to the emails directory. Scroll
down to line 40 and 41 in the program, to the line that is: These two settings are used as the default sponsor name and sponsor email if an invalid reseller id is entered on the form. NOTE: The backslash (\) before the @ sign is required. Scroll
down to line 44 in the program, to the line that is: This setting is the path to your Sendmail program, which we found in STEP ONE. NOTE: Notice that there is a -t after the Sendmail path. This is needed for Sendmail to properly send the emails. Be sure the path for Sendmail itself is correct. Well, hopefully you got through all those options without too much of a headache. Most of the options could remain as default settings. In the end, you should have looked at 10 different key areas to be configured.
CREATING THE ORDER/RESELLER FORM When creating the order and/or reseller form, there are only a handful of pre-define fields that are used. Outside those, you can request any information on the forms and have them outputted to the tosponsor.txt email text file. Below is a list of fields that should be used in the online forms:
You may add as many other fields to the order form as desired. Be sure to read over STEP SIX on how to display those fields in the email text files.
USING CREDIT CARD VALIDATION LOGIC To use this logic, simply pass two fields to the program
If you want to have the order form and resellers form separate from each other, follow these steps:
|