• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Building Onlineshop with different pricing for each customer

 
Peter Irmstadt
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I am currently working on a specialized web shop for a customer. He will upload a list of articles with a basic pricing. Now he wants to be able to edit the price of each article for each customer. For example: The price of 'Article 1' is $ 5.00. He wants to set the price for 'Customer 1' to $ 4.50 and the price of 'Customer 2' to $ 5.60. The price of that article for all other (created) customers will be the initial $ 5.00.

I want to create the shop using seam and EJB using Hibernate. But I'm not quite sure what the best way might be to realize that by reducing potencial overhead and needless database querys.

What would you propose?

Thank you in advance!
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there isn't a fixed discount -absolute or relative- for each customer, then it would seem to you need a customerID to go along with each price.

Or you could have a table with the base prices (key articleID), and then another table that overrides it as needed (with keys articleID and customerID).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic