[ic] item-options price=1
Ron Phipps
rphipps at reliant-solutions.com
Wed Nov 19 17:56:19 EST 2003
> From: Mike Heins
>
> Quoting Bill Carr (bill at worldwideimpact.com):
> > IC 4.9.9
> >
> > [item-options price=1] returns some options even if those options do
not
> > contain any pricing information.
> >
> > On a results page I would like to say:
> > [either][item-options price=1][or][item-price][/either]
> >
> > How can I make [item-options price=1] only return something if those
> > options have some pricing information? I only want to do this
sometimes.
> >
> > I think I would like something like:
> > [item-options price=1 do_not_return_without_prices=1]
>
> You may not know (not many except me probably know, in fact) can
create
> new Vend::Options types in IC just like you can Vend::Payment types.
Just
> copy lib/Vend/Options/Simple.pm to lib/Vend/Options/MyOptions.pm, hack
> on it (making the package name correct, mostly) then do in
catalog.cfg:
>
> Options MyOptions enable 1
>
> Once that is done, you can set the option_type to MyOptions in
> the products table and hack on the display routine all you
> want without affecting the normal options.
>
> --
> Mike Heins
> Perusion -- Expert Interchange Consulting http://www.perusion.com/
> phone +1.765.647.1295 <mike at perusion.com>
>
Here is the CVS log entry for those that are interested. It's a pretty
cool feature which extends access to the Option core code without
breaking the existing option types.
* Major update to product options.
* Options are now modular in much the same way as Vend::Payment is.
You can add an unlimited number of option types simply by dropping
a module into Vend::Options.
* By default, the old 4.8 style options are in force, implemented
with Vend::Options::Old48.
If you add this to catalog.cfg (in etc/after.cfg in foundation):
OptionsEnable option_type
The "option_type" names a field in the products file which controls
the option type. This enables new-style options.
It can also be in a specific table and field, ala AutoModifier:
OptionsEnable table:field
Indeed, this is added to AutoModifer after catalog.cfg.
* There are two new-style options included:
Vend::Options::Matrix
Vend::Options::Simple
These are equivalent to the current matrix and simple options.
* Options behavior is controlled in catalog.cfg by a locale-style
multiple hash (ala UserDb or Route):
Options Matrix sort o_sort,o_group
Options Matrix variant_table my_variants
* To find and add a new option type, simply set something in
catalog.cfg:
Options MyOptions table my_options
That will cause a require of Vend::Options::MyOptions.
* The matrix products have been moved to the "variants" table.
* The options table contains options for both Matrix and Simple types,
but only fields for building those simple-type options (which are
used to generate variants for Matrix). The followign fields
have been removed from options:
differential
mv_shipmode
o_enable
o_exclude
o_footer
o_header
o_include
o_master
o_matrix
o_modular
phantom
volume
weight
* The variants table is a subset of the fields in products.
* The admin page for each option style is defined in its
admin_page routine, usually an include from
inclued/Options/OptionType.
* size and color fields removed from products table, option_type added.
More information about the interchange-users
mailing list