Wish List Database
I am trying to create a Wish List for my website but I have run into a little wall.
I understand from reading some of the other posts that I need to create a new Database Table that will store the product info and user info instead of pulling the info from the Database as in the case with the Add To Cart button.
My problem comes in that I have more than one Table in my Database where some of the products contain the same Product Id. The difference comes in the Description of each product so they are unique in their own way. I thought about this and came to the conclusion that to store the info in the Wish List Table I will have to assign a different ID to the products.
Up to here I am still ok my PROBLEM is that say I have a Table Called ProductsFruit and another Table called ProductsVeg. Now in Table ProductsFruit the first item is Apples with ID1, selling at $1.00. In Table ProductsVeg the first item is Carrots with ID1 selling at $1.20.
The client then adds 1 unit of Apples and 2 Units of Carrots to the Wish List. In the WishList Table the Carrots and the Apples are assigned new ID's because there can't be two ID1's, the Clients ID is saved and the Product Details are stored. Now if say tomorrow the Apples become $1.10 or even sells out, how will the data in the Wish List be updated?
How do I set the Wish List when a customer logs in to get the correct info from the correct table to find out if the price is still the same or if the product has maybe been sold out in the mean time? I can see how this will work if you are using only one table but I am not sure how to do this with different tables especially if the Product ID has to change when inserting products into the Wish List. I have about 20 Tables in my Database as each Table represents a different Company we sell products from.
Thanks for any help and advice.