Questions tagged [source-model]
The source-model tag has no summary.
42 questions
2 votes
1 answer
75 views
Magento 2 System config Categories list not working on website scope update
I have created a system configuration to show the Categories list as assigned website-wise. When we change the website scope the categories list options are the same. Would you please share your ...
1 vote
0 answers
168 views
How to create dynamic source model in Magento 2 depend on database?
Suppose MyEnity has column "status" in the database it values is 0,1,2 0 => None 1 => 'Good' 2 => 'Bad' I want In Add Page, source model display 1 => 'Good' 2 => 'Bad' In ...
0 votes
2 answers
652 views
Update attribute : add source
I have a product attribute that have been added directly in the database threw a migration process. I want to update that attribute to give him a source. But this seems not to be working. $attribute = ...
0 votes
0 answers
211 views
Magento 2 text input source model
Has anyone found an example of the product attribute with input type text and a source model? With a select input type - it is easy, but I cant find anything with text type.
1 vote
0 answers
67 views
Magento 2 - How to auto checked a multiselect ui-component?
I have a ui-component <field name="interest" formElement="multiselect"> <argument name="data" xsi:type="array"> &...
1 vote
1 answer
363 views
Magento 2 : Fetch system.xml group id in source model
In Magento 2, I want to fetch group id from system.xml in my custom sourceModel But I am unable to find a solution online. Please do let me know if it's possible or not. I know there's an alternate ...
2 votes
2 answers
1k views
Source model issue from system xml in Magento 2
I've created two dropdowns field in the system.xml , both of them have the same options, except that one has an extra option: None. This is the xml: <field id="printing_option" translate="...
2 votes
2 answers
431 views
Custom system.xml source model, ReflectionException class does not exist
Writing a new module and in my system.xml I can put the following: <field id="environment" translate="label" type="select" showInDefault="1" showInWebsite="1" showInStore="1"> <label>...
1 vote
2 answers
41 views
Multiselect attribute created not saving in Db
I have created a custom Multiselect product attribute. It has been created successfully but the value are saved when assigned store view specific. But if i select an option and save in global it is ...
2 votes
1 answer
66 views
What is the scope of source model extend and implement?
What is the scope of source model extend and implement between these two? \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource \Magento\Framework\Data\OptionSourceInterface Attribute options ...
1 vote
0 answers
27 views
Source model "mobilegifting / attributes_distribution" for the attribute "distributionsweg" was not found | Magento1
I am facing "source model "xxx / xxx_xxx" for the attribute "xxx" was not found" with many module who's module name(Retailo_MobileGifting) is canonical. To change the name of all module is not a good ...
0 votes
0 answers
70 views
Countries in dropdown : 2 digits to 3 digits
I have a question about the source model "Country". Currently, I can use, in my system.xml file, the following source_model : <source_model>Magento\Directory\Model\Config\Source\Country</...
2 votes
1 answer
72 views
How can I have a Configurable attribute populated from a source
I have a product attribute, which is populated by a source model which is extended from AbstractSource. Because of this the attribute is not set with 'is_user_defined' = 1 and therefore I am not able ...
0 votes
1 answer
369 views
Source Model for Catalog product tye
I am creating a bespoke extension and I want to allow the admin to choose to restrict by product types eg Simple, Configurable, Bundle etc The issue is I am not sure what source model to use. I have ...
0 votes
1 answer
182 views
Use source model to checkboxes in catalog attribute
I have the code that create new attribute for category $setup->addAttribute('catalog_category', 'watermark', array( 'group' => 'Category labels', 'input' => 'checkboxes', '...