Esempio n. 1
0
 /**
  * Remove catalog attribute condition by attribute code from rule conditions
  *
  * @param Mage_Rule_Model_Condition_Combine $combine
  * @param string $attributeCode
  */
 protected function _removeAttributeFromConditions($combine, $attributeCode)
 {
     $conditions = $combine->getConditions();
     foreach ($conditions as $conditionId => $condition) {
         if ($condition instanceof Mage_Rule_Model_Condition_Combine) {
             $this->_removeAttributeFromConditions($condition, $attributeCode);
         }
         if ($condition instanceof Mage_SalesRule_Model_Rule_Condition_Product) {
             if ($condition->getAttribute() == $attributeCode) {
                 unset($conditions[$conditionId]);
             }
         }
     }
     $combine->setConditions($conditions);
 }