How to pass custom attribute from admin category page to List.php
-
16-10-2019 - |
Question
I'd like to find out how to set up an entry box, so I can pass a string written in it from the "Manage Categories" menu to List.php.
For example, if there's a string "variable_here" for "List Visibility" under "Manage Categories -> Some Category A", you can get this variable via $layer->getCurrentCategory()->getListVisibility()
in List.php.
Under "Manage Categories" -> "Some Category A"
How do I add this "List Visibility" box?
Solution
Try using this post as a guide, mind the small bug answered in the comments on that post. I've also used this explanation myself so that might also be a nice source.
The actual adding of the attribute happens in the installer, it just requires the right resource model.
Both links are on Magento CE but, as far as I know this shouldn't be different in EE.