當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Varien_Object::setValue方法代碼示例

本文整理匯總了PHP中Varien_Object::setValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Object::setValue方法的具體用法?PHP Varien_Object::setValue怎麽用?PHP Varien_Object::setValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Varien_Object的用法示例。


在下文中一共展示了Varien_Object::setValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initTotals

 public function initTotals()
 {
     $parent = $this->getParentBlock();
     $paymentMethod = $parent->getOrder()->getPayment()->getMethodInstance()->getCode();
     if (!in_array($paymentMethod, self::$_allowed_methods)) {
         return $this;
     }
     if ($parent->getOrder()->getBasePayexPaymentFeeTax()) {
         $total = new Varien_Object();
         $total->setLabel(Mage::helper('payex')->__('Payment fee (Incl.Tax)'));
         $total->setValue($parent->getOrder()->getPayexPaymentFee() + $parent->getOrder()->getPayexPaymentFeeTax());
         $total->setBaseValue($parent->getOrder()->getPayexBasePaymentFee() + $parent->getOrder()->getPayexBasePaymentFeeTax());
         $total->setCode('payex_payment_fee_with_tax');
         $parent->addTotalBefore($total, 'tax');
     }
     if ($parent->getOrder()->getBasePayexPaymentFee()) {
         $total = new Varien_Object();
         $total->setLabel(Mage::helper('payex')->__('Payment fee (Excl.Tax)'));
         $total->setValue($parent->getOrder()->getPayexPaymentFee());
         $total->setBaseValue($parent->getOrder()->getPayexBasePaymentFee());
         $total->setCode('payex_payment_fee');
         $parent->addTotalBefore($total, 'payex_payment_fee_with_tax');
     }
     return $this;
 }
開發者ID:AndreKlang,項目名稱:Magento-Payex,代碼行數:25,代碼來源:Fee.php

示例2: _getParams

 /**
  * @return mixed
  */
 protected function _getParams()
 {
     if (!Mage::registry(self::REGISTRY_KEY_PARAMS)) {
         $request = Mage::app()->getRequest();
         $params = array('host' => $request->getServer('HTTP_HOST'), 'port' => $request->getServer('SERVER_PORT'), 'full_action_name' => $this->getFullActionName());
         $uriParams = $this->_getUriParams();
         foreach ($request->getParams() as $requestParam => $requestParamValue) {
             if (!$requestParamValue) {
                 continue;
             }
             foreach ($uriParams as $uriParam) {
                 if ($this->_matchUriParam($uriParam, $requestParam)) {
                     $params['uri_' . $requestParam] = $requestParamValue;
                     break;
                 }
             }
         }
         if (Mage::getStoreConfig(self::XML_PATH_CUSTOMER_GROUPS)) {
             $customerSession = Mage::getSingleton('customer/session');
             $params['customer_group_id'] = $customerSession->getCustomerGroupId();
         }
         // edit parameters via event
         $parameters = new Varien_Object();
         $parameters->setValue($params);
         Mage::dispatchEvent('fpc_helper_collect_params', array('parameters' => $parameters));
         $params = $parameters->getValue();
         Mage::register(self::REGISTRY_KEY_PARAMS, serialize($params));
     }
     return Mage::registry(self::REGISTRY_KEY_PARAMS);
 }
開發者ID:nessnik,項目名稱:Lesti_Fpc,代碼行數:33,代碼來源:Data.php

