[ic] Single widget matrix options

Jamie Neil interchange-users@icdevgroup.org
Thu Apr 17 11:54:00 2003


Answering my own posts again ;)

> -----Original Message-----
> From: interchange-users-admin@icdevgroup.org
> [mailto:interchange-users-admin@icdevgroup.org]On Behalf Of Jamie Neil
> Sent: 16 April 2003 17:47
> To: interchange-users@icdevgroup.org
> Subject: RE: [ic] Single widget matrix options
>
>
> > -----Original Message-----
> > From: interchange-users-admin@icdevgroup.org
> > [mailto:interchange-users-admin@icdevgroup.org]On Behalf Of Mike Heins
> > Sent: 14 April 2003 16:07
> > To: interchange-users@icdevgroup.org
> > Subject: Re: [ic] Single widget matrix options
> >
> ---snip---
> >
> > Aha. Yes, this bug was fixed a couple of days ago. You can update or
> > add to catalog.cfg:
> >
> > 	Options Matrix sort ""
> >
> ---snip---
>
> This seems to break separate widget options.
>
> If you try to buy something that uses separate widgets (e.g. the Big L
> Carpenters Square) on the 4.9.x demo foundation store
> (http://demo.icdevgroup.org/i/demo1/) it doesn't go into to the basket.
>
> Take the 'Options Matrix sort ""' out of the catalog.cfg file and it works
> again, but then it breaks single widget options :(
>
> Anyone got any idea why?

When using separate widget options, the SKU of the item is built by
concatenating the option codes together e.g. basesku-red-s

The problem is that the order of the options is determined by the order that
the widgets are placed on the page. So if you set `Options Matrix sort ""`
then the item sku is dependant on the order that the options appear in the
database instead of the o_group field e.g. you might get basesku-s-red which
doesn't exist. It depends on whether your options are stored in alphabetical
order in the options table.

My simple workaround at the moment is to remove the sort option from
lib/Vend/Options/Matrix.pm:

253c253
<               $q .= " FROM $vname where $lcol = $lval AND $ccol like $cval
$rsort"
---
>               $q .= " FROM $vname where $lcol = $lval AND $ccol like
$cval"

and reenable matrix options sorting by removing the `Options Matrix sort ""`
from the catalog.cfg.

But I think a neater solution would be to:

1) set sorting on a per widget basis (o_sort makes sense as an added field
to the Variants table but o_group doesn't)

2) somehow break the link between the base sku and the option sku values
i.e. a base sku of os0001 could have option skus of os0002, os0005 and
os0010 instead of os0001-red-s, os0001-blue-s, os0001-blue-m. This would
make integration with other stock control systems easier too as it doesn't
require a translation table for converting between IC skus and external ones
(which is what I'm going to have to do at the moment)

Comments welcome :)

Jamie Neil
Versado I.T. Services Ltd.

>
> Jamie Neil
> Versado I.T. Services Ltd.>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>