[ic] Relational options question

Daniel Davenport DDavenport at newagedigital.com
Tue Feb 14 12:54:18 EST 2006


> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org 
> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf 
> Of Sandy Thomson
> Sent: 2006 February 14 -- Tuesday 9:20 AM
> To: interchange-users at icdevgroup.org
> Subject: [ic] Relational options question
> Hi there,
> In interchange at the moment the option rows are like:
> options table
> --
> sku-optionA sku label1,label2,label3 price1,price2,price3 
> sku-optionB sku label4 price4
> where the various labels and prices are comma seperated (the 
> example is simplified for the question).
> Would it not make more sense to have something like:
> options table
> --
> sku-optionA sku
> sku-optionB sku
> option contents table
> --
> sku-optionA label1 price1
> sku-optionA label2 price2
> sku-optionA label3 price3
> sku-optionB label4 price4
> The reason I am asking this is that we want to vary the price 
> of a product depending on a combination of options being 
> selected, and the price increment is not linear. Its not even 
> quite as simple as that but i am trying to explain it so you 
> can understand - it would be using custom CommonAdjust 
> functions and a relational database would really help. Before 
> I go off and rewrite the interchange core options 
> functionality has this been done already? Any suggestions 
> about how I might begin to tackle this task?

Have you looked at matrix options?  Their main purpose in life is to
allow for the creation of "variants", or sub-products, whose data can be
set independently of the main sku.  Each combo of options would have its
own variant, and you could set its price to whatever you like.  The
biggest drawback is that if you still have an option that always
increments the price by $5 or something, it's no longer as simple to
change that $5 to something else -- every variant that has that option
selected would need to be repriced.

If you want to play with matrix options, go to the Items tab.  If you
don't see an Option column on the select page, edit the page's meta
stuff til you do.  :)  Then click the link in that column for the
product, and it'll ask you about an option type.  Pick "Matrix Options".
Then experiment with making options and clicking the "create all
possible combinations" button.  

BTW, you don't have to mangle the core to add a new option type.  Just
create a new module in $IC_DIR/lib/Vend/Options, and refer to it in the
IC config/meta info.  Your module will need three subs--with specific
names--that price, display, and show an edit page for the options.  See
$IC_DIR/lib/Vend/Options/Simple.pm for an example.  Better yet, copy it,
comment out all the code in the subs, and refer back to it when you need
to know where to grab info from.  :)  But it sounds like matrix options
will do what you need done, and you won't have to muck around with perl
Daniel Davenport
New Age Digital

More information about the interchange-users mailing list