We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message
Contact Forum Editor

Send an email to our Forum Editor:


PLEASE NOTE: Your name is used only to let the Forum Editor know who sent the message. Both your name and email address will not be used for any other purpose.

Tech Helproom


It's free to register, to post a question or to start / join a discussion


 

E-commerceapplication for pricing by area


geoff47

Likes # 0

I wonder if it possible to have an application to price a commodity by area ?
My idea would be the customer puts in two dimensions and it results in a price based on a price per square metre.
I could give fixed prices for fixed sizes, but would like another option so customers can choose exactly what size they buy.

Hope it's not a tall order.
Any suggestions would be very welcome.
Thanks in advance

Like this post
Ansolan

Likes # 0

Have the code below lying around if that helps. A bit basic but gives you a start. Doubtless mentioning what you already know but in case, save the code in notepad, change the extension to .html and have a look, see if you think this is worth incorporating into your page. You would only need to change the value (currently 300) and add a little styling to suit.

<html>
<head>
<title>Calculator</title>
<script type="text/javascript">
//calculator
function cal() {
var x=document.form.length.value
var y=document.form.width.value
var a=x*y //calculates square meters
var total=a*300 //calculates cost. Enter your own cost/sq. meter
document.form.total.value=total;
}
</script>
</head>
<body>

<h3>Project cost calculator:</h3>
<form action="" name="form">
<p><input type="text" name="length" size="2" /> Enter the length of your project in meters.<br />
<input type="text" name="width" size="2" /> Enter the width of your project in meters.</p>

<p><b>Click this button to calculate the approximate cost of your project:</b><br />
<input type="button" name="money" value="calculate" onclick="cal()" /></p>

<p>£ <input type="text" name="total" size="6" /></p>
</form>
</body>
</html>

Like this post
geoff47

Likes # 0

Thank you for that, I shall give it a go.
I know next to nothing about code, but have been surprising myself lately.
Done things I thought were beyond me.
Thanks I shall let you know how I get on.
Don't hold your breathe.....this may take a while.

Like this post
geoff47

Likes # 0

I cannot thank you enough.
Hopefully I can tweak it about a bit to do exactly what I want.
Linking it to a shopping cart.
Many thanks indeed

Like this post

Reply to this topic

This thread has been locked.



IDG UK Sites

Where to buy iPhone 6 and iPhone 6 Plus in the UK: Launch day price, deals and contracts

IDG UK Sites

Is Apple losing confidence in itself?

IDG UK Sites

Professional photo and video techniques for perfect colours

IDG UK Sites

How (and where) to buy an iPhone 6 or iPhone 6 Plus in the UK. Plus: What to do if you pre-ordered...