[ic] Add record to table when order is placed

Marty Tennison marty at sediva.com
Fri Dec 9 11:17:04 EST 2005


DB wrote:

[snip]

> Here is more detail about my failed attempts to have IC insert a record
> in the table order_info when an order is placed. In my
> ...etc/log_transaction file I changed the line
> 
> [loop list="transactions orderline inventory userdb"]
> to
> [loop list="transactions orderline inventory userdb order_info"]
> 
> I then added
> 
> [import table=order_info]
> code: [value mv_order_number]
> [/import]
> 
> just before the closing [/try] tag. But in my .../interchange/error.log
> I see entries like this when an order is placed, and no record is
> inserted into the order_info table.
> 
> ...Error creating dummy database for icmenu: Can't call method "new" on
> an undefined value at /home/store/interchange/lib/Vend/Data.pm line 752.
> 
> The key column for the order_info table is named order_number I'm hoping
> someone can provide a clue or a link to appropriate docs?

I usually move the code into a separate interchange page and test the 
imports there first.  Then you can eliminate a lot of variables before 
you move it into log_transactions file.   For instance, in a page named 
test.html you could put  (not tested)


[tmp test_order_number]1234[/tmp]

[import table=order_info]
   order_number: [scratch test_order_number]
[/import]

Once you get a basic import working you can then add the loop and try 
blocks around it and see what happens.  Then, moving it into 
log_transactions should be fairly painless.

That's just the way I do things, YMMV.

-- 
-  - -- ----  ---------------------------- --- -- -   -
Marty Tennison
-  -- --- --------------------------------------- --- --


More information about the interchange-users mailing list