0

Is there way to list all of catalog attributes in my custom catalog tab?

each attribute as field label and a text input field, basically mapping a text to an attribute name / key

or if there is a way to better accomplish this

my current way is having a select field with source model pulling all the existing attributes, but this approach limits number of fields I add, and is not user friendly having them to select from list of attributes every time

<section id="catalog" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Custom</label>
            <tab>attribute</tab>
            <resource>custom::custom_attribute</resource>
            <field id="import_att1" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Module Mode</label>
                <source_model>Custom\Custom\Model\Config\Source\Attribute</source_model>
            </field>
...
</section>
1

I did have a quick look and it seems quite tricky:

  • to draw a list of fields in the config area is complex if the list has to be made dynamically.

--> my thought is to use a custom field and this field could mimic what the fieldset element does (see \Magento\Config\Block\System\Config\Form\Fieldset)

the latter has child elements and you could feed these elements with your attributes data.

But when you realise that you are about to customise a part of the system that is not simple, you may as well build your own screen. At least, with a screen, your query becomes quite standard indeed.

To Add product attribute in magento, look at screenshot below: enter image description here

  • after some thoughts, I think adding additional field to product attribute, but can't find where I can insert one – Eudemon Dec 31 '18 at 19:19
  • Magento is not an easy platform, think twice before you spend your time onto this platform as you might double the time you thought you expected to spend on it.. – Herve Tribouilloy Dec 31 '18 at 20:30
  • i don't mean adding new attribute, i mean adding new attribute field / property magento.stackexchange.com/questions/256289/… – Eudemon Dec 31 '18 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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