Example #1
0
 public function getNewChildSelectOptions()
 {
     $attributes = array();
     $customAttributes = Mage::getSingleton('xtento_orderexport/export_condition_custom')->getCustomAttributes();
     foreach ($customAttributes as $code => $label) {
         if (preg_match('/xt\\_billing\\_/', $code)) {
             $attributes[] = array('value' => 'xtento_orderexport/export_condition_address_billing|' . str_replace('xt_billing_', '', $code), 'label' => $label);
         } else {
             if (preg_match('/xt\\_shipping\\_/', $code)) {
                 $attributes[] = array('value' => 'xtento_orderexport/export_condition_address_shipping|' . str_replace('xt_shipping_', '', $code), 'label' => $label);
             } else {
                 $attributes[] = array('value' => 'xtento_orderexport/export_condition_object|' . $code, 'label' => $label);
             }
         }
     }
     $otherAttributes = array();
     $customOtherAttributes = Mage::getSingleton('xtento_orderexport/export_condition_custom')->getCustomNotMappedAttributes();
     foreach ($customOtherAttributes as $code => $label) {
         $otherAttributes[] = array('value' => 'xtento_orderexport/export_condition_object|' . $code, 'label' => $label);
     }
     $conditions = parent::getNewChildSelectOptions();
     $conditions = array_merge_recursive($conditions, array(array('value' => 'xtento_orderexport/export_condition_product_found', 'label' => Mage::helper('salesrule')->__('Product / Item attribute combination')), array('value' => 'xtento_orderexport/export_condition_product_subselect', 'label' => Mage::helper('salesrule')->__('Products subselection')), array('value' => 'xtento_orderexport/export_condition_combine', 'label' => Mage::helper('salesrule')->__('Conditions combination')), array('label' => Mage::helper('xtento_orderexport')->__('%s Attributes', ucfirst(Mage::registry('order_export_profile')->getEntity())), 'value' => $attributes), array('label' => Mage::helper('xtento_orderexport')->__('Misc. %s Attributes', ucfirst(Mage::registry('order_export_profile')->getEntity())), 'value' => $otherAttributes)));
     $additional = new Varien_Object();
     Mage::dispatchEvent('xtento_orderexport_rule_condition_combine', array('additional' => $additional));
     if ($additionalConditions = $additional->getConditions()) {
         $conditions = array_merge_recursive($conditions, $additionalConditions);
     }
     return $conditions;
 }
Example #2
0
 /**
  * Get conditions selectors
  *
  * @return array
  */
 public function getNewChildOptions()
 {
     $conditions = ['' => $this->translate('Please choose a condition to add...')];
     // Fire an event to add conditions
     $container = new Varien_Object();
     Mage::dispatchEvent('aoe_fraudmanager_rule_condition_order_item_combine_conditions', ['parent' => $this, 'container' => $container]);
     if ($additional = $container->getConditions()) {
         $conditions = array_merge($conditions, $additional);
     }
     return $conditions;
 }
Example #3
0
 /**
  * get child select options
  * @return type
  */
 public function getNewChildSelectOptions()
 {
     $orderAttributes = Mage::getModel('rewardpointsreferfriends/rule_condition_order')->loadAttributeOptions()->getAttributeOption();
     $attributes = array();
     foreach ($orderAttributes as $attribute => $label) {
         $attributes[] = array('value' => 'rewardpointsreferfriends/rule_condition_order|' . $attribute, 'label' => $label);
     }
     $conditions = parent::getNewChildSelectOptions();
     $conditions = array_merge_recursive($conditions, array(array('value' => 'salesrule/rule_condition_product_found', 'label' => Mage::helper('rewardpointsreferfriends')->__('Product attribute combination')), array('value' => 'salesrule/rule_condition_product_subselect', 'label' => Mage::helper('rewardpointsreferfriends')->__('Products subselection')), array('value' => 'rewardpointsreferfriends/rule_condition_combine', 'label' => Mage::helper('rewardpointsreferfriends')->__('Conditions combination')), array('value' => $attributes, 'label' => Mage::helper('rewardpointsreferfriends')->__('Cart Order Attribute'))));
     $additional = new Varien_Object();
     Mage::dispatchEvent('rewardpointsreferfriends_rule_condition_combine', array('additional' => $additional));
     if ($additionalConditions = $additional->getConditions()) {
         $conditions = array_merge_recursive($conditions, $additionalConditions);
     }
     return $conditions;
 }
