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


PHP Mage_XmlConnect_Model_Simplexml_Element::xmlAttribute方法代码示例

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


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

示例1: _addValue

 /**
  * Add value and options to select
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Form_Element_Select
  */
 protected function _addValue(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     $value = $this->getEscapedValue();
     if ($value !== null) {
         $xmlObj->addAttribute('value', $xmlObj->xmlAttribute($value));
     }
     $this->_addOptions($xmlObj);
     return $this;
 }
开发者ID:Airmal,项目名称:Magento-Em,代码行数:15,代码来源:Select.php

示例2: addPaymentInfoToXmlObj

 /**
  * Add CC Save Payment info to order XML object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Element
  */
 public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
 {
     $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
     $orderItemXmlObj->addAttribute('title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle()));
     if ($_specificInfo = $this->getSpecificInformation()) {
         foreach ($_specificInfo as $label => $value) {
             $orderItemXmlObj->addCustomChild('item', implode($this->getValueAsArray($value, true), '\\n'), array('label' => $label));
         }
     }
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:16,代码来源:Verisign.php

示例3: addPaymentInfoToXmlObj

 /**
  * Add Check / Money order info to order XML object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Element
  */
 public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
 {
     $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
     $orderItemXmlObj->addAttribute('title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle()));
     if ($this->getInfo()->getAdditionalData()) {
         if ($this->getPayableTo()) {
             $orderItemXmlObj->addCustomChild('item', $this->getPayableTo(), array('label' => Mage::helper('sales')->__('Make Check payable to:')));
         }
         if ($this->getMailingAddress()) {
             $orderItemXmlObj->addCustomChild('item', $this->getMailingAddress(), array('label' => Mage::helper('payment')->__('Send Check to:')));
         }
     }
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:19,代码来源:Checkmo.php

示例4: addPaymentInfoToXmlObj

 /**
  * Add Authorizenet info to order XML object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Element
  */
 public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
 {
     $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
     if (!$this->getHideTitle()) {
         $orderItemXmlObj->addAttribute('title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle()));
     }
     $cards = $this->getCards();
     $showCount = count($cards) > 1;
     foreach ($cards as $key => $card) {
         $creditCard = $orderItemXmlObj->addCustomChild('item', null, array('label' => $showCount ? $this->__('Credit Card %s', $key + 1) : $this->__('Credit Card')));
         foreach ($card as $label => $value) {
             $creditCard->addCustomChild('item', implode($this->getValueAsArray($value, true), '\\n'), array('label' => $label));
         }
     }
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:21,代码来源:Authorizenet.php

示例5: addPaymentInfoToXmlObj

 /**
  * Add Check / Money order info to order XML object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Element
  */
 public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
 {
     $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
     $orderItemXmlObj->addAttribute('title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle()));
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:11,代码来源:Free.php

示例6: _addMessage

 /**
  * Add validator message for validator rule
  *
  * @throws Mage_Core_Exception
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Form_Abstract
  */
 protected function _addMessage(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     if ($this->getMessage()) {
         $message = $this->getMessage();
     } elseif (array_key_exists($this->getType(), $this->getValidatorTypeMessages())) {
         $message = $this->_validatorTypeMessages[$this->getType()];
     } else {
         Mage::throwException(Mage::helper('xmlconnect')->__('"message" attribute is required for "%s" validator rule.', $this->getType()));
     }
     $xmlObj->addAttribute('message', $xmlObj->xmlAttribute($message));
     return $this;
 }
开发者ID:blazeriaz,项目名称:youguess,代码行数:19,代码来源:Abstract.php

示例7: _addPaymentMethodInfoToXmlObj

 /**
  * Add payment method info to order xml object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Element
  */
 protected function _addPaymentMethodInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderXmlObj)
 {
     $order = $this->_getOrder();
     // TODO: it's need to create an info blocks for other payment methods (including Enterprise)
     $method = $this->helper('payment')->getInfoBlock($order->getPayment())->getMethod();
     $methodCode = $method->getCode();
     $paymentNode = $orderXmlObj->addChild('payment_method');
     if (in_array($methodCode, $this->_methodArray, true)) {
         $currentBlockRenderer = 'xmlconnect/checkout_payment_method_info_' . $methodCode;
         $currentBlockName = 'xmlconnect.checkout.payment.method.info.' . $methodCode;
         $this->getLayout()->addBlock($currentBlockRenderer, $currentBlockName);
         $this->setChild($methodCode, $currentBlockName);
         $renderer = $this->getChild($methodCode)->setInfo($order->getPayment());
         $renderer->addPaymentInfoToXmlObj($paymentNode);
     } else {
         $paymentNode->addAttribute('type', $methodCode);
         $paymentNode->addAttribute('title', $orderXmlObj->xmlAttribute($method->getTitle()));
         $this->setInfo($order->getPayment());
         $specificInfo = array_merge((array) $order->getPayment()->getAdditionalInformation(), (array) $this->getSpecificInformation());
         if (!empty($specificInfo)) {
             foreach ($specificInfo as $label => $value) {
                 if ($value) {
                     $paymentNode->addCustomChild('item', implode($this->getValueAsArray($value, true), '\\n'), array('label' => $label));
                 }
             }
         }
     }
     return $orderXmlObj;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:35,代码来源:Details.php

示例8: _addValue

 /**
  * Add value to element
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract
  */
 protected function _addValue(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     if ($this->getEscapedValue()) {
         $xmlObj->addAttribute('value', $xmlObj->xmlAttribute($this->getEscapedValue()));
     }
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:13,代码来源:Abstract.php

示例9: addCartProductsToXmlObj


//.........这里部分代码省略.........
         }
         $exclPrice = Mage::helper('xmlconnect')->formatPriceForXml($exclPrice);
         $paypalPrice = Mage::helper('xmlconnect')->formatPriceForXml($item->getCalculationPrice());
         $formattedExclPrice = $quote->getStore()->formatPrice($exclPrice, false);
         $inclPrice = Mage::helper('xmlconnect')->formatPriceForXml($inclPrice);
         $formattedInclPrice = $quote->getStore()->formatPrice($inclPrice, false);
         $priceXmlObj = $pricesXmlObj->addCustomChild('prices', null, array('id' => 'price'));
         if ($this->helper('tax')->displayCartBothPrices()) {
             $priceXmlObj->addCustomChild('price', $exclPrice, array('id' => 'excluding_tax', 'label' => $this->__('Excl. Tax'), 'formatted_value' => $formattedExclPrice));
             $priceXmlObj->addCustomChild('price', $inclPrice, array('id' => 'including_tax', 'label' => $this->__('Incl. Tax'), 'formatted_value' => $formattedInclPrice));
         } else {
             if ($this->helper('tax')->displayCartPriceExclTax()) {
                 $priceXmlObj->addCustomChild('price', $exclPrice, array('id' => 'regular', 'label' => $this->__('Unit Price'), 'formatted_value' => $formattedExclPrice));
             }
             if ($this->helper('tax')->displayCartPriceInclTax()) {
                 $priceXmlObj->addCustomChild('price', $inclPrice, array('id' => 'regular', 'label' => $this->__('Unit Price'), 'formatted_value' => $formattedInclPrice));
             }
         }
         /**
          * Info for paypal MEP if it's enabled
          */
         $appConfig = Mage::helper('xmlconnect')->getApplication()->loadConfiguration()->getRenderConf();
         $isMepActive = $appConfig['paypal']['isActive'];
         $paypalMepIsAvailable = Mage::getModel('xmlconnect/payment_method_paypal_mep')->isAvailable(null);
         if ($paypalMepIsAvailable && $isMepActive) {
             $paypalPriceXmlObj = $pricesXmlObj->addCustomChild('prices', null, array('id' => 'paypal'));
             $paypalPriceXmlObj->addCustomChild('price', $paypalPrice, array('id' => 'regular', 'label' => $this->__('Unit Price'), 'formatted_value' => $quote->getStore()->formatPrice($paypalPrice, false)));
             $paypalSubtotalPrice = Mage::helper('xmlconnect')->formatPriceForXml($item->getRowTotal());
             $paypalPriceXmlObj->addCustomChild('price', $paypalSubtotalPrice, array('id' => 'subtotal', 'label' => $this->__('Subtotal'), 'formatted_value' => $quote->getStore()->formatPrice($paypalSubtotalPrice, false)));
         }
         /**
          * Subtotal
          */
         $subtotalExclTax = $subtotalInclTax = 0;
         if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()) {
             if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales') && $item->getWeeeTaxAppliedAmount()) {
                 $subtotalExclTax = $item->getRowTotal() + $item->getWeeeTaxAppliedRowAmount() + $item->getWeeeTaxRowDisposition();
             } else {
                 $subtotalExclTax = $item->getRowTotal();
             }
         }
         if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()) {
             $incl = $this->helper('checkout')->getSubtotalInclTax($item);
             if (Mage::helper('weee')->typeOfDisplay($item, array(0, 1, 4), 'sales') && $item->getWeeeTaxAppliedAmount()) {
                 $subtotalInclTax = $incl + $item->getWeeeTaxAppliedRowAmount();
             } else {
                 $subtotalInclTax = $incl - $item->getWeeeTaxRowDisposition();
             }
         }
         $subtotalExclTax = Mage::helper('xmlconnect')->formatPriceForXml($subtotalExclTax);
         $formattedSubtotalExcl = $quote->getStore()->formatPrice($subtotalExclTax, false);
         $subtotalInclTax = Mage::helper('xmlconnect')->formatPriceForXml($subtotalInclTax);
         $formattedSubtotalIncl = $quote->getStore()->formatPrice($subtotalInclTax, false);
         $priceXmlObj = $pricesXmlObj->addCustomChild('prices', null, array('id' => 'subtotal'));
         if ($this->helper('tax')->displayCartBothPrices()) {
             $priceXmlObj->addCustomChild('price', $subtotalExclTax, array('id' => 'excluding_tax', 'label' => $this->__('Subtotal Excl. Tax'), 'formatted_value' => $formattedSubtotalExcl));
             $priceXmlObj->addCustomChild('price', $subtotalInclTax, array('id' => 'including_tax', 'label' => $this->__('Subtotal Incl. Tax'), 'formatted_value' => $formattedSubtotalIncl));
         } else {
             if ($this->helper('tax')->displayCartPriceExclTax()) {
                 $priceXmlObj->addCustomChild('price', $subtotalExclTax, array('id' => 'regular', 'label' => $this->__('Subtotal'), 'formatted_value' => $formattedSubtotalExcl));
             }
             if ($this->helper('tax')->displayCartPriceInclTax()) {
                 $priceXmlObj->addCustomChild('price', $subtotalInclTax, array('id' => 'regular', 'label' => $this->__('Subtotal'), 'formatted_value' => $formattedSubtotalIncl));
             }
         }
         /**
          * Options list
          */
         $options = $renderer->getOptionList();
         if ($options) {
             $itemOptionsXml = $itemXml->addCustomChild('options');
             foreach ($options as $_option) {
                 $formattedOptionValue = $renderer->getFormatedOptionValue($_option);
                 $itemOptionsXml->addCustomChild('option', null, array('label' => $xmlObject->xmlAttribute($_option['label']), 'text' => $xmlObject->xmlAttribute($formattedOptionValue['value'])));
             }
         }
         /**
          * Downloadable products
          */
         $links = $renderer->getLinks();
         if ($links) {
             $itemOptionsXml = $itemXml->addCustomChild('options', null, array('label' => $renderer->getLinksTitle()));
             foreach ($links as $link) {
                 $itemOptionsXml->addCustomChild('option', null, array('label' => $link->getTitle()));
             }
         }
         /**
          * Item messages
          */
         $messages = $renderer->getMessages();
         if ($messages) {
             $itemMessagesXml = $itemXml->addCustomChild('messages');
             foreach ($messages as $message) {
                 $messageXml = $itemMessagesXml->addCustomChild('option');
                 $messageXml->addCustomChild('type', $message['type']);
                 $messageXml->addCustomChild('text', $xmlObject->escapeXml($message['text']));
             }
         }
     }
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:101,代码来源:Items.php

示例10: _addName

 /**
  * Add form name to element
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Form_Abstract
  */
 protected function _addName(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     if ($this->getName()) {
         $name = $this->getName();
     } elseif ($this->getNameRequired()) {
         $name = $this->getXmlId();
     }
     if (isset($name)) {
         $xmlObj->addAttribute('name', $xmlObj->xmlAttribute($name));
     }
     return $this;
 }
开发者ID:blazeriaz,项目名称:youguess,代码行数:18,代码来源:Abstract.php

示例11: addPaymentInfoToXmlObj

 /**
  * Add Purchase Order Payment info to order XML object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Element
  */
 public function addPaymentInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
 {
     $orderItemXmlObj->addAttribute('type', $this->getMethod()->getCode());
     $orderItemXmlObj->addAttribute('title', $orderItemXmlObj->xmlAttribute($this->getMethod()->getTitle()));
     $orderItemXmlObj->addCustomChild('item', $this->getInfo()->getPoNumber(), array('label' => Mage::helper('sales')->__('Purchase Order Number:')));
 }
开发者ID:okite11,项目名称:frames21,代码行数:12,代码来源:Purchaseorder.php


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