Addendum
Copyright © 1999, William Weiland
Overview
The addendum module allows you to collect supplemental responses from customers at checkout. You can add as many questions to your form as you want. The responses are exported to a delimited text file which can be imported into most database management systems for further analysis. You can also have those responses appear in the Email notification and batch processing.
Initial Setup
Use the Merchant admin upload feature to upload the modules addendum.mv and cim_add.mv. As each are uploaded, click the Add button to add them to the mall/domain.

In admin, under your store, click on the link for the System Extension Configuration screen. Assign the CIM Addendum Extension module and Update it to install it in your store.

In admin, under your store, click on the link for the Fulfillment Configuration screen. Assign the Addendum module and Update it to install it in your store.

Click the link for Addendum to enter the configuration settings and add Addendum questions. You can have radio, select, checkbox, text and textarea type inputs.

You can also designate one or more of the questions to be required. If the customer does not answer the question, they will be recycled to the same page and will not be able to continue. In many cases this will be in the form of a checkbox to Accept terms of the purchase/sale. Simply include the number of the question(s) you want to be mandatory.

Special note: If you want the responses to show up in your merchant notification email, the Addendum module must be assigned to the store after your mail notifications. When looking at the tabs on the fulfillment configuration screen, the Addendum tab should be to the left and above (if more than one row of tabs) of the merchant email module tab.


Editing Requirements (skip if using the OpenUI)
If you are using the Miva Merchant User Interface (mmui) you will need to make some very simple edits to the core files. Be sure to do that with a text editor (NO WYSIWYG editors) such as Programmer's File Editor (PFE) so as not to damage the mv files. ALWAYS BACKUP your unmodified mv files in case you make a mistake. Choose one of the two locations below to insert the questions.

1) Places the questions on the last checkout page (cannot use with PayPal module):
In your mmui.mv file find <MvFUNCTION NAME = "MMUI_Order_Payment" and insert the following line just before the table with the continue button
<MvDO FILE="{g.Module_Root$'modules/fulfill/addendum.mv'}" NAME="l.addmore" VALUE="{show_questions(Stores.d.code)}">

Also, in your mmui.mv file find <MvFUNCTION NAME = "MMUI_Order_CustomerInformation" and insert the following line just before the table with the continue button
<MvIF EXPR = "{NOT l.total}">
<MvDO FILE="{g.Module_Root$'modules/fulfill/addendum.mv'}" NAME="l.addmore" VALUE="{show_questions(Stores.d.code)}">
</MvIF>


Also, in your mmui.mv file find <MvFUNCTION NAME = "MMUI_Order_Upsell_Single" and insert the following line just after the first FORM tag in the function
<MvDO FILE = "{g.Module_Root$'modules/fulfill/addendum.mv'}" NAME = "l.inputhide" VALUE = "{Make_Inputs()}">


Also, in your mmui.mv file find <MvFUNCTION NAME = "MMUI_Order_Upsell_Multiple" and insert the following line just after the FORM tag in the function
<MvDO FILE = "{g.Module_Root$'modules/fulfill/addendum.mv'}" NAME = "l.inputhide" VALUE = "{Make_Inputs()}">

2) Places the questions on the next to the last checkout page (must use this location if you are also using the PayPal module):
In your mmui.mv file find <MvFUNCTION NAME = "MMUI_Order_Payment" and insert the following line just before the table with the continue button
<MvDO FILE = "{g.Module_Root$'modules/fulfill/addendum.mv'}" NAME = "l.inputhide" VALUE = "{Make_Inputs()}">

In your mmui.mv file find <MvFUNCTION NAME = "MMUI_Order_ShippingPaymentSelection" and insert the following line just before the table with the continue button
<MvDO FILE="{g.Module_Root$'modules/fulfill/addendum.mv'}" NAME="l.addmore" VALUE="{show_questions(Stores.d.code)}">

Also, in your mmui.mv file find <MvFUNCTION NAME = "MMUI_Order_CustomerInformation" and insert the following line just before the table with the continue button
<MvIF EXPR = "{NOT l.total}">
<MvDO FILE="{g.Module_Root$'modules/fulfill/addendum.mv'}" NAME="l.addmore" VALUE="{show_questions(Stores.d.code)}">
</MvIF>


Also, in your mmui.mv file find <MvFUNCTION NAME = "MMUI_Order_Upsell_Single" and insert the following line just after the first FORM tag in the function
<MvDO FILE = "{g.Module_Root$'modules/fulfill/addendum.mv'}" NAME = "l.inputhide" VALUE = "{Make_Inputs()}">


Also, in your mmui.mv file find <MvFUNCTION NAME = "MMUI_Order_Upsell_Multiple" and insert the following line just after the FORM tag in the function
<MvDO FILE = "{g.Module_Root$'modules/fulfill/addendum.mv'}" NAME = "l.inputhide" VALUE = "{Make_Inputs()}">


Upgrading from Merchant version 1.x or 2.x
If you are upgrading your addendum from Merchant version 1.x or 2.x to Merchant version 3.x, you'll need to copy your dat file from the old data directory to the new data directory (e.g. 00000001/addendum/) AFTER you have installed addendum to Merchant version 3.x.
Retrieving Data
The most recent responses are stored in a file called addendum.dat in the addendum subdirectory of the store data files, for example 00000001/addendum/addendum.dat This file contains responses since the last time you purged responses. All purged responses are maintained in the addendum.arc flat file so it holds the complete history unless you delete it. If you delete it, it will start over. You can download either file to your hard drive and import it to a word processor or database manager as you see fit. If you make the selections as optional selections, and the customer chooses not to respond, a line will not be added for that customer. Text input and select inputs can be optional, radio will not be. In addition to the responses, which are captured, the addendum.dat will contain three fields from the customer's order. You can add to that list if you want to capture more data by modifying the addendum.mv module. However, it is essential that you do not change the first entry field, Orders.d.id.
Add Responses to Email (Optional) (skip if using the OpenUI)
If you are using the OpenUI, the Addendum responses are automatically added to the merchant notification email. If using the mmui, you can add code to the meremail.mv or other merchant notification module you might be using. In the meremail.mv, locate the tag </MvSMTP> Immediately preceding that tag, insert the text you want to appear for each question you want to show up. Below is an example of the code which displays the questions and responses for three items.
<MvEVAL EXPR = "{ asciichar( 10 ) $ 'Web host......: ' $ g.question1}">
<MvEVAL EXPR = "{ asciichar( 10 ) $ 'Found us......: ' $ g.question2}">
<MvEVAL EXPR = "{ asciichar( 10 ) $ 'Server speed..: ' $ g.question3}">

Add Responses to Batch Reports (Optional)
The install notes for including responses in the batch reports are contained in the comments section of iacctadd.mv.