Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
E-commerce Database design: Products with optional variations and scaled prices

For a client, I'm trying to build a minimal e-commerce system. It's going to have products which may have variations (think S, M, L) and every variation may have a scaled price system depending on the amount the client orders:

  • 1 shirt, size L = 10 EUR each
  • 5 shirts, size L = 9 EUR each
  • 1 shirt, size S = 8 EUR each
  • 5 shirts, size S = 7 EUR euch

But there may also be products without variations and a fixed price:

  • n pullovers = 50 EUR each

And products which have no variations but a scaled price system:

  • 1 trouser = 100 EUR each
  • 5 trousers = 90 EUR each

I was thinking about the following db schema:

products

  • id
  • description
  • ...

product_variations

  • id
  • product_id
  • variation_id (table with all possible variations: color, size, etc.)
  • value (l, m, red, green)

product_prices

  • id
  • product_id
  • product_variation_id (can be null, if the price is for the product, not a variation)
  • priceNet
  • tax
  • qualify_amount (minimum number of items the customer has to order to qualify for this price, defaults to 1)

Is it okay to make product_variation_id nullable to achieve the wanted flexibility in combinations between prices and variations without having to add at least one (standard) variation for every product (when the product doesn't have variations)? Any better ideas? :)

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!