
June 1st, 2003, 09:25 AM
|
|
Contributing User
|
|
Join Date: Oct 2002
Location: Washington, DC
Posts: 317
Time spent in forums: 2 m 3 sec
Reputation Power: 6
|
|
Quote:
or give me an idea on how I could possible write one to suit my needs |
Certainly. Lets go on what you posted and use custom systems as an example. First, we will examine a sample table structure:
Code:
Table: products_base_systems
id | sku | base_price | title | description | etc | etc
--------+---------+----------------+-----------+-----------------+---------+---------
1001 | 523-69 | 699.99 | computer | something | |
--------+---------+----------------+-----------+-----------------+---------+---------
1002 | 423-39 | 999.99 | computer | something | |
--------+---------+----------------+-----------+-----------------+---------+---------
Table: products_upgrade_options
id | option_id | base_id | option_price
--------+---------------+-------------+---------------
1 | 32 | 1001 | 79.95
--------+---------------+-------------+---------------
2 | 33 | 1001 | 29.95
--------+---------------+-------------+---------------
3 | 34 | 1001 | 19.95
--------+---------------+-------------+---------------
4 | 32 | 1002 | 69.95
--------+---------------+-------------+---------------
5 | 33 | 1002 | 24.95
--------+---------------+-------------+---------------
6 | 34 | 1002 | 19.95
--------+---------------+-------------+---------------
Table: products_hardware
id | sku | price | title | description | etc | etc
--------+---------+-----------+-----------+-----------------+---------+---------
32 | 963-56 | 156.50 | memory | 512 meg DDR | |
--------+---------+-----------+-----------+-----------------+---------+---------
33 | 953-46 | 72.50 | memory | 256 meg DDR | |
--------+---------+-----------+-----------+-----------------+---------+---------
34 | 943-36 | 42.50 | memory | 128 meg DDR | |
--------+---------+-----------+-----------+-----------------+---------+---------
Ok - the products_base_systems holds the system information. This is the table you will draw the information from to display the information to the user - product images, description, price, details, etc. will come from this table.
To get your available upgrade options for each of these systems, you would draw the information from the products_upgrade_options table. If you study the structure of this table, you will see the linkage to the products_hardware table where the information for each upgrade option (except the upgrade price) resides.
Once the user selects the available options, it is a matter of building the query to retrieve all of the data and summing it up to show the new price with all the relative information...
__________________
~ Joe Penn
We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?
Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.
|