0

In database where can I find a table where I could add another option to admin attribute?

1

First, I have to say that directly editing the database is not recommended; and if you do modify the database, you should do a backup first.

First, find the ID of the attribute you want to modify: (in this example, I use 'color')

SELECT * FROM eav_attribute WHERE attribute_code = 'color';

There, I see the attribute_id is 92.

Then you need to add a row to eav_attribute_option. Set the attribute_id with the id you got from the previous select.

Get option_id from your new row, and add it to eav_attribute_option_value with option_id as option_id, and set value

| improve this answer | |
  • You mentioned that editing databse is not the best option. What would be the "right" thing to do? I would like to add an option to availabitly attribute. – Sabina Orazem Apr 14 '16 at 12:43
  • 1
    For what you're doing there might not be a better way. I suppose the "right" way would be to write a module to add the option, which would programmatically add that value to the database. – andyjv Apr 14 '16 at 13:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.