You need a user database in something like MySQL or PostgreSQL that has information about purchases, payments, etc., and you need a server-side scripting language to interact with it -- PHP, Perl, Python, etc.
Once a user logs in, you use the SSSL to retreive data from the DB and propgate their account with HTML. Then you set up a secure connection with the SSSL, likely SSL, allowing for secure online purchases. The shopping cart is just a bit of work with the DB and scripting language.
My recommendations:
http://php.net/
http://dev.mysql.com/