Public Member Functions | |
__construct () | |
getNewChildSelectOptions () | |
collectValidatedAttributes ($productCollection) |
Definition at line 28 of file Combine.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Mage_Rule_Model_Condition_Combine.
Reimplemented in Mage_SalesRule_Model_Rule_Condition_Product_Found, and Mage_SalesRule_Model_Rule_Condition_Product_Subselect.
Definition at line 30 of file Combine.php.
00031 { 00032 parent::__construct(); 00033 $this->setType('salesrule/rule_condition_product_combine'); 00034 }
collectValidatedAttributes | ( | $ | productCollection | ) |
Definition at line 59 of file Combine.php.
00060 { 00061 foreach ($this->getConditions() as $condition) { 00062 $condition->collectValidatedAttributes($productCollection); 00063 } 00064 return $this; 00065 }
getNewChildSelectOptions | ( | ) |
Reimplemented from Mage_Rule_Model_Condition_Abstract.
Definition at line 36 of file Combine.php.
00037 { 00038 $productCondition = Mage::getModel('salesrule/rule_condition_product'); 00039 $productAttributes = $productCondition->loadAttributeOptions()->getAttributeOption(); 00040 $pAttributes = array(); 00041 $iAttributes = array(); 00042 foreach ($productAttributes as $code=>$label) { 00043 if (strpos($code, 'quote_item_')===0) { 00044 $iAttributes[] = array('value'=>'salesrule/rule_condition_product|'.$code, 'label'=>$label); 00045 } else { 00046 $pAttributes[] = array('value'=>'salesrule/rule_condition_product|'.$code, 'label'=>$label); 00047 } 00048 } 00049 00050 $conditions = parent::getNewChildSelectOptions(); 00051 $conditions = array_merge_recursive($conditions, array( 00052 array('value'=>'salesrule/rule_condition_product_combine', 'label'=>Mage::helper('catalog')->__('Conditions Combination')), 00053 array('label'=>Mage::helper('catalog')->__('Cart Item Attribute'), 'value'=>$iAttributes), 00054 array('label'=>Mage::helper('catalog')->__('Product Attribute'), 'value'=>$pAttributes), 00055 )); 00056 return $conditions; 00057 }