[ic] A Challenge with Regards to Options in Interchange

Mike Heins interchange-users@interchange.redhat.com
Sat Apr 13 02:53:00 2002


Quoting Cameron (lists@cameroncorda.com):
> Over the last several months I've become rather accustomed to 
> Interchange and it's capabilities, but the last piece of my clients site 
> has been troubling me for some time.  My client wishes to sell 
> made-to-order bridal veils.  There are a series of options which 
> determine the overall cost of the veil.  Veils can be from one to 3 
> layers, and different layers can be different sizes.  The price is 
> dependent on size.  To solve this I've decided on having 3 options: 
> layer1, layer2, and layer3, each of which modifies the price differently 
> depending on the selection.
> 
> The hard part is that once the customer has decided on the layers, they 
> can select 1 trim, and 1 accent.  Each of these is from a handful of 
> selections.  The problematic part is that depending on the length of 
> each layer, the cost of the trim and accents will vary.  Accent A on a 
> 20" layer will cost less than that same Accent on a 72" layer.  Another 
> issue is that for trims, the price is fixed, but it is per layer.  So if 
> a trim is selected that is 15.00 per layer, and the veil is a 2 layer 
> veil, then the price of that trim needs to be 30.00.
> 
> I know this is possible, but I'm not sure how to make it work in 
> Interchange.

While it is possible, it requires some custom code. Nothing in
the standard options setup will do does this.

You need to set up a UserTag or series of pages which reads the cart,
checks the database, and outputs the option widgets in turn. You can
either manage the options yourself and use the IC price routines, or
maybe as practically set the price directly with the
$item->{mv_price} attribute.

If you look at some of the UserTag code in ICROOT/usertag and
ICROOT/lib/UI/usertag, it will show you quite a few routines
that would help you do that. Uses of $Tag->display() and
$Items or $Carts->{main} should be particularly illuminating.
There is also considerable cart-related code in the mail list
archives.

If you don't feel up to this yourself, I am sure a highly competent
consultant (a few inhabit this group) could help you with it in 
about a dozen hours of time.

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Being against torture ought to be sort of a bipartisan thing.
-- Karl Lehenbauer