Page 2 of 2

Posted: Sun Jun 25, 2006 6:14 pm
by tecktalkcm0391
arborint wrote:
tecktalkcm0391 wrote:Ok, now I have another question... Would I just do something like select * from items where location='shop'
and then see how many rows come up to show the quanity.
Are you asking "how do I get the number if items that have the same shopid?"
tecktalkcm0391 wrote:How would I have the user "buy" the item. and then make the owner the username of an item in the cart without having two user "get" the same item, but only the first one gets it.
By "buy" do you mean add to a cart or purchase at checkout?

What does "make the owner the username of an item" mean?

When you ask "without having two user "get" the same item, but only the first one gets it.", does "get" mean the same as "buy" above?

And when you say "the same item," we would need to know if each item/SKU is a unique thing for sale, or do they have a inventory quantity?
Ok, sorry for the "buy" and "get" just read them as buy and get, i just have them in quote because the user doesn't really get the items in life the just get them for the site. See they use points on my site to get items for their account.

Each item as a different number because each item can be traded or sold to another use so I can't just have 300 eggs with the same id, cause how would the database know which item goes to who, and it would just be more confusing in my view of it.
aerodromoi wrote:
arborint wrote: And when you say "the same item," we would need to know if each item/SKU is a unique thing for sale, or do they have a inventory quantity?
Looks like the former, as each book has a unique id.

Personally, I wouldn't use the unique id approach, as it only comes down to using more database space than actually necessary.

aerodromoi
I really don't care how big the database is, but how would I do it without the database?

See my goal is to have a shop that brings out the items (like below) (expept there is a picture on top). When they click on the picture, it gets added to their cart if they have enought money (on there account), and if they don't it displays a message. If they do it goes in there cart then the number of items in stock goes down 1, and it just shows the shop page (like below) still. After they are finished shopping they pay. And they get their items, which they have to use, trade, or sell. ( I don't need help with that for now). I just need to have it so that the shop can tell what is for sale, what items users have in there cart, and which items are owned by users, and which user it is.

Book 1
43 in stock
Cost: 540


Icecream
25 in stock
Cost: 742


Jelly
20 in stock
Cost: 481


Cookie
27 in stock
Cost: 1,281



Pizza
22 in stock
Cost: 963


Milk
38 in stock
Cost: 208


Eggs
28 in stock
Cost: 193


Soda
8 in stock
Cost: 446
How would I do this! Please please please help! :( :( :( :( I am desprate to figure out how to do this to work.

Posted: Mon Jun 26, 2006 1:00 am
by aerodromoi
tecktalkcm0391 wrote: Each item as a different number because each item can be traded or sold to another use so I can't just have 300 eggs with the same id, cause how would the database know which item goes to who, and it would just be more confusing in my view of it.
Suppose you're selling eggs over the net. All eggs should be roughly of the same size, the same colour and more or less fresh. Apart from that, it doesn't matter which egg goes where, as long as every customer gets the quantity of eggs he or she has ordered.

Unless you're selling customised computers etc. unique ids don't make sense.
tecktalkcm0391 wrote: I really don't care how big the database is, but how would I do it without the database?
You'll always need a database (irrespective of its type). We're only trying to show you a more efficient approach to use it.

tecktalkcm0391 wrote: See my goal is to have a shop that brings out the items (like below) (expept there is a picture on top). When they click on the picture, it gets added to their cart if they have enought money (on there account), and if they don't it displays a message. If they do it goes in there cart then the number of items in stock goes down 1, and it just shows the shop page (like below) still. After they are finished shopping they pay. And they get their items, which they have to use, trade, or sell. ( I don't need help with that for now). I just need to have it so that the shop can tell what is for sale, what items users have in there cart, and which items are owned by users, and which user it is.
How would I do this! Please please please help! :( :( :( :( I am desprate to figure out how to do this to work.
That's why I posted the snippet. It's only a framework without a database access, but it covers the most basic principles of a shop: Adding articles to a shopping cart, putting them back on the shelf and showing the total number of products for sale.

aerodromoi

Posted: Mon Jun 26, 2006 1:20 am
by tecktalkcm0391
Ok, well the users aren't acutally getting the item in person, its going to be for site only stuff. Like a person buys an egg on my site, then feeds it to himself (on the site). Do you get what I am getting at? See I can't just have ununique ids because then I couldn't do trading, and auctions (what I am aiming for later).

I've looked over the example again (found somethings I looked over), and it's pretty helpful. Thanks. :D

Now I just need to get this down to what I need it to be, if anyone wants to post anything, THANKS!, otherwise i'll work on it for a few days, then post what I have.

See you all on here in the future :lol: :lol: , and thanks for the help. :D

Posted: Mon Jun 26, 2006 1:34 am
by Christopher
tecktalkcm0391 wrote:See my goal is to have a shop that brings out the items (like below) (expept there is a picture on top). When they click on the picture, it gets added to their cart if they have enought money (on there account), and if they don't it displays a message. If they do it goes in there cart then the number of items in stock goes down 1, and it just shows the shop page (like below) still. After they are finished shopping they pay. And they get their items, which they have to use, trade, or sell. ( I don't need help with that for now). I just need to have it so that the shop can tell what is for sale, what items users have in there cart, and which items are owned by users, and which user it is.
If each item is unique then its row key is essentially its SKU. I would add a column to the item record that was called status or something like that. When someone buys that thing the status column is marked as "sold" so it does not show up when others view the list of available (unsold) items.

If you want a shopping cart then you may need more status values, one for "on hold" and one for "sold". If someone puts an item in their cart you update the status field in that record as "on hold". If they delete it from their shopping cart you set the status back to "available". If they purchase it your set it to "sold". You may need to sweep the items table once a day and clear all "on hold" items from abandoned shopping carts. You'd probably need a timestamp in the item for that.