I have a shopping cart project that I am putting together. I am able to combine items and get the correct price, however the quantity does not show up as to how many of the same item is being bought. Here is my code. Any suggestions wold help out this newbie... not sure what I am doing wrong...Thanks! class Basket attr_reader :purchases attr_reader :total def initialize @purchases = [] @total = 0.0 end def add_purchase(cart) @purchases << Purchase.buy_one(cart) @total += cart.price end def add_purchase(cart) appendFlag = true for purchase in @purchases if (cart.id == purchase.cart.id) appendFlag = false purchase.quantity += 1 end end if(appendFlag) @purchases << Purchase.buy_one(cart) end @total += cart.price end def clear @purchases = [] @total = 0.0 end end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---