close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Inventory control in eCart5

Thread began 4/06/2010 1:48 pm by Badger | Last modified 7/15/2010 1:44 pm by Badger | 3131 views | 28 replies

Badger

I couldn't get anywhere with that direction so I've gone back to a hopefully simpler approach described by Sades but need help finishing it off:

I've created a new field in my items table called Inventory then in the eCart calculations panel I added a new formula called substractions with this formula:

[Inventory] - [Quantity] so creating the formula substractions = Inventory - Quantity,

On the product page I open the "Add to cart button" server behavior and I bind the Inventory field to the Inventory column

On the checkout_success page, I add eCart display manager for a receipt, and add the following code near <?php echo $eCart->DisplayInfo("Name"); ?>
to update the Inventory

php:
<?php
$FinalStock 
$eCart1->DisplayInfo("substractions");
$IDItem $eCart1->DisplayInfo("ID");
mysql_select_db($database_connTEST$connTEST);
$query_substractions "UPDATE products SET Inventory = $FinalStock WHERE ID = $IDItem;
$substractions mysql_query($query_substractions$connTEST) or die(mysql_error());
?>



Idea is when the success pages loads it subtracts the order quantity from the Inventory field.

But I'm getting a sql error "You have an error in your SQL syntax near 'WHERE LampID = etc'

Any idea if this should work and what I might be missing in this code?

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

Content

rating

Layout

rating

Ease of use

rating

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...