[ic] Adding Fields

Dan Browning interchange-users@interchange.redhat.com
Tue Nov 6 19:24:00 2001


> How can I add more fields?
> 
> Example: Create new item... I want more than just Product 
> Name, Description, Category, Price, Weight, etc.
> 
> Modify which files to accomplish this?
> 
> Jim.

Below is a HOWTO posted to the list a while back.

Dan Browning
Kavod Technologies


I wanted to add a manufacturer to my products so I did the following


1) Add column in database product table


# mysql
mysql> use <my dbase name> ( fill in if you are using a database)
mysql> ALTER products ADD mfg VARCHAR(20);
mysql> quit


2) Modify variable.txt. I added the mfg field after weight


UI_ITEM_FIELDS  sku description category price image display comment
size color weight mfg      Item display


3) Add New Entry into mv_metadata ( via Admin Tables interface)


Name                    Type    Width   Label
products:mfg            Text    30      Manufacturer


I did not have to move or change the item_edit.html to the pages/admin
directory in my catalog


The next time I did an item edit the field was available to change.
After saving the database show the value in the row.


Hope this sheds some light.




At 04:32 PM 2/16/01 +0000, you wrote:
Okay I did that but I still don't get anything. All that I have is this:
Is this all I am supposed to have and I have to create my own page?
Does anyone have a copy of one they made? I would really appreciate it.



[calc]
        $CGI->{mv_data_table} = $Config->{ProductFiles}[0];
        if ($CGI->{item_id} eq 'new') {
                $CGI->{ui_new_item} = 1;
        }
        else {
                $CGI->{ui_hide_key} = 1 unless $CGI->{item_id} eq 'new';
        }
        if(! $CGI->{ui_data_fields}) {
                $CGI->{ui_data_fields} = $Variable->{UI_ITEM_FIELDS}
                                || 'sku description category comment
price image weight size color';
        }
        if(! $CGI->{ui_break_before}) {
                $CGI->{ui_break_before} = $Variable->{UI_ITEM_BREAK}
                                || 'image size';
        }
        my @args = (
                '__UI_BASE__/item',
                "item_id_left=$CGI->{item_id_left}",
                "ui_sequence_edit=$CGI->{ui_sequence_edit}",
        );
        $CGI->{ui_return_to} = join "\0", @args;
        return;
[/calc]
[if cgi ui_new_item]
        [calc]
                $CGI->{item_id} = q{[counter
file="__UI_PRODUCT_DIR__/__UI_PRODUCT_DIR__.autonumber" start=new0000]};
                return;
        [/calc]
[/if]
@_UI_STD_DBEDIT_HEAD_@


[seti page_title]Item editor: [cgi item_id][/seti]
[seti page_banner]Item editor: edit item <B>[cgi item_id]</B>[/seti]
[set help_name]edit.item[/set]
[set icon_name]admin/icon_item.gif[/set]


@_UI_STD_HEAD_@
<P>
@_UI_STD_DBEDIT_TABLE_@


[if-mm super]
<A HREF="[area href=admin/flex_editor
                                form='
                                        item_id=[cgi item_id]
 
mv_data_table=__UI_PRODUCT_TABLE__
                                        page_title=Edit items: [cgi
item_id]
                                        help_name=inventory.edit
                                        ui_no_meta_display=1
                                        ui_hide_key=1
                                        ui_return_to=__UI_BASE__/item
                                        icon_name=admin/icon_item.gif
                                        ']">No meta display</A>
[/if-mm]


@_UI_STD_FOOTER_@
<!-- page: @@MV_PAGE@@ -->




From: "Cameron Germein" <cameron.germein@team.eftel.com>
Reply-To: interchange-users@lists.akopia.com
To: <interchange-users@lists.akopia.com>
Subject: Re: [ic] item_edit.html  Can't setup new products!!!!
Date: Fri, 16 Feb 2001 11:04:41 +0800


i bet the fields in your product database are different from those in
the
demo, right? if so, make a directory in your pages dir called "admin",
and
copy from interchange/lib/UI/pages/admin the item_edit.html page into
your
new admin directory. edit the new copy in there.