Example #4
0
 public function getNewChildSelectOptions()
 {
     $addressCondition = Mage::getModel('Mage_SalesRule_Model_Rule_Condition_Address');
     $addressAttributes = $addressCondition->loadAttributeOptions()->getAttributeOption();
     $attributes = array();
     foreach ($addressAttributes as $code => $label) {
         $attributes[] = array('value' => 'Mage_SalesRule_Model_Rule_Condition_Address|' . $code, 'label' => $label);
     }
     $conditions = parent::getNewChildSelectOptions();
     $conditions = array_merge_recursive($conditions, array(array('value' => 'Mage_SalesRule_Model_Rule_Condition_Product_Found', 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Product attribute combination')), array('value' => 'Mage_SalesRule_Model_Rule_Condition_Product_Subselect', 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Products subselection')), array('value' => 'Mage_SalesRule_Model_Rule_Condition_Combine', 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Conditions combination')), array('label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Cart Attribute'), 'value' => $attributes)));
     $additional = new Varien_Object();
     Mage::dispatchEvent('salesrule_rule_condition_combine', array('additional' => $additional));
     if ($additionalConditions = $additional->getConditions()) {
         $conditions = array_merge_recursive($conditions, $additionalConditions);
     }
     return $conditions;
 }
Example #5
0
 public function getNewChildSelectOptions()
 {
     $addressCondition = Mage::getModel('salesrule/rule_condition_address');
     $addressAttributes = $addressCondition->loadAttributeOptions()->getAttributeOption();
     $attributes = array();
     foreach ($addressAttributes as $code => $label) {
         $attributes[] = array('value' => 'salesrule/rule_condition_address|' . $code, 'label' => $label);
     }
     $conditions = parent::getNewChildSelectOptions();
     $conditions = array_merge_recursive($conditions, array(array('value' => 'amacart/rule_condition_carts', 'label' => Mage::helper('amacart')->__('Number of recovered cards this month')), array('value' => 'salesrule/rule_condition_product_subselect', 'label' => Mage::helper('salesrule')->__('Products subselection')), array('value' => $this->getType(), 'label' => Mage::helper('salesrule')->__('Conditions combination')), array('label' => Mage::helper('salesrule')->__('Cart Attribute'), 'value' => $attributes)));
     $additional = new Varien_Object();
     Mage::dispatchEvent('salesrule_rule_condition_combine', array('additional' => $additional));
     if ($additionalConditions = $additional->getConditions()) {
         $conditions = array_merge_recursive($conditions, $additionalConditions);
     }
     return $conditions;
 }
 public function getNewChildSelectOptions()
 {
     $addressCondition = Mage::getModel('hipay/rule_condition_address');
     $addressAttributes = $addressCondition->loadAttributeOptions()->getAttributeOption();
     $attributes = array();
     foreach ($addressAttributes as $code => $label) {
         $attributes[] = array('value' => 'hipay/rule_condition_address|' . $code . '|' . $this->getPaymentMethodCode(), 'label' => $label);
     }
     $customerCondition = Mage::getModel('hipay/rule_condition_customer');
     $customerAttributes = $customerCondition->loadAttributeOptions()->getAttributeOption();
     $cAttributes = array();
     foreach ($customerAttributes as $code => $label) {
         $cAttributes[] = array('value' => 'hipay/rule_condition_customer|' . $code . '|' . $this->getPaymentMethodCode(), 'label' => $label);
     }
     $conditions = parent::getNewChildSelectOptions();
     $conditions = array_merge_recursive($conditions, array(array('value' => 'hipay/rule_condition_product_found||' . $this->getPaymentMethodCode(), 'label' => Mage::helper('salesrule')->__('Product attribute combination')), array('value' => 'hipay/rule_condition_product_subselect||' . $this->getPaymentMethodCode(), 'label' => Mage::helper('salesrule')->__('Products subselection')), array('value' => 'hipay/rule_condition_combine||' . $this->getPaymentMethodCode(), 'label' => Mage::helper('salesrule')->__('Conditions combination')), array('label' => Mage::helper('hipay')->__('Order Attribute'), 'value' => $attributes), array('label' => Mage::helper('hipay')->__('Customer Attribute'), 'value' => $cAttributes)));
     $additional = new Varien_Object();
     Mage::dispatchEvent('hipay_rule_condition_combine', array('additional' => $additional));
     if ($additionalConditions = $additional->getConditions()) {
         $conditions = array_merge_recursive($conditions, $additionalConditions);
     }
     return $conditions;
 }
 /**
  * @return array
  */
 public function getNewChildSelectOptions()
 {
     $addressAttributes = array();
     $addressAttributesBilling = array();
     $addressAttributesShipping = array();
     $addressAttributesTmp = Mage::getModel('salesrule/rule_condition_address')->loadAttributeOptions()->getAttributeOption();
     // only base_subtotal, total_qty, weight
     if (isset($addressAttributesTmp['base_subtotal'])) {
         $addressAttributes['base_subtotal'] = $addressAttributesTmp['base_subtotal'];
     }
     if (isset($addressAttributesTmp['total_qty'])) {
         $addressAttributes['total_qty'] = $addressAttributesTmp['total_qty'];
     }
     if (isset($addressAttributesTmp['weight'])) {
         $addressAttributes['weight'] = $addressAttributesTmp['weight'];
     }
     $addressAttributesTmp = Mage::getModel('mageworx_multifees/fee_condition_address_billing')->loadAttributeOptions()->getAttributeOption();
     if (isset($addressAttributesTmp['postcode'])) {
         $addressAttributesBilling['postcode'] = $addressAttributesTmp['postcode'];
     }
     if (isset($addressAttributesTmp['region'])) {
         $addressAttributesBilling['region'] = $addressAttributesTmp['region'];
     }
     if (isset($addressAttributesTmp['country_id'])) {
         $addressAttributesBilling['country_id'] = $addressAttributesTmp['country_id'];
     }
     if (isset($addressAttributesTmp['region_id'])) {
         $addressAttributesBilling['region_id'] = $addressAttributesTmp['region_id'];
     }
     $addressAttributesTmp = Mage::getModel('mageworx_multifees/fee_condition_address_shipping')->loadAttributeOptions()->getAttributeOption();
     if (isset($addressAttributesTmp['postcode'])) {
         $addressAttributesShipping['postcode'] = $addressAttributesTmp['postcode'];
     }
     if (isset($addressAttributesTmp['region'])) {
         $addressAttributesShipping['region'] = $addressAttributesTmp['region'];
     }
     if (isset($addressAttributesTmp['country_id'])) {
         $addressAttributesShipping['country_id'] = $addressAttributesTmp['country_id'];
     }
     if (isset($addressAttributesTmp['region_id'])) {
         $addressAttributesShipping['region_id'] = $addressAttributesTmp['region_id'];
     }
     $attributes = array();
     foreach ($addressAttributes as $code => $label) {
         $attributes[] = array('value' => 'salesrule/rule_condition_address|' . $code, 'label' => $label);
     }
     foreach ($addressAttributesBilling as $code => $label) {
         $attributes[] = array('value' => 'mageworx_multifees/fee_condition_address_billing|' . $code, 'label' => $label);
     }
     foreach ($addressAttributesShipping as $code => $label) {
         $attributes[] = array('value' => 'mageworx_multifees/fee_condition_address_shipping|' . $code, 'label' => $label);
     }
     $conditions = parent::getNewChildSelectOptions();
     $conditions = array_merge_recursive($conditions, array(array('value' => 'mageworx_multifees/fee_condition_product_found', 'label' => Mage::helper('salesrule')->__('Product attribute combination')), array('value' => 'mageworx_multifees/fee_condition_combine', 'label' => Mage::helper('salesrule')->__('Conditions combination')), array('label' => Mage::helper('salesrule')->__('Cart Attribute'), 'value' => $attributes)));
     $additional = new Varien_Object();
     Mage::dispatchEvent('salesrule_rule_condition_combine', array('additional' => $additional));
     if ($additionalConditions = $additional->getConditions()) {
         $conditions = array_merge_recursive($conditions, $additionalConditions);
     }
     return $conditions;
 }
Example #8
0
 /**
  * Get conditions selectors
  *
  * @return array
  */
 public function getNewChildOptions()
 {
     $conditions = ['' => $this->translate('Please choose a condition to add...')];
     // Add self reference for recursive combinations
     $conditions[$this->getSelfType()] = $this->translate($this->getName());
     // Fire an event to add additional conditions
     $container = new Varien_Object();
     Mage::dispatchEvent('aoe_fraudmanager_rule_condition_combine_additional', ['parent' => $this, 'container' => $container]);
     if ($additional = $container->getConditions()) {
         $conditions = array_merge($conditions, $additional);
     }
     return $conditions;
 }