Adding a new field in OX tables and accessing it in shop

Hi All,

I have a requirement where I need to add an extra input for categories in admin.So, I have created a column in oxcategories table using sql script in admin->service->tools

“alter table oxcategories add column test varchar(128);” and updated the DB views. I have also added the row in www/out/admin/category_main.tpl for this field.

I have entered some test values in to the input field and saved the contents for different categories.They all get saved and database tables are also updated.

The problem I face is that I am unable to retrieve the value of this field.

I have used the below way to retrieve the value in www/out/azure/tpl/widget/header/topcategories.tpl

" [{$osubcat->oxcategories__test->value}] “. which is pretty much similar to getting the title value” [{$osubcat->oxcategories__oxtitle->value}] ".

Please suggest me ways of how to get the value of this field.

Another issue of mine is that I have tried to create a similar extra field in usergroups in admin.I did the same as above but cannot save the values entered in field until I specify the column name as " oxdesc ".Please clarify why am I facing this unusual behavior in oxgroups.

Thanks & Regards,
Sai Chandra Sekhar.M

Hi,

take a look at Service / Tools / Update views. I think, this will help you.

Happy Coding :wink:

Cutty

Hi Rubbercut,

I have already done Service / Tools / Update views. and updated views.I can see the values in database.

Thanks & Regards,
Sai Chandra Sekhar.M

Look here: http://www.musterdenker.de/2009/09/oxid-eshop-enable-lazy-loading-for-categories/

Hi leofonic,

The link was really helpful.I thought of making lazyloading true but it may hinder performance, so I went with extending field list in category list and its working fine for me.Thank you.

Meanwhile,can you explain me why can’t I use my desired field name in oxgroups other than oxdesc.

Thanks & Regards,
Sai Chandra Sekhar.M