[ic] get data from en extra table

Andrei Gologan interchange-users@icdevgroup.org
Tue Aug 13 07:38:03 2002


----- Original Message -----
From: "Joachim Leidinger" <jojo@blackpoint.de>
To: <interchange-users@icdevgroup.org>
Sent: Tuesday, August 13, 2002 12:54 AM
Subject: Re: [ic] get data from en extra table


> Andrei Gologan wrote:
> > Hallo
> >
> > I added an extra table to the IC, it shows up in the adminUI and works
there
> > just fine.
> > But I cannot get anything from it on the shop side. It is as if were not
> > there.
> >
> > do the names of the columns have to be unique all over the tables ?
> > Is there any other palce I need to add the table so IC knows its there ?
> >
> > I made an dbconf/mysql/table.mysql file.
> > When I change the data it also changes the products/table.txt which
seems
> > ok.
> >
> > Any pointers would be apreciated, IŽve read a few hours of docu and
mailling
> > list, and I think I am missing something (as allways)
>
> If you use the extra table beside the standard table products, maybe you
> are missing something like
>
> ProductFiles   products <EXTRATABLE>
>
> ?
>
> Where did you are missing that extra table? If you want to search
> anything from that extra table, did you use a special page to use that
> table? Maybe, you are missing a line like
>
>
> <input type="hidden" name="mv_search_file" value="EXTRATABLE">
>
> in that extra page, if you using a form page for any searching of
> anything from that table? Remember...the scan param for mv_search_file
> is "fi"!
>
> How did you try to get anything from that extra table?
>
> I'm missing my crystall ball! ;-)
>
> Don't misunderstand me please!
>

Sorry for the short question and than you for the answer.
Here is what i want to achieve:

some products should be available to some customers only as a limited
quantity. Lets say customer1 may only order a 10 items of  an certain item
no matter how many there are. This 10 items should not be limited per order
it should be a permanent limit. They should be able to order 2 or 3 at a
time but no more than 10 in total.

So I though IŽll make a table with4 columns Id, username, sku, quantity to
store the limits. Now I can recognize if it is one of the items but it
should read the quantity column from the new table and not from the
inventory and also decrease it there as well as in inventory.

I tried this in flypage:
(menge is the new table)

[item-calc]
        my $q = q{[item-data menge quantity]};
        if($q > 0) {
                return <<EOF;
                <font __FFACE__ size="1" color="#008000"><b>
                Menge: <input type="text" name="mv_order_quantity" size="4"
value="">
                </b></font>
                EOF
        } else {
                return <<EOF;
                <font color=red></font>
                EOF
        }
[/item-calc]

it should get the quantity for the logged in user and for the selected
product.

If there is another way to do this, IŽll gladly try it !
The only requirement is to be also acessible from the admin panel so other
less experienced users should manage it.

Andrei