1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27:
28: class Mage_SalesRule_Model_Rule_Condition_Combine extends Mage_Rule_Model_Condition_Combine
29: {
30: public function __construct()
31: {
32: parent::__construct();
33: $this->setType('salesrule/rule_condition_combine');
34: }
35:
36: public function getNewChildSelectOptions()
37: {
38: $addressCondition = Mage::getModel('salesrule/rule_condition_address');
39: $addressAttributes = $addressCondition->loadAttributeOptions()->getAttributeOption();
40: $attributes = array();
41: foreach ($addressAttributes as $code=>$label) {
42: $attributes[] = array('value'=>'salesrule/rule_condition_address|'.$code, 'label'=>$label);
43: }
44:
45: $conditions = parent::getNewChildSelectOptions();
46: $conditions = array_merge_recursive($conditions, array(
47: array('value'=>'salesrule/rule_condition_product_found', 'label'=>Mage::helper('salesrule')->__('Product attribute combination')),
48: array('value'=>'salesrule/rule_condition_product_subselect', 'label'=>Mage::helper('salesrule')->__('Products subselection')),
49: array('value'=>'salesrule/rule_condition_combine', 'label'=>Mage::helper('salesrule')->__('Conditions combination')),
50: array('label'=>Mage::helper('salesrule')->__('Cart Attribute'), 'value'=>$attributes),
51: ));
52:
53: $additional = new Varien_Object();
54: Mage::dispatchEvent('salesrule_rule_condition_combine', array('additional' => $additional));
55: if ($additionalConditions = $additional->getConditions()) {
56: $conditions = array_merge_recursive($conditions, $additionalConditions);
57: }
58:
59: return $conditions;
60: }
61: }
62: