views:

117

answers:

3

Basically I am writing a simple shopping cart. Each item can have multiple prices. (i.e. shirts where each size is priced differently). I would like to have a single price field in my admin panel, where when the first price is entered, an additional price field pops up. However I am kind of at a loss as to how to do this. What would be the best way to do this?

A: 

You probably want inlines and some javascript.

rz
+1  A: 

Sounds like you want two related models - Item and Option. Item would contain the name of the item, and Option would contain the option - eg size - and the price of that option. You would then set up your admin to use an inline form for Option.

Daniel Roseman
A: 

You might try checking out the Satchmo codebase. It has something similar that may provide some inspiration. http://satchmoproject.com

RJBrady