0

I have a few attributes that come with input select or multiselect. I have created source models to provide options for inputs. Everything seems to work (values are saved). But today I realized that also attribute options can be added.

Can anyone tell me what is the difference? Should I use source model or options? I have noticed thanks to this tutorial: Upgrade script - Create new select attribute with options that labels for options ar bind with store ids - how it should look like if I want to add the same options for every store (I have one website and one store). How to add more options for one attribute in sql script?

2
  • 1
    Options are admin-editable, a source is not. Furthermore, you'd use a source when you want it re-usable for other attributes/configs. Also, check \Magento\Eav\Setup\EavSetup::addAttributeOption(). I should expand this into an answer, but haven't got the time right now.
    – nevvermind
    Commented Jun 16, 2016 at 9:51
  • I think I get a clue - source model is more general thing and that's the difference I have noticed - it can't be editable... So if you have some time later - feel free to write some more thoughts. Thanks! Commented Jun 16, 2016 at 10:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.