Hi Chris,

Your problem seems simple enough, though I know a lot of thinking has to go
in the design to implement it. From what I can see, here are my thoughts.

 Have the system calculate the price of the system as-is when the page first
loads, i.e. default computer . You would probably be adding all the
pre-selected item prices, based on each item's item_id. So, when a user hits
reconfigure, have the query add the new item prices - again based on the
item_id. I don't think you woul dhave to worry about calculating differences
or anything.
e.g.
Default PC:
Item_name            Item_id        item_price
=======            ======        =======
Pentium II 400       3                     $200
64MB RAM          4                    $60
10 GB HD             8                     $100
=============================
total                                            $360
the SQL would be like this:

select sum(item_price) as totals
from items
where item_id in ( 3, 4, 8)

New PC:
Item_name            Item_id        item_price
=======            ======        =======
Pentium III 800      9                    $500
128MB RAM        5                    $120
10 GB HD             8                     $100
=============================
total                                            $720
the SQL would be like this:

select sum(item_price) as totals
from items
where item_id in ( 9, 5, 8)

since you item_id would be coming from a form, you could populate the WHERE
clause dynamically i.e. where item_id IN (#form.item_id#)

Hope that helps

Hassan

----- Original Message -----
From: Chris Farrugia <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 27, 2000 2:44 PM
Subject: Custom Configure a PC page for my site


> I am making a page on my site where users can custom configure a new PC.
> There is a form with drop down boxes where they choose the processor, RAM,
> hard drive, etc, and then hit a submit type button.  For processor, the
> choices might be:
>
> Pentium III 700mhz
> Pentium III 600mhz (subtract $100)
> Pentium III 500mhz (subtract $175)
>
> Once all of the choices are made, they click on a "submit" type of button
> and it takes them to a page that shows them their choices and gives them a
> price.  All of the products and prices used to populate the form are
coming
> out of a database of products.  Now, lets say that they don't like the
price
> they get...  they can hit a button "Re-Configure" and go change the form
and
> resubmit it.  When the system is exactly the way they want it, they can
> click an order button and the system is theirs.  With this overview, here
> are my questions:
>
> 1.  When they click on a machine to custom configure (such as an office
> machine), there will be certain products already chosen in the form as a
> standard.  For instance, an office machine might start iwth a Pentium III
> 600 with 64mb of ram, but they'll be able to increase or decrease these
> specs to make it better suite their needs and budget.
>
> 2.  I don't know how I am going to have the database calculate the
> difference in price between the default product (the one that is
preselected
> in the form), and the others that they can choose from.
>
> 3.  If they hit reconfigure, how will I have it now show the products they
> chose the first time around as the new default options in the drop down
box?
>
> If I could get answers to these three questions, I would be able to finish
> my site.  Thank you for all of your help.
>
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to