0

I have a module has created a custom attribute on my category pages which I need hidden. I do not want to mess with functionality or break anything by actually deleting the attribute or remove module so would like to modify visibility externally from my own module.

I have tried in my own module like below:

     $eavSetup->updateAttribute(
            Category::ENTITY,
            'is_virtual_category',
            'visible',
            false
        );
     $eavSetup->updateAttribute(
            Category::ENTITY,
            'is_virtual_category',
            'frontend_label',
            'Is virtual category (DO NOT USE)'
        );
      $eavSetup->updateAttribute(
            Category::ENTITY,
            'is_virtual_category',
            'visible_on_front',
            false
        );

This did seem to update the EAV attribute fine in database however the visible boolean does not seem to be respected here and although i can see the label is updated in database I cannot see visible listed in EAV table.

Have also attempted to modify via category_form.xml to create identical attribute and just set visible to false:

 <item name="imports" xsi:type="array">
      <item name="visible" xsi:type="string">false</item>
 </item>

This however did not work, even setting the value for visible in the actual module which I do not want to do didn't work so hoping this is configured elsewhere but unsure where to look and these are the 2 places I would assume to go. Not sure I can reference a field from another category_form.xml anyway as not seen any examples.

Your Answer

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

Browse other questions tagged or ask your own question.