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

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 | 1632 views | 33 replies

Jason ByrnesWebAssist

That may work, I cant really say for certain as the lookup ray created is custom coding and is not supported through the form.

looking at your page through Fire Bug, it looks like the price lookup ajax function returns a string separated by a semi colon, see the attached screen shot:
5.60:LWP0038

looks like the first part is the price, and the second part is the item number. after adding that part of the SQL to the query, you would also need to edit the code that creates the Colon separated string to add the remaining inventory.


in the updatePriceDisplay function, the colon sperated string is broken to an array using:

var priceInfo = (silent_form[1]).split(":");


the price is returned through the 0 index of the priceInfo array:
priceInfo[0]

example:
if(priceInfo[0] !="") { document.getElementById("productPrice").innerHTML = "£" + priceInfo[0] + " inc. vat"; }

the item number through the 1 index:
priceInfo[1]

example:
if(priceInfo[1] !="") { document.getElementById("productCode").innerHTML = priceInfo[1]; }

by adding the remaining Invetory to the string, you would reference it using the 2 index:
priceInfo[2]

you could do something like add a hidden form element to the page:

<input type="hidden" name="remaingQuantity" id="remaingQuantity" value="0" />

the add code in the updatePriceDisplay to set the value:

document.getElementById("productCode").value = priceInfo[2];

you also asked this similar question in another thread. In the add to cart button behavior, you can bind the remaining inventory cart column to the remaining inventory hidden element for the calculation that I suggested to work

Where this is custom coding, it is not supported through the forums/

All i can really do is offer suggestions, and examples of the code to use, Note, the examples may need further tweaking, as I can only really give theory here. If you are not able to get this to work on your, you will nee to go through the premiere support service.

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