close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Combining an onchange event, for product lookup, with inventory control?

Thread began 5/29/2014 11:49 am by Nathon Jones Web Design | Last modified 6/06/2014 12:30 pm by Nathon Jones Web Design | 2796 views | 33 replies

Nathon Jones Web Design

Sorry, I've added that in now with the =="" condition.

Since Ray's changes, I can no longer access the Add to Cart behaviour via the server behaviours panel so I had to hand code it as best I could...

<?php if($row_rsAddToCartLookup['LEDprice'] != "" && $row_rsAddToCartLookup['LEDprice'] > "0") { ?>
// WA eCart AddToCart
if (isset($_POST["LEDCart_1_ATCButton"]) || isset($_POST["LEDCart_1_ATCButton_x"])) {
$ATC_itemID = $_GET["lbid"];
$ATC_AddIfIn = 0;
$ATC_RedirectAfter = "shopping-basket.php";
$ATC_RedirectIfIn = "";
if (isset($totalRows_rsPROD) && $totalRows_rsPROD > 0) {
//$row_rsPROD = WAEC_findRecordMySQL($rsPROD, "LEDid", $ATC_itemID);
if ($row_rsPROD) {
$ATC_itemID = $row_rsAddToCartLookup['LEDid'];
$ATC_itemName = "".$row_rsAddToCartLookup['LEDproductcode'] ."";// column binding
$ATC_itemDescription = "".$row_rsPROD['LEDtitle'] ."";// column binding
$ATC_itemThumbnail = "".$row_rsPROD['LEDimg'] ."";// column binding
$ATC_itemWeight = floatval("".$row_rsPROD['LEDnetweight'] ."");// column binding
$ATC_itemQuantity = "".$_POST["LEDCart_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".$row_rsAddToCartLookup['LEDprice'] ."");// column binding
$ATC_itemColour = "".$row_rsAddToCartLookup['LEDcolourname'] ."";// column binding
$ATC_itemDimmable = "".$row_rsAddToCartLookup['LEDdimmablename'] ."";// column binding
$ATC_itemSensor = "".$row_rsAddToCartLookup['LEDsensorname'] ."";// column binding
$ATC_itemType = floatval("".$row_rsPROD['LEDtypeID'] ."");// column binding
$ATC_itemAvailableQuantity = "".$_POST["productStock"] ."";// column binding
$ATC_parentID = floatval("".$row_rsPROD['LEDparentID'] ."");// column binding
mysql_data_seek($rsPROD, 0);
$row_rsPROD = mysql_fetch_assoc($rsPROD);
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$LEDCart->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemThumbnail, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice, $ATC_itemColour, $ATC_itemDimmable, $ATC_itemSensor, $ATC_itemType, $ATC_itemAvailableQuantity, $ATC_parentID);
if ($ATC_RedirectAfter != "" && $LEDCart->redirStr == "") {
$LEDCart->redirStr = $ATC_RedirectAfter;
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
else {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
<?php } ?>

...perhaps there's something wrong in my hand coding, or maybe I need to change the cart file too?
Appreciate the help. Thank you.

I've also unhidden the AvailableQuantity form field so you can see what's happening there.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...