I Need Help

drumthrasher

Fully Optimized
Messages
2,606
Its not really help, I pretty much need someone to do something...

I need a script, a computer configurator, where the customer can customize their PC and it can automatically subtract/add the prices based on what they want, and maybe at the bottom they can see the total combined price, then they can choose to buy it.
 
If I can find the script, (or I might just make it again). I have on of this made already in javascript.

I'll see if I can find it and get back here
 
Dude that would be great!

Also is it easily customizable? Could I put pictures for each option?
 
Here is one example. -for quickly pricing up systems.

this is OK for a quick shop, assuming all the prices have different values, when they press buy it'll be the prices that are passed to the next page.

a better example would involve some lookup tables in the script for the prices, that way the component names will get passed to the next script.

I'll have a little work at one of those now.


Code:
<html>
<head>
<script type="text/javascript">
function update()
{
var total, mainboard, processor, ram; //declare variables (1 for each component)

mainboard = document.form1.mainboard.value * 1; //get the selected values from the HTML form
processor = document.form1.processor.value * 1; //*1 to ensure string is recognised as a number not var
ram = document.form1.ram.value * 1;

total = mainboard + processor + ram * 1; //add all the values together as numbers

total = Math.round(total*100)/100; //round to make sure accuracy is 2 decimal places for currency

document.form1.price.value=total; //update the total box


}
</script>
</head>
<body onload="update()">

<form name="form1">
Chose your components
<br /><br />
<select name="mainboard" onchange="update()">
<option value="54.60">Mainboard 1</option>
<option value="32.67">Mainboard 2</option>
<option value="32.68">Mainboard 3</option>
<option value="78.90">Mainboard 4</option>
</select>
<br />
<select name="processor" onchange="update()">
<option value="50.00">Processor 1</option>
<option value="75.00">Processor 2</option>
<option value="80.00">Processor 3</option>
<option value="110.00">Processor 4</option>
</select>
<br />
<select name="ram" onchange="update()">
<option value="20.00">RAM 1</option>
<option value="20.00">RAM 2</option>
<option value="25.00">RAM 3</option>
<option value="30.00">RAM 4</option>
</select>


<br />
Total Price : <input type="text" name="price" />

<input type="submit" value="Buy!"


</form>
</body>
</html>

the example with lookup tables is as follows.

Code:
<html>
<head>
<script type="text/javascript">
function update()
{
var total, mainboard, processor, ram; //declare variables (1 for each component)

mainboard = document.form1.mainboard.value; //get the selected values from the HTML form
processor = document.form1.processor.value;
ram = document.form1.ram.value;

if (mainboard=="m1") { mainboard=32.50; }
if (mainboard=="m2") { mainboard=36.57; }
if (mainboard=="m3") { mainboard=65.00; }
if (mainboard=="m4") { mainboard=75.50; }

if (processor=="p1") { processor=34.62; }
if (processor=="p2") { processor=45.67; }
if (processor=="p3") { processor=65.67; }
if (processor=="p4") { processor=85.67; }

if (ram=="r1") { ram=54.60; }
if (ram=="r2") { ram=56.67; }
if (ram=="r3") { ram=65.67; }
if (ram=="r4") { ram=78.67; }

mainboard = mainboard * 1;
processor = processor * 1;
ram = ram *1;

total = mainboard + processor + ram; //add all the values together as numbers

total = Math.round(total*100)/100; //round to make sure accuracy is 2 decimal places for currency

document.form1.price.value=total; //update the total box
}
</script>

</head>
<body onload="update()">

<form name="form1">
Chose your components
<br /><br />
<select name="mainboard" onchange="update()">
<option value="m1">Mainboard 1</option>
<option value="m2">Mainboard 2</option>
<option value="m3">Mainboard 3</option>
<option value="m4">Mainboard 4</option>
</select>
<br />
<select name="processor" onchange="update()">
<option value="p1">Processor 1</option>
<option value="p2">Processor 2</option>
<option value="p3">Processor 3</option>
<option value="p4">Processor 4</option>
</select>
<br />
<select name="ram" onchange="update()">
<option value="r1">RAM 1</option>
<option value="r2">RAM 2</option>
<option value="r3">RAM 3</option>
<option value="r4">RAM 4</option>
</select>


<br />
Total Price : <input type="text" name="price" />

<input type="submit" value="Buy!"


</form>
</body>
</html>

Now, the user see's the price, and when they press buy you are sent a list of component choices, (m1, p4,r3 mainboard1, processor 4 and ram choice 3 for example).

I guess the only thing left to do for this script is write it in an active lanagage (php/asp etc) so that it pulls data from a database rather than having to edit to script on the webpage to update prices.

and have the choices get filtered so that you have an inteligent script that won't let you match an intel processor to a mainboard with an AMD socket of something.




edit - yes, you can add pictures to the site, it's just plain HTML with javascript.

if you wanted to get really clever you could write custom drop down menus in javascript that actually have the pictures of the components on them.
 
