Sale products, how can I compute total price?

the problem is the customer buy product A and get a price, then he ask for some information about another product B, buy product B and get a price too, how can i compute total price? how can the program remember the previous price of product A?

Did you have a look at custom actions?