View Full Version : Help Needed for Newbie for Price Quote Issue
webby1
02-25-2011, 10:04 PM
Hi Everyone,
I am new to this forum, and it looks like the most interesting place to ask this question. I am trying to come up with an easy instant price quote calculator in javascript for a blinds website i am creating like this one here;
http://www.blindsuk.net/
it would be a simple one with only 3 - 4 fields. Basically it would be imput of width and length measurements to get a price based upon the measurements typed in.
such as;
1) Width in mm
2) length
3 ) price
4) button to calculate total
Does anyone know of such a script that i could use or simplify to accomodate these actions?
Thanks
it depends entirely on how the price is calculated, and that is something we can't answer. Is it priced per linear foot? square foot? are there per piece charges? without that information, there's no way we can help.
computer scripts understand math really well, so if you know the formula needed to find the price, you can certainly write a script that can do it too.
djr33
02-27-2011, 12:53 AM
In fact, if you can just post the formula in the most formal way possible, we can probably easily help. However, try to avoid any specific terms for your field in case they might not be known to us.
webby1
03-03-2011, 11:10 AM
Thanks very much for your imput, the price is calculated solely by set measuremenst for example
Width and length = price
So i guess i would have to add in the varying widths lengths and get the set price for this quote is this correct?
As a example:
Width is 1220mm and selected length is 1370mm then the price is set to come out then at £19.92
This would be the type of script i am looking to create and add the varying 3 major imputs in to get the final price.
what does "and" mean in your calculation? do you mean:
width plus length
width multiplied by length
width multiplied by length multiplied by a price factor
...?
from your example, I don't see how you got your price. Can you show the actual math involved?
webby1
03-20-2011, 03:34 PM
Thanks for trying to help and i may of not made it clear enough with being not so much of a pro coder or similar.
I have a set number of preset figures of widths lengths and prices to be placed into a script and anything placed in by the client would come out to the next nearest width and length, if not exact measurements as i have set.
As an example
Client types in box his width and length desired to get his price
Width.... is set at 48"
Length..... is set at 66"
Price comes out at a set £24
The price set for these figures would have to come out at the set price of £24
If client typed in width of 46" and length of 62" the price would have to come out to the next nearest figure which in this example above is £24
djr33
03-20-2011, 07:05 PM
That's still not a mathematical formula. Are you saying that there is no math in this? You just make a list (1x2=7, 4x5=20, ...) and then you want the computer to figure out based on the available dimensions which one is closest to what the user input?
The logic on that is the following:
Find the smallest item in the list with height and width both greater than or equal to the input.
Is that correct?
webby1
03-21-2011, 03:26 PM
Hi djr,
Thanks for your reply with my query.
There wouild be maths involved yes in the equation.
for instance there would have to be laid out sets of dimensions such as:
in the width there would have to be a variable from 915mm to 3200mm
and the length would have to be variable again from 600mm to 2900mm
So those would be the parameters and when a client places in their measuremenst they would then a get a price output.
The last equation is getting the price from a set rule of 15 price variables.
Hope this clarifies what i am trying to accomplish and why i need some advise.
djr33
03-21-2011, 05:28 PM
I think that makes sense now. What language do you want to use? Javascript will operate within the user's browser and is in some ways a little easier to setup than other methods, but it requires that Javascript is available (enabled, compatible) in the user's browser. A method using a serverside language like PHP is more reliable, slightly harder to setup (since it requires PHP on the server, etc), and would require reloading the page to process the form.
But PHP (or another serverside language) will be required if you intend to make this functional beyond a quote-- if you want this to be added to a shopping cart, for example.
The basic steps will be this:
1. Create an array with three items in each index: width, height, price.
2. From the user's input, find a price such that its height and width are greater than or equal to the user's input.
3. Display that price for the user.
webby1
03-23-2011, 10:47 AM
Thank you ever so much as this makes it so clear thanks again
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.