当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Event_Observer::getAdditional方法代码示例

本文整理汇总了PHP中Varien_Event_Observer::getAdditional方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Event_Observer::getAdditional方法的具体用法?PHP Varien_Event_Observer::getAdditional怎么用?PHP Varien_Event_Observer::getAdditional使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Event_Observer的用法示例。


在下文中一共展示了Varien_Event_Observer::getAdditional方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addFiltersToSalesRuleCombine

 /**
  * @event salesrule_rule_condition_combine
  * @param Varien_Event_Observer $observer
  * @return $this
  */
 public function addFiltersToSalesRuleCombine(Varien_Event_Observer $observer)
 {
     /** @noinspection PhpUndefinedMethodInspection */
     /** @var Varien_Object $additional */
     $additional = $observer->getAdditional();
     /** @noinspection PhpUndefinedMethodInspection */
     $conditions = $additional->getConditions() ?: array();
     $conditions = array_merge_recursive(array(array('label' => Mage::helper('adyen_subscription')->__('Adyen Subscription'), 'value' => array(array('label' => Mage::helper('adyen_subscription')->__('Product Subscription ID'), 'value' => 'adyen_subscription/salesRule_condition_productSubscription'), array('label' => Mage::helper('adyen_subscription')->__('Number of subscription order'), 'value' => 'adyen_subscription/salesRule_condition_quoteCount')))), $conditions);
     /** @noinspection PhpUndefinedMethodInspection */
     $additional->setConditions($conditions);
     return $this;
 }
开发者ID:sandermangel,项目名称:adyen-magento-subscription,代码行数:17,代码来源:Observer.php

示例2: addSegmentsToSalesRuleCombine

 /**
  * Add Customer Segment condition to the salesrule management
  *
  * @param Varien_Event_Observer $observer
  */
 public function addSegmentsToSalesRuleCombine(Varien_Event_Observer $observer)
 {
     if (!Mage::helper('enterprise_customersegment')->isEnabled()) {
         return;
     }
     $transport = $observer->getAdditional();
     $cond = $transport->getConditions();
     if (!is_array($cond)) {
         $cond = array();
     }
     $cond[] = array('value' => 'enterprise_customersegment/segment_condition_segment', 'label' => Mage::helper('enterprise_customersegment')->__('Customer Segment'));
     $transport->setConditions($cond);
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:18,代码来源:Observer.php

示例3: handleNewConditions

 /**
  * Adds new conditions
  * @param   Varien_Event_Observer $observer
  */
 public function handleNewConditions($observer)
 {
     $transport = $observer->getAdditional();
     $cond = $transport->getConditions();
     if (!is_array($cond)) {
         $cond = array();
     }
     $types = array('customer' => 'Customer attributes', 'orders' => 'Purchases history');
     foreach ($types as $typeCode => $typeLabel) {
         $condition = Mage::getModel('amrules/rule_condition_' . $typeCode);
         $conditionAttributes = $condition->loadAttributeOptions()->getAttributeOption();
         $attributes = array();
         foreach ($conditionAttributes as $code => $label) {
             $attributes[] = array('value' => 'amrules/rule_condition_' . $typeCode . '|' . $code, 'label' => $label);
         }
         $cond[] = array('value' => $attributes, 'label' => Mage::helper('amrules')->__($typeLabel));
     }
     $transport->setConditions($cond);
     return $this;
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:24,代码来源:Observer.php

示例4: onConditionCombine

 /**
  * Hook SalesRule condition combine and add extra conditions
  *
  * @param Varien_Event_Observer $observer
  * @return Varien_Event_Observer
  */
 public function onConditionCombine($observer)
 {
     /** @var RapidCampaign_Promotions_Helper_Config $configHelper */
     $configHelper = Mage::helper('rapidcampaign_promotions/config');
     // Module disabled
     if (!$configHelper->extensionEnabled()) {
         return $observer;
     }
     if (!Mage::registry('rapidcampaign/widget/created')) {
         return $observer;
     }
     /** @var RapidCampaign_Promotions_Model_Condition_Extra $extraCondition */
     $extraCondition = Mage::getModel('rapidcampaign_promotions/condition_extra');
     $extraAttributes = $extraCondition->loadAttributeOptions()->getAttributeOption();
     $attributes = array();
     foreach ($extraAttributes as $code => $label) {
         $attributes[] = array('value' => 'rapidcampaign_promotions/condition_extra|' . $code, 'label' => $label);
     }
     $additional = $observer->getAdditional();
     $conditions = (array) $additional->getConditions();
     $conditions = array_merge_recursive($conditions, $attributes);
     $additional->setConditions($conditions);
     $observer->setAdditional($additional);
     Mage::unregister('rapidcampaign/widget/created');
     return $observer;
 }
开发者ID:RapidCampaign,项目名称:rapid-magento-extension,代码行数:32,代码来源:Observer.php

示例5: addCheckoutAdditionalInformation

 /**
  * Add additional text to checkout review page if "cash on delivery" payment method is selected
  *
  * @param Varien_Event_Observer $observer
  * @event checkout_additional_information
  */
 public function addCheckoutAdditionalInformation(Varien_Event_Observer $observer)
 {
     /** @var $quote Mage_Sales_Model_Quote */
     $quote = Mage::getSingleton('checkout/session')->getQuote();
     if ($quote->getPayment()->getMethod() == 'cashondelivery') {
         $customText = $quote->getPayment()->getMethodInstance()->getCustomText();
         if ($customText) {
             $additionalObject = $observer->getAdditional();
             $text = (string) $additionalObject->getText();
             if ($text) {
                 $text .= '<br />';
             }
             $text .= $customText;
             $additionalObject->setText($text);
         }
     }
 }
开发者ID:thanakrit-promsiri,项目名称:GermanStoreConfig,代码行数:23,代码来源:Observer.php

示例6: addKeywordCondition

 public function addKeywordCondition(Varien_Event_Observer $observer)
 {
     $additional = $observer->getAdditional();
     $conditions = (array) $additional->getConditions();
     $additional->setConditions(array_merge_recursive($conditions, array(array('value' => 'autobuypromotions/rule_condition_keyword', 'label' => Mage::helper('autobuypromotions')->__('Keywords')))));
 }
开发者ID:outeredge,项目名称:edge-magento-module-autobuypromotions,代码行数:6,代码来源:SalesRule.php


注:本文中的Varien_Event_Observer::getAdditional方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。