示例3: initTotals

 public function initTotals()
 {
     $parent = $this->getParentBlock();
     $this->_invoice = $parent->getInvoice();
     if ($this->_invoice->getCodFee()) {
         $cod = new Varien_Object();
         $cod->setLabel($this->__('Cash on Delivery fee'));
         $cod->setValue($this->_invoice->getCodFee());
         $cod->setBaseValue($this->_invoice->getBaseCodFee());
         $cod->setCode('cod_fee');
         if (Mage::helper('cashondelivery')->displayCodBothPrices()) {
             $cod->setLabel($this->__('Cash on Delivery fee (Excl.Tax)'));
             $codIncl = new Varien_Object();
             $codIncl->setLabel($this->__('Cash on Delivery fee (Incl.Tax)'));
             $codIncl->setValue($this->_invoice->getCodFee() + $this->_invoice->getCodTaxAmount());
             $codIncl->setBaseValue($this->_invoice->getBaseCodFee() + $this->_invoice->getBaseCodTaxAmount());
             $codIncl->setCode('cod_fee_incl');
             $parent->addTotalBefore($cod, 'tax');
             $parent->addTotalBefore($codIncl, 'tax');
         } elseif (Mage::helper('cashondelivery')->displayCodFeeIncludingTax()) {
             $cod->setValue($this->_invoice->getCodFee() + $this->_invoice->getCodTaxAmount());
             $cod->setBaseValue($this->_invoice->getBaseCodFee() + $this->_invoice->getBaseCodTaxAmount());
             $parent->addTotalBefore($cod, 'tax');
         } else {
             $parent->addTotalBefore($cod, 'tax');
         }
     }
     return $this;
 }
開發者ID:liemnv,項目名稱:Groupon-Clone-On-Magento,代碼行數:29,代碼來源:Cod.php

示例4: initTotals

 public function initTotals()
 {
     if ($this->giftwrapAmount() > 0) {
         $total = new Varien_Object();
         $total->setCode('giftwrap');
         $total->setValue($this->giftwrapAmount());
         $total->setBaseValue(0);
         $total->setLabel('Gift wrap');
         $parent = $this->getParentBlock();
         $parent->addTotal($total, 'subtotal');
     }
 }
開發者ID:technomagegithub,項目名稱:colb2b,代碼行數:12,代碼來源:Giftwrap.php

示例5: addToBlock

 public function addToBlock($block)
 {
     $order = $block->getOrder();
     $label = Mage::getStoreConfig('payment/' . $order->getPayment()->getMethod() . '/surcharge_label');
     $fee = new Varien_Object();
     $fee->setCode('surcharge_incl');
     $fee->setLabel($label);
     $fee->setBaseValue(10);
     $fee->setValue(11);
     $block->addTotalBefore($fee, 'shipping');
     return $block;
 }
開發者ID:paynl,項目名稱:magento-plugin,代碼行數:12,代碼來源:Total.php

示例6: initTotals

 public function initTotals()
 {
     if ($this->discountAmount() != 0) {
         $total = new Varien_Object();
         $total->setCode('webposdiscount');
         $total->setValue(-$this->discountAmount());
         $total->setBaseValue(0);
         $total->setLabel('Discount(Admin)');
         $parent = $this->getParentBlock();
         $parent->addTotal($total, 'subtotal');
     }
 }
開發者ID:cabrerabywaters,項目名稱:magentoSunshine,代碼行數:12,代碼來源:Discount.php

