Hi Res,
Thanks so much for your help and speedy reply!
You are absolutely right in not wanting items removed from inventory before they’ve actually been purchased! However after a quick test using a demo page from my site it seems that no number change to the back end inventory is occurring until the customer has checked out, so no worries there.
During my test, I increased the inventory so that each product had 5 items in stock (it was at –1), however following the purchase process being carried through, instead of decreasing to 4 it dropped back to –1 again in the backend, so I’m not quite sure what’s going on there, but this might be a question for the developer.
I did however input the code you so kindly provided, however I received this message:
Parse error: syntax error, unexpected $end in /home/fhlinux150/b/bedlamitesboutique.co.uk/user/htdocs/_jewellery2.php on line 443
It’s possible I pasted it in incorrectly – the code for the shopping cart/items is as follows (apologies for the length!):
<!--Shopping Cart Begin-->
<p>
<form name="order" action="/cart/sc-managecart.html">
<input type="hidden" name="PRICE" value="" />
<input type="hidden" name="NAME" value="Bottle Pendant" />
<input type="hidden" name="ID_NUM" value="BTP" />
<input type="hidden" name="WEIGHT" value="1" />
<span style="white-space:nowrap;">Select a Bottle Type
<select name="PRODUCTSELECTOR">
<?php
$HTML = "";
// Get all specific result from the "inventory" table
$result = mysql_query("SELECT * FROM inventory WHERE catagory='Bottle Type 1'") or die(mysql_error());
while($row = mysql_fetch_array($result)){
if($row['instock'] > 0){
$HTML .= <<< eof
<option cost="$row[listPrice]" id_num="$row[itemid]" name="$row[itemName]">$row[description]</option>
eof;
}elseif($row['instock'] <= 0)
{
echo 'Sorry this item is out of stock.';
}
echo $HTML;
?>
</select></span>
<span style="white-space:nowrap;">Select Bottle Contents
<select name="ADDITIONALINFO">
<option value="Liquid">Liquid</option>
<option value="Glowing Crystals">Glowing Crystals</option>
</select></span>
<br /><span style="white-space:nowrap;">
Quantity: <input type="number" min="1" max="10" step="1" size="3" maxlength="3" name="QUANTITY" onChange='this.value=CKquantity(this.value)' value="1" />
</span><br /><span style="white-space:nowrap;"><img src="SPACER.GIF" width="120" height="10" /><input type="button" value=" Add to Cart " align="top" onClick="AddOneOfManyToCart(this.form);" />
<a href="/cart/sc-managecart.html">View Cart</a></span>
</form>
<!--Shopping Cart End -->
<!--Shopping Cart Begin-->
<p>
<form name="order" action="/cart/sc-managecart.html">
<input type="hidden" name="PRICE" value="12.00" />
<input type="hidden" name="NAME" value="spangly" />
<input type="hidden" name="ID_NUM" value="S1" />
<input type="hidden" name="WEIGHT" value="1" />
<?php
$HTML = "";
// Get all specific result from the "inventory" table
$result = mysql_query("SELECT * FROM inventory WHERE catagory='Spangly'") or die(mysql_error());
while($row = mysql_fetch_array($result)){
if($row['instock'] > 0){
$HTML .= <<< eof
<option cost="$row[listPrice]" id_num="$row[itemid]" name="$row[itemName]">$row[description]</option>
eof;
}elseif($row['instock'] <= 0)
{
echo 'Sorry this item is out of stock.';
}
echo $HTML;
?>
Quantity: <input type="number" min="1" max="10" step="1" size="3" maxlength="3" name="QUANTITY" onChange='this.value=CKquantity(this.value)' value="1" />
</span><br /><span style="white-space:nowrap;"><img src="SPACER.GIF" width="120" height="10" /><input type="button" value=" Add to Cart " align="top" onClick="AddToCart(this.form);" />
<a href="/cart/sc-managecart.html">View Cart</a></span>
</form>
<!--Shopping Cart End -->
</FONT>
</TD></TR>
</DIV>
</td>
</tr>
</table>
</BODY>
</HTML>
Hope this all makes sense, thanks again for your help, and I look forward to hearing what mistake I’ve made :o