PDA

View Full Version : Custom Cart


Mike Armas
12-12-2005, 01:56 PM
Iam trying to change some stuff on the cart. When you add stuff to your cart you can fill out a form.

Then that form is add to the cart when you view it.

GWA Generator Attendee Fee


This crap.
-> (Item 1) Salutation: Dr.
-> (Item 1) Visitor_Name: mike
End of crap

I found this in the pgm-add_cart.php


// Check for custom form data

$additional_data = "";
$form_data = "";

if ($FORMFLAG == "ON") {

for ($y=1;$y<=$FORMLOOP;$y++) {

reset($HTTP_POST_VARS);
while (list($name, $value) = each($HTTP_POST_VARS)) {

$tmp_lookfor = "Item-".$y."-";

if (eregi("$tmp_lookfor", $name)) {
$tmp_dat = "";
$tmp_dat = eregi_replace("$tmp_lookfor", "", $name);
$tmp_dat = ucwords($tmp_dat);
$tmp_val = ucwords($value);
$tmp_val = stripslashes($value);
$tmp_dat = "-> (Item $y) ".$tmp_dat.": $tmp_val:br:";
$additional_data .= $tmp_dat;
}

Iam guess this is where the info is pulled out of the from. And put in the view part of the cart.

How can i change the out put of the info it out puts like this

-> (Item 1) Salutation: Dr.
-> (Item 1) Visitor_Name: mike

How do i make it do this

Dr. mike

Can anyone help out ?

Mike Armas
12-13-2005, 12:05 PM
How do i put a BR in the line.

if (eregi("$tmp_lookfor", $name)) {
$tmp_dat = "";
$tmp_dat = eregi_replace();
$tmp_dat = ucwords($tmp_dat);
$tmp_val = ucwords($value);
$tmp_val = stripslashes($value);
$tmp_dat = "".$tmp_dat." $tmp_val";
$additional_data .= $tmp_dat;
}

This is what i got it works

it looks like this Dr. Mike

that what i wanted. BUT if Quantity = 2
It will look like this

Dr. Mike Dr. Tracy

How do i make it have a br after the Dr. Mike.

In the code it pulls the

Form this from the DR and Name

<FORM NAME="Gen_Info_2" METHOD=POST ACTION="pgm-form_submit.php">

<TABLE ALIGN=CENTER BORDER=0 CELLPADDING=5 CELLSPACING=0 STYLE="font-family: Tahoma; font-size: 9pt;">

<INPUT TYPE=HIDDEN NAME="required_fields" VALUE="Visitor_Name">



<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=2>
<FONT FACE=ARIAL SIZE=1><I>An asterisk <FONT COLOR=RED>*</FONT> indicates a required field.</FONT>
</TD></TR>
<tr><td align="left" valign="top">Salutation</td><td align="left" valign="top"><select style="width: 250px; font-family: Tahoma; font-size: 9pt;" name="Title">
<option value="">Select One... </option>
<OPTION VALUE="Dr.">Dr.</OPTION>
<OPTION VALUE="Mr.">Mr.</OPTION>
<OPTION VALUE="Mrs.">Mrs.</OPTION>
<OPTION VALUE="Ms.">Ms.</OPTION>
</SELECT>
</TD></TR>
<tr>
<td align="left" valign="middle"><FONT COLOR=RED><B>*</B></FONT>Visitor Name</td>
<td align="left" valign="top"> <input type="text" SIZE=35 style="width: 250px; font-family: Tahoma; font-size: 9pt;" name="Name" value=""></td>
</tr>


<!-- #ADDFIELD# -->


<TR><TD ALIGN=CENTER VALIGN=TOP>&nbsp;</TD><TD ALIGN=LEFT VALIGN=MIDDLE><BR>
<INPUT TYPE=SUBMIT NAME="SUBMIT" VALUE="Submit Form" STYLE="font-family: Tahoma; font-size: 9pt; cursor: hand;">
</TD></TR>
</TABLE>

</FORM>

I must have a Title and a Name field. The code pulls each field and so there is no way to put a br in this code.

if (eregi("$tmp_lookfor", $name)) {
$tmp_dat = "";
$tmp_dat = eregi_replace();
$tmp_dat = ucwords($tmp_dat);
$tmp_val = ucwords($value);
$tmp_val = stripslashes($value);
$tmp_dat = "".$tmp_dat." $tmp_val";
$additional_data .= $tmp_dat;

ecasue it will look like this

Dr.
Mike
Dr.
Tracy

can anyone help.