[ic] Modified checkout form to include product info & e-mail receipt

Julia Jacobs interchange-users@interchange.redhat.com
Thu May 30 15:11:01 2002


Hi,

I'm trying to do something a little different with a foundation catalog type
Interchange website for an accountant client of mine.

I have a Services page where a customer can click on an Accounting Service
they are interested in.  After they click on the button, they are taken to
the ord/checkout.html page which I have modified somewhat.

Because the customer does not sign up for an account and there is no need to
collect any credit card, P.O. or check info, I took all of that stuff out.
I just wanted certain fields from the product info to show up which will let
the customer know they chose the right Service (as the Service is entered
into the product database), and the customer info to get saved into the
userdb.  I also wanted the customer to receive a receipt with the Service
they were interested in (then I could go and customize the receipt to say
something like "Thanks for filling out our form, we will contact you as soon
as possible. . .). 

I also wanted VARIABLE ORDERS_TO to get an e-mail with the
Product field info and filled customer userdb info as well.  Right now when
the "Contact Me" button is pushed nothing happens.  No e-mail gets sent and
no data gets saved.  The product info does get removed when you press the
"Remove" box next to the description.  At least I got that far.  Although I
would like to make it so the description was not a link.  Have not been able
to work that out.

The website where this page is: http://www.accountingusa.us/
Click on the Services menu tab on top, then click on one of the links on the
side menu. Then click the button to choose a service.  Its not totally
gorgeous yet so no heckling.

Help would be much appreciated.

<table width="95%">
<tr>
    <td align="left" width="100%">
                   
<FORM ACTION="[process secure=0]" METHOD="POST" name=checkout>
    <INPUT TYPE=hidden NAME=mv_session_id VALUE="[data session id]">

    [if type=explicit compare="[error all=1 show_var=1 keep=1]"]

        <B>There were errors in your last submission:<br>
        <blockquote>
        <FONT color="__CONTRAST__">
                [error all=1 keep=1 show_error=1 show_label=1 joiner="<br>"]
        </font>
        </blockquote>

    The areas you need to correct are shown in
    <FONT color="__CONTRAST__">this color</FONT> below.</B>
    
        <p>[/if] 
          <INPUT TYPE=hidden NAME=mv_doit VALUE=refresh>
          <INPUT TYPE=hidden NAME=mv_nextpage VALUE="ord/checkout">
          [comment] Order routes in catalog.cfg [/comment]
          <INPUT TYPE=hidden NAME=mv_order_route   VALUE="__ORDER_ROUTES__">
          <INPUT TYPE=HIDDEN NAME=mv_check    VALUE="Save_database">
           [set Save_database] [if cgi mv_todo ne submit]
          [calc] Log("Saving userdb in mv_check.")[/calc] [userdb save]
[/if] 
          [/set] </p>

<tr> 
            <td align="center"><font size="2" face="Verdana, Arial,
Helvetica, sans-serif">
              We would like to contact you about the service your interested
in. 
              <br>
              If you chose the right service, Click the <b>"Contact
Me&quot;</b><br>
            button and we will reach you via phone or e-mail as soon as
possible!</font></td>
        </tr>
        <tr> 
          <td align="center" width="100%">
            <p>&nbsp;</p>
            <table cellspacing="0" cellpadding="5" border="0" width="100%">
              <TR class="contentbar2">
                <td class="contentbar2">&nbsp;<b>Remove</b></td>
                <td class="contentbar2"><b>Description</b></td>
              </TR>
              <TBODY>
              [if items] [then] [item-list modular=1]
              <TR class="[item-alternate
2]maincontent[else]contentbar1[/else][/item-alternate]">
                <TD align=center valign=top> <INPUT TYPE=checkbox
NAME="[quantity-name]" onClick="this.form.action='[process-target]',
this.form.submit()" VALUE=0>
                </TD>
                <TD><p>[page [item-sku]]<b>[item-data products
description]</b> <br>
        [item-data products comment]
  
[if scratch dealer]
        [if-item-data pricing sku]
          <BR>[page quantity [item-code]]
          QUANTITY PRICING</A>
         [/if-item-data]
        [/if]

[if-item-data options o_enable] [if-item-data !options o_modular]
[table-organize cols=4 table=' ' font="size=1" pretty=1] [item-options td=1
label=1 bold=1 price=1] [/table-organize] [/if-item-data]
                    [/if-item-data]</p>
 <INPUT TYPE=hidden NAME="[quantity-name]" VALUE="[item-quantity]">
                  </TD>
              </TR>
              [if session logged_in] [/if] [/item-list] [/then] [else]
[/else] 
              [/if]
            </table>

        <br>
          </td>
    </tr>

    <tr>
          <td>
          <table border="0" cellspacing="0" cellpadding="0" align="center">
                <tr class="contentbar2">
                  <td colspan="2" class="contentbar2"><b>&nbsp;Please fill
in 
                    your <b>Contact Information</b> </td>
                  <td class="contentbar2">&nbsp;</td>
                  <td class="contentbar2">&nbsp;</td>
                </tr>
                <tr>
                   <td align=right class="contentbar1">
        [error name=fname std_label="First Name" required=1]
          </td>
          <td align=left class="contentbar1">
        <INPUT TYPE=text NAME=fname VALUE="[value fname]" size="20"
