joined:Dec 2, 2003
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
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