示例7: setChildsBasedOnGroup

 /**
  * @param $group Webguys_Easytemplate_Model_Group
  * @return $this
  */
 public function setChildsBasedOnGroup($group, $parent = null)
 {
     if (!$this->countChildren()) {
         Varien_Profiler::start('easytemplate_template_rendering');
         /** @var $configModel Webguys_Easytemplate_Model_Input_Parser */
         $configModel = Mage::getSingleton('easytemplate/input_parser');
         $position = 1;
         $time = Mage::app()->getLocale()->storeTimeStamp(Mage::app()->getStore()->getId());
         /** @var $template Webguys_Easytemplate_Model_Template */
         foreach ($group->getTemplateCollection($parent) as $template) {
             $templateCode = $template->getCode();
             if ($model = $configModel->getTemplate($templateCode)) {
                 $active = $template->getActive();
                 $validFrom = $template->getValidFrom() ? strtotime($template->getValidFrom()) : false;
                 $validTo = $template->getValidTo() ? strtotime($template->getValidTo()) : false;
                 if ($validFrom !== false || $validTo !== false) {
                     $this->_cachingAllowed = false;
                 }
                 Varien_Profiler::start('easytemplate_template_rendering_' . $templateCode);
                 if ($active && (!$validFrom || $validFrom <= $time) && (!$validTo || $validTo >= $time)) {
                     /** @var $childBlock Webguys_Easytemplate_Block_Template */
                     $childBlock = $this->getLayout()->createBlock($model->getType());
                     $childBlock->setTemplate($model->getTemplate());
                     $childBlock->setTemplateModel($template);
                     $childBlock->setTemplateCode($templateCode);
                     $childBlock->setGroup($group);
                     /** @var $field Webguys_Easytemplate_Model_Input_Parser_Field */
                     foreach ($model->getFields() as $field) {
                         $fieldCode = $field->getCode();
                         Varien_Profiler::start('easytemplate_template_rendering_' . $templateCode . '_field_' . $fieldCode);
                         /** @var $inputValidator Webguys_Easytemplate_Model_Input_Renderer_Validator_Base */
                         $inputValidator = $field->getInputRendererValidator();
                         $inputValidator->setTemplate($template);
                         $inputValidator->setField($field);
                         $frontendValue = $inputValidator->prepareForFrontend($template->getFieldData($fieldCode));
                         if ($frontendValue) {
                             $valueTransport = new Varien_Object();
                             $valueTransport->setValue($frontendValue);
                             Mage::dispatchEvent('easytemplate_frontend_prepared_var', array('template' => $template, 'template_model' => $model, 'field' => $field, 'block' => $childBlock, 'validator' => $inputValidator, 'value' => $valueTransport));
                             $childBlock->setData($fieldCode, $valueTransport->getValue());
                         }
                         Varien_Profiler::stop('easytemplate_template_rendering_' . $templateCode . '_field_' . $fieldCode);
                     }
                     $this->setChild('block_' . $position . '_' . $templateCode, $childBlock);
                     $position++;
                 }
                 Varien_Profiler::stop('easytemplate_template_rendering_' . $templateCode);
             }
         }
         Varien_Profiler::stop('easytemplate_template_rendering');
     }
     return $this;
 }
開發者ID:EliasKotlyar,項目名稱:EasyTemplate,代碼行數:57,代碼來源:Renderer.php

示例8: initTotals

 public function initTotals()
 {
     $parent = $this->getParentBlock();
     if ($this->_invoice->getCodFee()) {
         $cod = new Varien_Object();
         $cod->setLabel($this->__('Refund Cash on Delivery fee'));
         $cod->setValue($parent->getSource()->getCodFee());
         $cod->setBaseValue($parent->getSource()->getBaseCodFee());
         $cod->setCode('cod_fee');
         $parent->addTotalBefore($cod, 'adjustment_positive');
     }
     return $this;
 }
開發者ID:codercv,項目名稱:urbansurprisedev,代碼行數:13,代碼來源:Cod.php

示例9: initTotals

 public function initTotals()
 {
     $amount = $this->getAffiliateplusDiscount();
     if (floatval($amount)) {
         $total = new Varien_Object();
         $total->setCode('affiliateplus_discount');
         $total->setValue($amount);
         $total->setBaseValue($this->getBaseAffiliateplusDiscount());
         $total->setLabel('Affiliate Discount' . $this->getAffiliateCouponLabel());
         $parent = $this->getParentBlock();
         $parent->addTotal($total, 'subtotal');
     }
 }
開發者ID:billadams,項目名稱:forever-frame,代碼行數:13,代碼來源:Ordertotalaffiliate.php

示例10: initTotals

 public function initTotals()
 {
     // var_dump($this->discountAmount());
     if ($this->discountAmount() != 0) {
         $total = new Varien_Object();
         $total->setCode('onestepcheckoutdiscount');
         $total->setValue(-$this->discountAmount());
         $total->setBaseValue(-$this->baseDiscountAmout());
         $total->setLabel('Discount(Admin)');
         $parent = $this->getParentBlock();
         $parent->addTotal($total, 'subtotal');
     }
 }
開發者ID:ausger,項目名稱:onestepcheckout-v340,代碼行數:13,代碼來源:Discount.php

