Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

The organization I work at has some interesting requirements when it comes to pricing for online commerce. Currently the developers write different 'pricing rules' and those rules can be applied to our items based on attributes of the items.

For Example:
INPUTS: [cost, sug_retail, discontinued, warehouse_qty, orderable_qty, brand, type, days_available, shipping_rate, weight, map_protected, map_discount]
MATCH: brand=x, warehouse_qty > 1, discontinued=True, map_protected=False
SET: retail_price = (sug_retail * 0.95), offer_price1 = (cost * 1.25 + shipping_rate)

I am looking to allow the merchandising team to have more control over the pricing and formulas - they are afterall technical enough to write excel formulas.

I've been looking at writing a desktop application that uses something like numexpr http://code.google.com/p/numexpr/ or http://sympy.org/en/index.html to allow non-programmers to integrate their own logic into our pricing backend.

We have multiple price-tiers we have to set, for multiple markets, so an elegant solution is needed. It's getting frustrating for the dev team to continually tweak/manage all of the pricing rules (we sell over 200 brands in 3 markets).

My question is; does this seem like a decent approach? Can you think of a better way to parse string-mathematical-grammer? Can you think of a different way for users to provide formula's to integrate into a automated pricing system? Does anyone know of any examples of existing applications that do this?

Excel, and Access are out of the question - the volume of data we manipulate has already proven the need to automate it - now we just need some visibility into that automation.

share|improve this question
1  
Be carefult about this. Consider what happens if you use a formula, sell items based on it, change the formula then you get some retruned items back. How would you figure the cost of returned items? Your data model has to be robust. This is also essential for book keeping and accounting. You have to be able to keep history of pricing formulas and identify which item was sold under which pricing formula. –  Emmad Kareem Dec 14 '11 at 8:42

2 Answers 2

up vote 2 down vote accepted

For E-Commerce organizations agility is at the core of business efficiency. Being ready for the ever-changing market and keeping pace with business requirements is more challenging and requires that careful selections be made in the development of user-configurable programs.

Configurable programs incur a great risk to the organization if they do not implement, limit, expose business logic properly as to keep configuration inline with business constraints.

There are good examples of configurable commerce solutions, the solutions are generic but offer a good suite of features for consideration. IBM's WebSphere Commerce Feature Pack 2 features this type of configurable integration. http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp?topic=/com.ibm.iea.wcs/wcs/7.0.0.2/BusinessUI/PriceRuleOverview/player.html

The rate of expected change at most E-Commerce companies requires areas of the Enterprise Architecture to be extremely stable, and configurable. Pricing is unfortunately one of those areas, and without at least IT-Configurable rules, keeping pace with day-to-day changes is impossible.

Having a single algorithm for pricing management becomes more suspect when you think about change-based updates. When a master algorithm is updated, it means that ALL inputs, outputs, and intermediate variables must be recalculated even if the changes to the algorithm only affect 10% of the data set. This fact alone suggests it is a flawed approach, and something more horizontally scalable must be considered.

From a business perspective the lost opportunity cost of turning our backs on highly customizable and accessible pricing routines is also unacceptable.

share|improve this answer

I think its bad idea, for the simple reason that I don’t think your merchandisers are smart enough to do this right. They are going to make conflicting rules; they are going to need a utility to mass assign a rule to items based on criteria. And the criteria used to assign the rule should have been part of the rule to begin with. It’s just going to get messy. (Then one day the site will sell 400 90 inch plasma TVs @ $20 a piece, management will flip out that the merchandises was able to f* up so badly because of a misplaced parentheses)

Because new variables are introduced every other week, you will need to modify your rules engine anyhow, so you are not saving much there anyhow.

I suggest you have one master algorithm (taking in all 800 parameters and cross reference tables) and be done with it. I know you are going to have to modify that algorithm every other week, but that’s just the nature of the industry.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.