[ic] Missing options (was Re: Building a new catalog system -- is it this complex?)

John1 list_subscriber at yahoo.co.uk
Fri Jun 11 13:19:44 EDT 2004


On Friday, June 11, 2004 4:24 PM, jeme at rkdpp.com wrote:

> On Thu, 10 Jun 2004 18:48:26 +0100
> "John1" <list_subscriber at yahoo.co.uk> wrote:
>> On Thursday, June 10, 2004 2:49 PM, jeme at rkdpp.com wrote:
>>> Using an empty foundation store, I've started modifying things to
>>> make something that just starts to work.
>>>
>>> I've added some of the simple products, but when it comes to things
>>> that need options, I'm hitting a wall.
>>>
>>> Using the admin interface, I select a product with SKU "AC001" that
>>> I'd just created.  This product can vary two simple ways: length and
>>> weight, so I select the "options" tab.  There are radio buttons for
>>> the type of option, so I select "Simple" and hit "update".  The
>>> screen appears to refresh, but nothing changes.  If I try to do it
>>> again, I get a message that says, "table options: set_slice error as
>>> called by Vend::Interpolate: DBD::Pg::st execute failed: ERROR:
>>> parser: parse error at or near "WHERE" at
>>> /usr/lib/interchange/Vend/Table/DBI.pm line 1245. query was:update
>>> options SET WHERE code = 'AC001' values were:''"
>>>
>>> Inspecting the "options" table in the database, I see that there is
>>> a single record with a single value in the "code" field set to
>>> "AC001".
>>>
>>> Does that seem wrong?
>>>
>>> This is Debian stable using the packages retrieved using the
>>> icdevgroup.org apt source (which are at 5.0.1 and that seems a bit
>>> odd).
>>>
>>> Any help appreciated.
>>
>> Personally, I would suggest following the simple options example in
>> the RTFM site faq docs.
>
> OK, did that.
>
>> Edit the database files (i.e. the txt files) in a notepad rather
>> than use the admin GUI.  If you are using PostgreSQL the database
>> will be updated from the txt files if you delete the .sql file of
>> the same name in the same directory, and restart interchange.
>
> Um, I just went ahead and added the entries to the database.
>
> insert into options values ('AC001-length', 'AC001', 'length', '',
> '48', 'Length', '48=48 Inch,57=57 Inch', 'select', NULL, NULL, 'Cue
> length', NULL, NULL, NULL);
>
> Seems OK, I think.  Some of the fields don't exist in the example, so
> I left them blank (except o_sort, which is defined not null... don't
> know what to put there).
>
>> Once you get it working this way then go back to the admin GUI and
>> see what the options you have set up look like from the GUI.
>
> Nothing in the GUI, nothing in the catalog.  It's like the entries
> aren't even there.
>
> What am I missing?
>
I am not sure off the top of my head.  But, have you got the Foundation
store working (i.e. the Interchange demo)?  If so, can you see the
paintbrush which is available in different bristle types + I think optional
logo on the handle?  This uses options.  I suggest you inspect the options
table for the foundation demo.

>From memory, o_sort simply provides for an options sort order.  There is
something in the docs, but can't remember where.

It's probably worth mentioning that the actually technical implementation of
"options" has been changed since some of the docs were put together, so this
can cause a little confusion.  "Options" are now modularised like payment
modules, so you can actually write your own perl code for more complex
option scenarios.  You should find the perl modules "simple.pm" and
"matrix.pm" under lib/vend/options.  These 2 modules implement the old
"simple" and "matrix" options as described in the documentation.

This new implementation of options is described briefly in the "WHATSNEW"
file under the 4.9.8 section (i.e. this was when the rewrite was first
included) - you should definitely read this file.  There are a few new
catalog config directives described here that you should check you have
correctly included in your catalog config file.

Having said all this, your best bet is to get the Foundation demo working,
and then in your own catalog mimic the way options are implemented in
Foundation.

Hope this helps.



More information about the interchange-users mailing list