本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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')))));
}