[ic] pricing help needed

Mike Heins mike at perusion.com
Sat Mar 19 12:56:55 EST 2005

Quoting Mark Weaver (mdw1982 at mdw1982.com):
> Mike Heins wrote:
> >Quoting Peter (peter at pajamian.dhs.org):
> >
> >>On 03/18/05 19:14, Mark Weaver wrote:
> >>
> >>>thank you SO much for your help. That last one got it. Placing the 
> >>>UseModifier in there I mean. I switched the discount percentages around 
> >>>and am using the regex grouping to test for specific sku numbers. Its 
> >>>finally working like a charm. You ROCK!
> >>>
> >>>Thanks again.
> >>>
> >>>UseModifier prod_group
> >>>CommonAdjust    :sale_price, ;:price, ;$, ==products,
> >>>"&($item->{code}=~/^(?:90|94|40)/ ? '-20%' : '-50%')"
> >>
> >>You don't need the UseModifier if you're just checking $item->{code}. 
> >>You only need it if you want to check somethign else (like prod_group).
> >
> >
> >UseModifier in and of itself does nothing toward that end, anyway.
> >You have to use "AutoModifier pricing:price_group", which fetches the value
> >when the item is ordered.
> >
> Is this the case even when there isn't anything actually set for 
> "pricing_group"? I don't currently have any groups setup and on test 
> orders the items prices appear to be being output correctly through the 
> order process unless I'm missing something.

No, it only matters when you need it, of course. 

All AutoModifier does is pull a database field out of a table and
set it in the item hash.

If you put this in a page:

	[dump key=carts]

you will see what I mean.

It is a useful method for getting item information without having
to call tag_data() or such in the actual pricing calculations. It
is much cheaper in processor power (and database connections, etc)
to pull the value out once when the item is order, instead of potentially
thousands of times as pricing calculations are done.

Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>

Prove you aren't stupid.  Say NO to Passport.

More information about the interchange-users mailing list