After removing them everything still works except the add to cart function. For whatever reason, the only way it will work is if that "form" inside a <td> tag. How can I get this to work without this tag?
Here is my 3 inc files. It is not complete as I am trying to get past this hurdle first.
Header:
Code:
<div id="menu">
<div id="menutop"><a title="home"href="index.html"><img alt="home" src="menu-top.gif" width="200" height="200" /></a></div>
<div class="navcontainer">
<ul class="navlist">
<li><a title="Home" href="../index.html">home</a></li>
<li><a title="Boys Blankets" href="http://www.blanketsnsuch.com/store/agora.cgi?page=store.html">Boys Blankets</a></li>
<li><a title="link three" href="index.html">link three</a></li>
<li><a title="link four" href="index.html">link four</a></li>
<li><a title="link five" href="index.html">link five</a></li>
<li><a title="link six" href="index.html">link six</a></li>
</ul>
</div>
<br />
</div>
<div id="main">
<!--BEGIN HEADER TABLE-->
<font face="Verdana, Arial" size=+1 color="#ccc"><b>Powered by AgoraCart - AgoraCart.com
</b><br></font><font face="Verdana, Arial" size=2 color="white"><i>Thanks for Visiting our Store!</i></font>
<!--agorascript-pre {
local (@my_cart_fields,$my_cart_row_number,$result);
local ($count,$price,$product_id,$quantity,$total_cost,$total_qty)=0;
if ((!(-f "$sc_cart_path"))||($sc_processing_order =~ /yes/i)) {return ""}
open (CART, "$sc_cart_path") || &file_open_error("$sc_cart_path",
"display_cart_contents_in_header", __FILE__, __LINE__);
while (<CART>)
{
$count++;
chop;
@my_cart_fields = split (/\|/, $_);
$my_cart_row_number = pop(@my_cart_fields);
push (@my_cart_fields, $my_cart_row_number);
$quantity = $my_cart_fields[0];
$product_id = $my_cart_fields[1];
$price = $my_cart_fields[$sc_cart_index_of_price_after_options];
$total_cost = $total_cost + $quantity * $price;
$total_qty = $total_qty + $quantity;
} # End of while (<CART>)
close (CART);
if ($count > 0) {
$result = '<div align="center">' .
'' .
' ' .
'<a href="agora.cgi?dc=1&%%href_fields%%' .
'"><font color="#0000ff">View Cart</font></a>' .
'<div style="width:50%;text-align:center;font-size:.75em;">' .
"Items in shopping cart: $total_qty \n " .
"Item cost subtotal: " . &display_price($total_cost) .
"</font></div>\n" .
'' .
'<a href="%%StepOneURL%%?order_form_button.x=1&%%href_fields%%' .
'"><font color="#0000ff">Check Out</font></a> ' .
"</div>";
} else {
$result = "";
}
return $result;
}-->
<!--END HEADER TABLE-->
Product:
Code:
<!--agorascript-pre
{ #Start of controller code, probably should leave this alone ;-)
local ($myans)="";
if ($rowCount == (1+$minCount)) { #first one
$ags_row_item=0;
$ags_tot_item=0;
$myans .= ''."\n";
}
$ags_row_item++;
$ags_tot_item++;
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= ''."\n";
$myans .= ''."\n";
}
}
if ($ags_row_item == 2) { # second one
$ags_row_item=0; #reset counter
$myans .= ''."\n";
} else { #first one
$myans .= ''."\n";
}
return $myans;
} # end of controller code
-->
<FORM METHOD = "post" ACTION = "%%scriptURL%%">
<div style="text-align:center;font-weight:bold">%%name%%
<div style="border:1px solid #fff;">%%image%%</div></div>
<br>
%%description%%
%%make_hidden_fields%%
<BR>
%%optionFile%%
<BR>
<P>
<!--BEGIN SELECT QUANTITY BUTTON-->
%%QtyBox%%
<INPUT TYPE="IMAGE"
NAME="add_to_cart_button" VALUE="Add To Cart"
SRC="%%URLofImages%%/add_to_cart.gif" BORDER="0">
<!--END SELECT QUANTITY BUTTON-->
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
if ($ags_row_item == 1) { # first and only one
$myans .= ''."\n";
$myans .= ''."\n";
}
}
return $myans;
} # end controller code
-->
<FONT FACE="ARIAL" SIZE="2" color="#FF0000">%%price%%</font>
<A HREF="%%scripturl%%?dc=1&%%href_fields%%"><FONT FACE=ARIAL>View Cart</FONT>
</A>
<A HREF='%%StepOneURL%%?order_form_button.x=1&%%href_fields%%'><FONT
FACE=ARIAL>Check Out</FONT>
</A>
</FORM>
<!--agorascript-pre
{ # more controller code
local ($myans)="";
if ($ags_row_item == 1) { # first one
$myans .= ''."\n";
} else { # second one
$myans .= ''."\n";
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one, need to join these two cells, no border
if ($ags_row_item == 1) { # first and only one
$myans .= ''."\n";
}
}
if (($rowCount == ($maxCount)) || ($rowCount == ($num_returned)))
{ # very last one
# if ($ags_row_item == 1) { # finished first one, add a blank dummy
#second
# $myans .= ''."\n";
# }
$myans .= ''."\n";
}
return $myans;
} # end controller code
-->
Footer:
Code:
<CENTER>
<!--agorascript-pre
&capture_STDOUT;
&cartlinks;
print "<font face=\"Arial\" size=\"2\">";
# take make links underlined
# $cartlinks =~ s/style=\"text-decoration: none\"//ig;
# to layout horizontally with 3 spaces
# $cartlinks =~ s/<br>/ /ig;
# to layout horizontally with | dividers spaces
$cartlinks =~ s/<br>/ | /ig;
print $cartlinks;
print "</font>";
&uncapture_STDOUT; --></CENTER>
<CENTER>
<CENTER><BR>
<small>Copyright 1999-2003 K-Factor Technologies Inc. at <a href="http://www.agoracart.com">AgoraCart.com</a></small></CENTER></CENTER>
</div>
Thanks for looking.
-SNT