Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

1.4.2.0 - Missing “is one of” in catalog rules for Category condition => Solution
 
faken
Jr. Member
 
Total Posts:  16
Joined:  2009-11-13
 

When creating (or changing) a Catalog Price Rule in Magento 1.4.2.0, you will notice that when creating a condition which involves Categories, the “is one of” and “is not one of” operators are missing. Curiously this problem does not exist in other versions of Magento (e.g. 1.4.1.1 and 1.5.0.0), so it’s really a 1.4.2.0 issue.

To solve this issue, download another Magento version (I used 1.5.0.0 beta2), and copy the following files:

/app/code/core/Mage/Rule/Model/Rule.php
/app/code/core/Mage/Rule/Model/Condition/Abstract.php

to your 1.4.2.0 installation, in the local code path:

/app/code/local/Mage/Rule/Model/Rule.php
/app/code/local/Mage/Rule/Model/Condition/Abstract.php

This will override the 1.4.2.0 bug and work properly. When you upgrade to 1.5.0.0 stable don’t forget to delete these files.

Hope this helps someone!

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

Mage/Rule/Model/Condition/Abstract.php

In 1.4.2.0

/**
     * Default operator input by type map getter
     *
     * @return array
     */
    public function getDefaultOperatorInputByType()
    
{
        
if (null === $this->_defaultOperatorInputByType{
            $this
->_defaultOperatorInputByType = array(
                
'string'      => array('==''!=''>=''>''<=''<''{}''!{}''()''!()'),
                
'numeric'     => array('==''!=''>=''>''<=''<''()''!()'),
                
'date'        => array('==''>=''<='),
                
'select'      => array('==''!='),
                
'boolean'     => array('==''!='),
                
'multiselect' => array('==''!=''{}''!{}'),
                
'grid'        => array('()''!()'),
            );
        
}
        
return $this->_defaultOperatorInputByType;
    
}

Changes in 1.5.0.x and above to:

/**
     * Default operator input by type map getter
     *
     * @return array
     */
    public function getDefaultOperatorInputByType()
    
{
        
if (null === $this->_defaultOperatorInputByType{
            $this
->_defaultOperatorInputByType = array(
                
'string'      => array('==''!=''>=''>''<=''<''{}''!{}''()''!()'),
                
'numeric'     => array('==''!=''>=''>''<=''<''()''!()'),
                
'date'        => array('==''>=''<='),
                
'select'      => array('==''!='),
                
'boolean'     => array('==''!='),
                
'multiselect' => array('{}''!{}''()''!()'),
                
'grid'        => array('()''!()'),
            );
        
}
        
return $this->_defaultOperatorInputByType;
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top