[ic] Complex pricing

Daniel Davenport ddavenport at newagedigital.com
Fri Jul 16 16:47:59 EDT 2004


One of our clients has products with lots of options (sometimes 15-20 per
product).  They want to be able to edit the pricing formulas whenever they
change, which apparently is somewhat often....but they don't know much about
perl and know even less about Interchange, so hard-coding formulas in a
UserTag is pretty much out of the question.  To complicate things further,
they have some options which depend on the values of other options (mostly
size), but others are simple, standalone options.  Using matrix options for
everything would create tens of thousands of variants for each item at
least, not to mention making it several people's full-time job just changing
prices.  :)

In the solution i'm working on, pieces of the formulas are in their own
table, and a couple of UserTags look up the parts of the formula, assemble
them into a CommonAdjust string, and return the string.  According to my
understanding of the IC docs, that string should be parsed and used.
However, it seems that Interchange is only paying attention to the first
atom in the string.  (When i tell the main UserTag to always return
'50.00, -20.00' as a test, the price ends up being 50.00 (minus
wholesale/dealer/etc pricing, which is from the main CommonAdjust string and
seems to work fine).

The only way i can think of for returning a whole CommonAdjust string is
having a table of temporary strings and returning a lookup atom that points
to the string.  Depending on how IC handles anything besides a price or
percentage, it might work or it might not...but even if it did work, i'd be
asking for trouble.  Please tell me there's a less contorted, less
error-prone way.


--
(Sig for sale.  Barely used; one owner.  Will consider trade-ins.)



More information about the interchange-users mailing list