示例11: initTotals

 public function initTotals()
 {
     $amount = $this->getLuckydrawDiscount();
     if (floatval($amount)) {
         $total = new Varien_Object();
         $total->setCode('luckydraw_discount');
         $total->setValue($amount);
         $total->setBaseValue($this->getBaseLuckydrawDiscount());
         $total->setLabel('Lucky Draw Discount');
         $parent = $this->getParentBlock();
         $parent->addTotal($total, 'subtotal');
     }
 }
開發者ID:xiaoguizhidao,項目名稱:magento,代碼行數:13,代碼來源:Luckydrawtotal.php

示例12: initTotals

 /**
  * add fee to order detail view
  *
  * @return $this
  */
 public function initTotals()
 {
     $parent = $this->getParentBlock();
     $this->_order = $parent->getOrder();
     if ($this->_order->getShopgatePaymentFee()) {
         $fee = new Varien_Object();
         $fee->setLabel($this->__('Payment Fee'));
         $fee->setValue($this->_order->getShopgatePaymentFee());
         $fee->setBaseValue($this->_order->getBaseShopgatePaymentFee());
         $fee->setCode($this->getCode());
         $parent->addTotalBefore($fee, 'tax');
     }
     return $this;
 }
開發者ID:buttasg,項目名稱:cowgirlk,代碼行數:19,代碼來源:AbstractPaymentFee.php

示例13: initTotals

 public function initTotals()
 {
     $parent = $this->getParentBlock();
     if ($parent->getSource()) {
         $fee = new Varien_Object();
         $fee->setLabel($this->__('Refund Payment fee'));
         $fee->setValue($parent->getSource()->getCapayableFee());
         $fee->setBaseValue($parent->getSource()->getBaseCapayableFee());
         $fee->setCode('payment_fee');
         $fee->setBlockName('capayable_fee');
         $parent->addTotalBefore($fee, 'adjustment_positive');
     }
     return $this;
 }
開發者ID:blueglobeNL,項目名稱:tritac-capayable,代碼行數:14,代碼來源:Fee.php

示例14: testFpcHelperCollectParams

 /**
  * @test
  * @loadFixture fpc_helper_collect_params.yaml
  */
 public function testFpcHelperCollectParams()
 {
     Mage::app()->getRequest()->setRouteName('catalog');
     Mage::app()->getRequest()->setControllerName('category');
     Mage::app()->getRequest()->setActionName('view');
     /** @var Mage_Catalog_Model_Session $catalogSession */
     $catalogSession = Mage::getSingleton('catalog/session');
     $catalogSession->setData('fpc', 'cool');
     $expectedResult = array('fpc' => 'cool', 'store' => Mage::app()->getStore(true)->getCode(), 'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(), 'design' => Mage::getDesign()->getPackageName() . '_' . Mage::getDesign()->getTheme('template'), 'session_fpc' => 'cool');
     $params = array('fpc' => 'cool');
     $object = new Varien_Object();
     $object->setValue($params);
     Mage::dispatchEvent('fpc_helper_collect_params', array('parameters' => $object));
     $this->assertEquals($expectedResult, $object->getValue());
 }
開發者ID:AndreKlang,項目名稱:Lesti_Fpc,代碼行數:19,代碼來源:Parameters.php

示例15: initTotals

 public function initTotals()
 {
     $parent = $this->getParentBlock();
     if ($parent->getOrder()->getPayment()->getMethodInstance()->getCode() !== 'factoring') {
         return $this;
     }
     if ($parent->getOrder()->getBaseFactoringPaymentFee()) {
         $total = new Varien_Object();
         $total->setLabel($this->__('Payment fee'));
         $total->setValue($parent->getOrder()->getFactoringPaymentFee());
         $total->setBaseValue($parent->getOrder()->getFactoringBasePaymentFee());
         $total->setCode('factoring_payment_fee');
         $parent->addTotalBefore($total, 'tax');
     }
     return $this;
 }
開發者ID:AndreKlang,項目名稱:Payex-Modules-Test,代碼行數:16,代碼來源:Fee.php


注:本文中的Varien_Object::setValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。