[ic] Pricing based on cart group?

Eric Small interchange at ericsmall.com
Wed Jun 23 12:12:51 EDT 2004

Eric Small wrote:
> I'm trying to implement different pricing for a product depending upon 
> whether the item is in an item group or not.  I know I would need to 
> check the value of mv_mi for the item, but after that I'm unclear on how 
> to handle it.

I'm trying to use CommonAdjust do this and it seems very close to 
working, but I get an error.

--begin after.cfg snippet--
Profile dealer <<EOR
	CommonAdjust => <<EOF,

		;&"if ($Vend::Interpolate::item->{mv_mi}){return ':sale_price';} 
else{return ':price';}",
	NonTaxableField => 'nontaxable',
	PriceField => 'common_adjust',
--end after.cfg snippet--
There is no line return in the ;&"if ($Vend::Inter... line

The error I get in the error.log file is this
apistore /cgi-bin/apistore/process Safe: syntax error at (eval 385) line 
1, near "()"
 > if (){return ':sale_price';} else{return ':price';}

If I change the line to this
     &"if (1){return ':sale_price';} else{return ':price';}",
then it works like a champ.

What am I doing wrong here?  I'm trying to follow the examples given in 
but I can't seem to get it to work.

Interchange 5.2.0 / Debian 3.0 Stable / PostgreSQL 7.4.1

More information about the interchange-users mailing list