Search code examples
mysqldatabasedatabase-designe-commerce

Database Modeling: Shipping Rules


I'm working on an e-commerce type web application and need to somehow handle calculation of shipping costs. Some rules I've found:

  1. Free shipping
  2. Free shipping with minimum purchase
  3. Free shipping within a certain geographic area
  4. Flat rate shipping
  5. Flat rate + set amount per product
  6. Various rates depending on speed of shipping (shipped immediately and/or how soon it gets to customer)
  7. Based on height, width, depth, weight + shipping distance
  8. Based on rates of various shippers

... and so on.

Any suggestions how to tackle such a problem?


Solution

  • I suggest you take a look at some available open source ecommerce solutions. There are a LOT of them and each one takes a stab at doing exactly what you are trying to do. If it is schema design you are after I wouldn't limit your searches to just MySQL - as long as it contains a relational database it should be easy to dig into the design. I'd take a look at nopcommerce to name just one...