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

Missing attribute name when attribute is sortable (Backend) #61

Open
phizab opened this issue Apr 8, 2016 · 0 comments
Open

Missing attribute name when attribute is sortable (Backend) #61

phizab opened this issue Apr 8, 2016 · 0 comments

Comments

@phizab
Copy link

phizab commented Apr 8, 2016

If I choose a condition by a product attribute, which is part of the sortable attributes under "Display Settings" > "Available Product Listing Sort by", I do not see the attribute's name after I saved the category (e.g. the attribute "name" in default Magento installation).

This is caused by the core method Mage_Catalog_Model_Config::getAttributesUsedForSortBy(), because the sortable attributes will not loaded completely and are missing fields like "is_visible". Nevertheless they will be cached in Mage_Eav_Model_Config and the rule conditions use this singleton with the incomplete data.

I've added the following line at the beginning of method FireGento_DynamicCategory_Model_Rule::loadPost(), but I know that this method is deprecated so please use this at your own risk. A better solution is needed here!

/**
 * Initialize the rule model data from the given array.
 *
 * @param  array $rule Rule data
 * @return FireGento_DynamicCategory_Model_Rule Self.
 */
public function loadPost(array $rule)
{
    // reset attributes cache to get all attributes loaded completely
    Mage::getSingleton('eav/config')->clear();

    $arr = $this->_convertFlatToRecursive($rule);

    [..]

    return $this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant