homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

Implementing complex pricing logic in php/mysql - decision tables?

10+ Year Member

Msg#: 4496049 posted 11:48 pm on Sep 16, 2012 (gmt 0)

How would one go about creating a php/mysql pricing system in which complex pricing rules (ie discounts, extra charges) for each product can be stored and executed most efficiently? Key thing is also scalability.

I understand adding a few rules in PHP programming logic will solve things, however such a system requires constant development (to continue adding new rules when they appear) usually creating a bottleneck.

Then I stumbled across something called "decision tables" according to a post here - [jonathanlevin.co.uk ]

Would something like this fulfill the requirements for me or do you see anything else suiting this task better? Key thing for me is ability to quickly add rules and scale the system indefinitely without slowdowns. Ability for non-developers to modify rules themselves is also required.


Product A Cost $100
Discount Rules:
Jan - Mar 10% off
Mar - Apr: 5% off if > 2 items purchased
-$10 if buyer spent $1000 in past

Extra Charge Rules
If customer in europe + $50 shipping
If customer in usa + $10 shipping
If something = 'bananas' add 5% charge


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved