| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9
Comments:
<0> I was just hoping there was a shorthand. <0> if (mysql_num_rows == 0) {} <0> I'm kind of a bit rusty on php. <0> It's been a while since I've coded anything substantial. <1> writing this shopping cart.. a design question, lets say I have this item, and 2 different size has different price. so far I only had one single price per item, so when they add it to the cart I was just adding it to the cart table
<1> my backend may not be designed well for this situation.. what wud u recommend for the cart table design <2> ganjakhor i'm not sure i understood, but i'll try .. you have the same item, with 2 sizes, each size has its own price? <1> yes <2> is there any "math" you can relate for that size ? cause if its not related to the original price, you have no other choice then give it to the database. <1> right now when users were adding stuff.. I would just put them in a temporary cart table.. for 2 different price I can add 2 rows with different price <1> oik no math formula here <2> i dont understand, if you have the same item, with 2 sizes, and 2 prices, how does the shopping cart currently know to add the alternative price ? <3> normalize it? <1> oik.. the way it was written.. I never had 1 item with 2 different price or size.. lets say you're selling this ticket.. for adults it's $15 for children it's $10 <3> make a price_options table or something <3> product_id | option | price <1> the way products are getting added.. they have the same productid but option and price are different.. <2> so tryout what evulish_ suggested <2> have another table with the special prices, like, "itemid=123" "size="child" "price=10" <1> I'm just not sure how I shud add them to the cart.. add 2 rows for 2 sizes <1> my cart is a temporary table where I store anything that the users adds <2> ok, so when the user add id=123, size=child. add its size preference <1> right now in the cart table I have item_id, price, quantity, cookie_id
<2> add "size" field :) <1> oik: fine.. I add a size field.. so if I add 2 of size 1 and 2 of size 2 I add 2 rows <1> I was just thinking if there's a better way of doing it <2> well, i'm sure there are other ways to do it, i dont know if they are any or much better <4> why not just create a table with the item id / sizes / price? eg: item_num | s | m | l | xl | xxl | price <2> lets say you could had X fields of sizes, like: fields: child parent, grandpa <4> well, price would be under the respective size <1> actually what I can do.. I can add 2 quantity fields and 2 or more size fields <3> that'd **** if you wanted to keep track of inventory <0> ! <1> you see... al the products are coming from a different db.. I don't have any control over that <1> I'm just trying to create this interface to sell items <2> well man, you already said the original idea would work, so i dont understand why you look for a different one? <1> I can query those tables to get product info.. display them.. <1> just brainstroming <2> well, you can add another row, and you could have each row with all the available sizes, i guess both would work, i personally would prefer method #1 <1> if they only have 2 size or 2 different price (that's what they have for now) I can get away with 1 row.. just add 2 more fields <2> ok :) <1> now time for some ganja
Return to
#php or Go to some related
logs:
#india #chat-world #allnitecafe #allnitecafe #php #allnitecafe #linux toothpast+iodide
#india #php
|
|