Code: Select all
<?php echo $row_rsProduct['Size']?>Code: Select all
<?php echo $row_rsProduct['StockID']; ?>Code: Select all
<select name="SelectSize" id="SelectSize">
<option value="Select Size">Select Size</option>
<?php
do {
?>
<option value="<?php echo $row_rsProduct['Size']?>"><?php echo $row_rsProduct['Size']?></option>
<?php
} while ($row_rsProduct = mysql_fetch_assoc($rsProduct));
$rows = mysql_num_rows($rsProduct);
if($rows > 0) {
mysql_data_seek($rsProduct, 0);
$row_rsProduct = mysql_fetch_assoc($rsProduct);
}
?>
</select>Code: Select all
// *** Add item to Shopping Cart via form ***
$XC_editAction1 = $_SERVER["PHP_SELF"];
if (isset($_SERVER["QUERY_STRING"])) $XC_editAction1 = $XC_editAction1 . "?" . $_SERVER["QUERY_STRING"];
if (isset($_POST["XC_addToCart"]) && $_POST["XC_addToCart"] == "form1") {
$NewRS=mysql_query($query_rsProduct, $beau) or die(mysql_error());
$XC_rsName="rsProduct"; // identification
$XC_uniqueCol="ProductID";
$XC_redirectTo = "";
$XC_redirectPage = "../cart.php";
$XC_BindingTypes=array("RS","RS","FORM","FORM","RS","RS","RS","NONE");
$XC_BindingValues=array("StockID","ProductID","SelectSize","Quantity","Product","Price","Stock","");
$XC_BindingLimits=array("","","","","","","","");
$XC_BindingSources=array("","","","","","","","");
$XC_BindingOpers=array("","","","","","","","");
require_once('XCInc/AddToXCartViaForm.inc');
}Code: Select all
<form id="form1" name="form1" method="post" action="<?php echo $XC_editAction1; ?>">
<select name="SelectSize" id="SelectSize">
<option value="Select Size">Select Size</option>
<?php /* note about passing the StockID Both the size needs to be passed using the select list and the stockID, the size chosen in the size and the stockID in the stock on the shopping cart array*/?>
<?php
do {
?>
<option value="<?php echo $row_rsProduct['Size']?>"><?php echo $row_rsProduct['Size']?><?php echo $row_rsProduct['StockID']; ?></option>
<?php
} while ($row_rsProduct = mysql_fetch_assoc($rsProduct));
$rows = mysql_num_rows($rsProduct);
if($rows > 0) {
mysql_data_seek($rsProduct, 0);
$row_rsProduct = mysql_fetch_assoc($rsProduct);
}
?>
</select>
<input type="image" src="../images/SS13AddToCart.jpg" border="0" name="submit"/>
<input type="hidden" name="XC_recordId" value="<?php echo $row_rsProduct['ProductID']; ?>" />
<input type="hidden" name="XC_addToCart" value="form1" />
<input name="NewPrice" type="hidden" value="<?php echo $discountThirtyResult; ?>" />
</form>here are the tables i have built
table 1 - beauSS13_products
ProductID
CatID
table 2 - beauSS13_Cat
catID
table3 - beauSS13_Stock
StockID
ID (this was named like this incorrectly) but this joins with ProductID
SizeID
Stock
beauSS13_SizeList
SizeID
Size