Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Package Deals
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00233134
Message ID:
00233143
Views:
30
Ron,

What you have is a many-to-many relationship. Each package can have many items and each item can be in many packages. You should probably create two tables to keep track of the packages. One would be a package header table and one a package detail table. Package header would have a package ID, package description, package price, and any other fields that are specific to the package. The detail table would have one record for each item in the package. It would contain the package ID and the item ID.

Alternatively, you might want to use the item table for the package header records. So you could have an item called "Package 1" that was made up of four items. You would add a record to the item table with "Package 1" as the description. Then, the package detail table would have one record for each item in the package. Each record would have the item ID of the package record and the item ID of one of the items contained in that package. You'll probably also need a field in the item table to indicate that an item is actually a package.

It's a bit complex, but it gives you full flexibility to set up any number of packages each with any number of items.

>Im trying to create a program that I can offer package deals for items that are ordered, but not hard code them into the program itself. I have a table set up with product codes, not all the codes are part of a package and some can be part of more than one package.
>
>Example:
> prod1 when ordered by itself is $25.00
> but when ordered with 3 other items its a flat $40.00
> and then $10.00 each for any additional item up to 6 items.
>
>I would like to set this up so that it doesnt have to be programmed in, but just added as other package deals are offered.
>
>Im at a loss as to how to set up something like this, any ideas that could send me in the right directions would be greatly appreciated.
>
>Thanks
>Ron
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform