Welcome to WebmasterWorld Guest from 54.167.144.170

Forum Moderators: open

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

   
11:48 pm on Sep 16, 2012 (gmt 0)

10+ Year Member



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.

Example:

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
 

Featured Threads

Hot Threads This Week

Hot Threads This Month