Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing arguments to <options> methods #19


Copy link

Allows you to write a method like this when working with dropdown EAV attributes


class Mpchadwick_GridControl_Model_Utility
    public function getDropdownAttributeLabelOptionArray($attribute)
        $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', $attribute);
        $options = $attribute->getSource()->getAllOptions(false);

        $map = [];
        foreach ($options as $option) {
            $map[$option['value']] = $option['label'];

        return $map;

Then you can re-use it whenever adding a dropdown attribute

<?xml version="1.0"?>

There might be other use cases I'm not thinking of...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants