[ic] Pricing based on cart group?

Eric Small interchange at ericsmall.com
Wed Jun 23 18:36:38 EDT 2004

Mike Heins wrote:
> Why are you are using mv_mi? That is used in the Interchange grouped
> items. It would be better to use some other attribute.
> In any case, just make a UserTag in catalog.cfg and use $item.
Thanks for the help!  The usertag method seems to work fine.  I've 
decided to follow your advice and am now using an item modifier named 
groupprice to indicate that group pricing should apply.

I now have a follow up question though.  When I build my product 
grouping I loop though a list of skus to show them what the total price 
will be.  I am now trying to use a tag like this:

[price code="[loop-code]" groupprice=1 noformat=1]

but it doesn't return the value from group_price as I was expecting.  It 
instead returns the regular price.  Once the item has been added to the 
cart though the group_price is applied.  Would that be happening because 
the usertag doesn't have a $item to reference when called from the price 
tag?  From what I can tell, groupprice is being passed into the price tag.

This is what I have now:

Profile dealer <<EOR
	CommonAdjust => <<EOF,

	NonTaxableField => 'nontaxable',
	PriceField => 'common_adjust',

UserTag group-price-field Routine <<EOR
   sub {
     return $item->{groupprice} ? ':group_price' : ':price';

Eric Small

Interchange 5.2.0 / Debian 3.0 Stable / PostgreSQL 7.4.1

More information about the interchange-users mailing list