Well, I couldn't be bothered to do the active page stuff that goes along withit...


though I did revise the script to include a games machine rating score that colours a little bar...

here's the code
Code:
<html>
<head>
<script type="text/javascript">
function update()
{
var total, mainboard, processor, ram; //declare variables (1 for each component)
var mgscore, pgscore, rgscore, gamescore; //new vars for gaming scores


mainboard = document.form1.mainboard.value; //get the selected values from the HTML form
processor = document.form1.processor.value;
ram = document.form1.ram.value;

if (mainboard=="m1") { mainboard=32.50; mgscore=1; }
if (mainboard=="m2") { mainboard=36.57; mgscore=2; }
if (mainboard=="m3") { mainboard=65.00; mgscore=1; }
if (mainboard=="m4") { mainboard=75.50; mgscore=3; }

if (processor=="p1") { processor=34.62; pgscore=0; }
if (processor=="p2") { processor=45.67; pgscore=1; }
if (processor=="p3") { processor=65.67; pgscore=3; }
if (processor=="p4") { processor=85.67; pgscore=3; }

if (ram=="r1") { ram=54.60; rgscore=1; }
if (ram=="r2") { ram=56.67; rgscore=1; }
if (ram=="r3") { ram=65.67; rgscore=2; }
if (ram=="r4") { ram=78.67; rgscore=2; }

mainboard = mainboard * 1;
processor = processor * 1;
ram = ram *1;

mgscore = mgscore * 1;
pgscore = pgscore * 1;
rgscore = rgscore * 1;

total = mainboard + processor + ram; //add all the values together as numbers

score = mgscore + pgscore + rgscore;

total = Math.round(total*100)/100; //round to make sure accuracy is 2 decimal places for currency

document.form1.price.value=total; //update the total box

//reset scoreboard
document.getElementById('game1').style.background = "white";
document.getElementById('game2').style.background = "white";
document.getElementById('game3').style.background = "white";
document.getElementById('game4').style.background = "white";
document.getElementById('game5').style.background = "white";
document.getElementById('game6').style.background = "white";
document.getElementById('game7').style.background = "white";
document.getElementById('game8').style.background = "white";
document.getElementById('game9').style.background = "white";
document.getElementById('game10').style.background = "white";

if (score>="1") {
document.getElementById('game1').style.background = "lightgreen";
}
if (score>="2") {
document.getElementById('game2').style.background = "lightgreen";
}
if (score>="3") {
document.getElementById('game3').style.background = "lightgreen";
}
if (score>="4") {
document.getElementById('game4').style.background = "lightgreen";
}
if (score>="5") {
document.getElementById('game5').style.background = "lightgreen";
}
if (score>="6") {
document.getElementById('game6').style.background = "lightgreen";
}
if (score>="7") {
document.getElementById('game7').style.background = "lightgreen";
}
if (score>="8") {
document.getElementById('game8').style.background = "lightgreen";
}
if (score>="9") {
document.getElementById('game9').style.background = "lightgreen";
}
if (score>="10") {
document.getElementById('game10').style.background = "lightgreen";
}

}

</script>

</head>
<body onload="update()">

<form name="form1">
Chose your components
<br /><br />
<select name="mainboard" onchange="update()">
<option value="m1">Mainboard 1</option>
<option value="m2">Mainboard 2</option>
<option value="m3">Mainboard 3</option>
<option value="m4">Mainboard 4</option>
</select>
<br />
<select name="processor" onchange="update()">
<option value="p1">Processor 1</option>
<option value="p2">Processor 2</option>
<option value="p3">Processor 3</option>
<option value="p4">Processor 4</option>
</select>
<br />
<select name="ram" onchange="update()">
<option value="r1">RAM 1</option>
<option value="r2">RAM 2</option>
<option value="r3">RAM 3</option>
<option value="r4">RAM 4</option>
</select>

<br />
Total Price : <input type="text" name="price" />

<input type="submit" value="Buy!"
</form>
<br />
<br />
<table cellspacing="0" border="0">
<tr>
<td>Gaming suitability : </td>
<td>0</td>
<td width="20" height="20" id="game1"></td>
<td width="20" height="20" id="game2"></td>
<td width="20" height="20" id="game3"></td>
<td width="20" height="20" id="game4"></td>
<td width="20" height="20" id="game5"></td>
<td width="20" height="20" id="game6"></td>
<td width="20" height="20" id="game7"></td>
<td width="20" height="20" id="game8"></td>
<td width="20" height="20" id="game9"></td>
<td width="20" height="20" id="game10"></td>
<td>10</td>
</tr>
</table>
</body>
</html>

OK. so sprucing up the look of it is clearly something that needs to be done. but I'm not sure as I'll bother doing that since it'll really depend on how your page looks as to what how and where you'll want things...


if you want anything included then let me know and I'll see if I can extend the javascript or HTML to be more useful.

drumthrasher, that page is down... but I love the custom 404 message.
 
Back
Top Bottom