maxlength="20">
          </td>
                 <td align="right" class="contentbar1">[error name=lname
std_label="Last Name" required=1]</td>
          <td align="left" class="contentbar1"><INPUT TYPE=text NAME=lname
VALUE="[value lname]" size="20"></td>
                </tr>
                <tr>
                     [if scratch dealer]
          <td align="right" class="contentbar1">[error name=company
std_label=Company required=1]
          [else]
          <td align="right" class="contentbar1">Company
          [/else]
          [/if]
          </td>
          <td align="left" class="contentbar1">
        <INPUT TYPE=text NAME=company VALUE="[value company]" size="20"
maxlength="40">
          </td>
          <td class="contentbar1">&nbsp;</td>
          <td class="contentbar1">&nbsp;</td>
                </tr>
                <tr>
                  <td align="right" class="contentbar1">[error name=address1
std_label=Address required=1]
        </td>
        <td align="left" colspan=3 class="contentbar1">
          <INPUT TYPE=text NAME=address1 VALUE="[value address1]" size="40"
maxlength="64">
           </td>
                </tr>
                <tr>
                    <td class="contentbar1">&nbsp;</td>
        <td class="contentbar1" align="left" colspan=3>
          <INPUT TYPE=text NAME=address2 VALUE="[value address2]" size="40"
maxlength="64">
        </td>
                </tr>
                <tr>
                  <td align="right" class="contentbar1">
          [error name=city std_label="City" required=1]
        </td>
        <td class="contentbar1">
          <INPUT TYPE=text NAME=city VALUE="[value city]" size="20"
maxlength="20">
        </td>
        <td class="contentbar1">&nbsp;</td>
        <td class="contentbar1">&nbsp;</td>
                  <td align="right"
class="contentbar1"><b>State/Province</b></td>
                  <td class="contentbar1"> <b>
                    <input name=state type=text id="state" value="[value
state]" size="5" maxlength="5">
                    </b> </td>
                </tr>
                <tr>
                  <td align="right" class="contentbar1">
          [error name=zip std_label="Zip/Postal Code" required=1]
        </td>
        <td class="contentbar1">
          <INPUT TYPE=text NAME=zip VALUE="[value name=zip filter=word]"
size="10" maxlength="10">
        </td>
                   <td align="right" class="contentbar1">
          [error name=email std_label="Email Address" required=1]
        </td>
        <td class="contentbar1">
          <INPUT TYPE=text NAME=email VALUE="[value email]" size="30">
        </td>
                </tr>
                <tr>
                     <td align="right" class="contentbar1">
          Country
        </td>
        <td colspan="3" class="contentbar1">
          [if value country =~ /(^$|US|CA)/]
          <SELECT NAME=country onChange="this.form.submit()">
          <OPTION VALUE="US"> United States
          <OPTION [selected country CA] VALUE="CA"> Canada
          <OPTION VALUE="JP"> Other
          </SELECT>
          [else]
          <SELECT onChange="this.form.submit()" NAME=country>
          [loop option=country search="
        ra=yes
        fi=country
        st=db
        rf=code,name
        ml=1000
        tf=name
          "]
          <OPTION VALUE="[loop-code]"> [loop-data country name]
          [/loop]
          </SELECT>
          [/else]
          [/if]
          <small>(will update display)</small>
        </td>
                   <td align="right" class="contentbar1">
          [error name=phone_day std_label="Daytime Phone" required=1]
        </td>
        <td class="contentbar1">
          <INPUT TYPE=text NAME=phone_day VALUE="[value phone_day]"
size="12" maxlength="20">
        </td>
                </tr>
                <tr>
                  <td align="right" valign="middle" class="contentbar1">
<strong>Fax</strong></td>
                  <td class="contentbar1"><b>
                    <input name=fax type=text id="fax" value="[value fax]"
size="5" maxlength="5">
                    </b></td>
                  <td align="right" class="contentbar1"><strong>Contact
By</strong></td>
                  <td class="contentbar1"><select name="contact">
                      <option selected>select preference</option>
                      <option value="phone">phone</option>
                      <option value="email">e-mail</option>
                      <option value="mail">mail</option>
                    </select></td>
                </tr>
              </table>
            <p><br>
            </p>
        
        </td>
        </tr>
        <tr>
          <td>
            <table align="center" cellpadding="10" cellspacing="10"><tr>
        [if items]
                  <td> [button name="mv_click" src="placeorder.gif"
                    text="Contact
                    Me" hidetext=1 form=checkout ] mv_todo=submit [/button]
                  </td>
        [else]
                <td><b>No Services Chosen! Click on <a href="[area
service]">Services</a> to choose one you are interested in. . .</b></td>
        [/else]
        [/if]
      </tr></table>
        
      </form>
      [seti clear_errors][error all=1 hide=1 comment="Clear errors"][/seti]

    </td></tr>
    </table>

    <p>

    [include templates/components/specials]

  </td>
</tr>
</table>

-- 
Julia Jacobs
Currant Media
407-261-9351
Fax 407-261-0176
AIM JlJlnnjcbs | ICQ 131696309
msn jacobs_julia@hotmail.com | yahoo juliead_1
http://www.currantmedia.com
Members of The Better Business Bureau
* Multimedia Producers
* Web Design & Development
* 2D/3D Graphics/Animation
* Hosting, domain and e-mail
* E-Commerce ­ check, credit card validation