Hi Guillermo,
You can check out these php open source solutions. I'd recommend browsing thru the demo stores, checking out the user forums/communities and seeing what works for you. You may decide that one already has everything that you need, or if you really want to do it from scratch you'll get some great ideas.
After browsing around and checking out the interfaces and how active the communities are, install your top 2-3 and run them on your development machine to really test them out and get more ideas.
Since it's all open source, you can see their code, check out their SQL, and do whatever you want with it.
Good Luck!
osCommerce
PrestaShop
Ubercart
VirtueMart
Zen Cart