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


PHP Mage_XmlConnect_Model_Simplexml_Element::addCustomChild方法代码示例

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


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

示例1: 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

示例2: addToXmlObjectApi23

 /**
  * Add order total rendered to XML object. Api version 23
  *
  * @param $totalsXml Mage_XmlConnect_Model_Simplexml_Element
  * @return null
  */
 public function addToXmlObjectApi23(Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
 {
     $cards = $this->getGiftCards();
     if ($cards) {
         foreach ($cards as $card) {
             $label = Mage::helper('enterprise_giftcardaccount')->__('Gift Card (%s)', $card->getCode());
             $totalsXml->addCustomChild('item', '-' . $this->_formatPrice($card->getAmount()), array('id' => $this->getTotal()->getCode(), 'label' => $label));
         }
     } else {
         $cardsAmount = $this->getSource()->getGiftCardsAmount();
         if ($cardsAmount > 0) {
             $totalsXml->addCustomChild($this->getTotal()->getCode(), '-' . $this->_formatPrice($cardsAmount), array('label' => Mage::helper('enterprise_giftcardaccount')->__('Gift Card')));
         }
     }
 }
开发者ID:quyip8818,项目名称:Mag,代码行数:21,代码来源:Giftcards.php

示例3: addLastOrdersToXmlObj

 /**
  * Add last orders info to xml object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard_LastOrders
  */
 public function addLastOrdersToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     if (!Mage::helper('core')->isModuleEnabled('Mage_Reports')) {
         return $this;
     }
     /** @var $collection Mage_Reports_Model_Resource_Order_Collection */
     $collection = Mage::getResourceModel('reports/order_collection')->addItemCountExpr()->joinCustomerName('customer')->orderByCreatedAt()->setPageSize(self::LAST_ORDER_COUNT_LIMIT);
     foreach (Mage::helper('xmlconnect/adminApplication')->getSwitcherList() as $storeId) {
         if ($storeId) {
             $collection->addAttributeToFilter('store_id', $storeId);
             $collection->addRevenueToSelect();
         } else {
             $collection->addRevenueToSelect(true);
         }
         $this->setCollection($collection);
         $orderList = $this->_prepareColumns()->getCollection()->load();
         $valuesXmlObj = $xmlObj->addCustomChild('values', null, array('store_id' => $storeId ? $storeId : Mage_XmlConnect_Helper_AdminApplication::ALL_STORE_VIEWS));
         foreach ($orderList as $order) {
             $itemXmlObj = $valuesXmlObj->addCustomChild('item');
             $itemXmlObj->addCustomChild('customer', $order->getCustomer(), array('label' => $this->__('Customer')));
             $itemXmlObj->addCustomChild('items_count', $order->getItemsCount(), array('label' => $this->__('Items')));
             $currency_code = Mage::app()->getStore($storeId)->getBaseCurrencyCode();
             $itemXmlObj->addCustomChild('currency', Mage::app()->getLocale()->currency($currency_code)->toCurrency($order->getRevenue()), array('label' => $this->__('Grand Total')));
         }
         $collection->clear();
     }
     return $this;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:34,代码来源:LastOrders.php

示例4: _addOldStandardValue

 /**
  * Get values using old standard
  *
  * @deprecated old output standard
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
  */
 protected function _addOldStandardValue(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     $countries = $this->_getCountryOptions();
     if (is_array($countries)) {
         $valuesXmlObj = $xmlObj->addCustomChild('values');
         foreach ($countries as $data) {
             $regions = array();
             if ($data['value']) {
                 $regions = $this->_getRegionOptions($data['value']);
             }
             $relationType = is_array($regions) && !empty($regions) ? 'region_id' : 'region';
             $selectedCountry = array();
             if ($this->getCountryId() == $data['value']) {
                 $selectedCountry = array('selected' => 1);
             }
             $item = $valuesXmlObj->addCustomChild('item', null, array('relation' => $relationType) + $selectedCountry);
             $item->addCustomChild('label', (string) $data['label']);
             $item->addCustomChild('value', $data['value']);
             if ($relationType == 'region_id') {
                 $regionsXmlObj = $item->addCustomChild('regions');
                 foreach ($regions as $regionData) {
                     $selectedRegion = array();
                     if (!empty($selectedCountry) && $this->getRegionId() == $regionData['value']) {
                         $selectedRegion = array('selected' => 1);
                     }
                     $regionItem = $regionsXmlObj->addCustomChild('region_item', null, $selectedRegion);
                     $regionItem->addCustomChild('label', (string) $regionData['label']);
                     $regionItem->addCustomChild('value', (string) $regionData['value']);
                 }
             }
         }
     }
     return $this;
 }
开发者ID:blazeriaz,项目名称:youguess,代码行数:41,代码来源:CountryListSelect.php

示例5: _addLocalization

 /**
  * Add localization data to xml object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $xml
  * @return Mage_XmlConnect_Block_Adminhtml_Connect_Config
  */
 protected function _addLocalization(Mage_XmlConnect_Model_Simplexml_Element $xml)
 {
     /** @var $translateHelper Mage_XmlConnect_Helper_Translate */
     $translateHelper = Mage::helper('xmlconnect/translate');
     $xml->addCustomChild('localization', $this->getUrl('*/*/localization'), array('hash' => sha1(serialize($translateHelper->getLocalizationArray()))));
     return $this;
 }
开发者ID:blazeriaz,项目名称:youguess,代码行数:13,代码来源:Config.php

示例6: addToXmlObjectApi23

 /**
  * Add order total rendered to XML object. Api version 23
  *
  * @param $totalsXml Mage_XmlConnect_Model_Simplexml_Element
  * @return null
  */
 public function addToXmlObjectApi23(Mage_XmlConnect_Model_Simplexml_Element $totalsXml)
 {
     $balance = $this->getSource()->getCustomerBalanceAmount();
     if ($balance) {
         $totalsXml->addCustomChild('item', '-' . $this->_formatPrice($balance), array('id' => $this->getTotal()->getCode(), 'label' => Mage::helper('enterprise_giftcardaccount')->__('Store Credit')));
     }
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:13,代码来源:Customerbalance.php

示例7: addGraphInfoToXmlObj

 /**
  * Add last orders info to xml object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard_GraphInfo
  */
 public function addGraphInfoToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     /** @var $graphInfoXmlObj Mage_XmlConnect_Model_Simplexml_Element */
     $graphInfoXmlObj = $xmlObj->addCustomChild('chart');
     $this->_addRangeValues($graphInfoXmlObj)->_addDataSelector($graphInfoXmlObj)->_addTotalsBar($graphInfoXmlObj);
     $graphInfoXmlObj = $graphInfoXmlObj->addCustomChild('chart_data');
     $this->_addChartDataOrders($graphInfoXmlObj)->_addChartDataAmounts($graphInfoXmlObj);
     return $this;
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:15,代码来源:GraphInfo.php

示例8: 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

示例9: _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)
 {
     $values = $this->getEscapedValue();
     if (!empty($values)) {
         $valuesXmlObj = $xmlObj->addCustomChild('values');
         foreach ($values as $element => $config) {
             $valuesXmlObj->addCustomChild('item', null, array('id' => $config['id'], 'title' => $config['title'], 'label' => $config['label'], 'type' => $element, 'value' => $config['value']));
         }
     }
     return $this;
 }
开发者ID:Airmal,项目名称:Magento-Em,代码行数:17,代码来源:Date.php

示例10: _addOptions

 /**
  * Add options to select
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Model_Simplexml_Form_Element_Select
  */
 protected function _addOptions(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     if ($this->getOptions() && is_array($this->getOptions())) {
         $valuesXmlObj = $xmlObj->addCustomChild('values');
         foreach ($this->getOptions() as $option) {
             if (!isset($option['value']) || $option['value'] == '') {
                 continue;
             }
             $valuesXmlObj->addCustomChild('item', null, array('label' => $option['label'], 'value' => $option['value']));
         }
     }
 }
开发者ID:Airmal,项目名称:Magento-Em,代码行数:18,代码来源:Select.php

示例11: addItemToXmlObject

 /**
  * Add item to XML object
  * (get from template: downloadable/sales/order/items/renderer/downloadable.phtml)
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj
  * @return null
  */
 public function addItemToXmlObject(Mage_XmlConnect_Model_Simplexml_Element $orderItemXmlObj)
 {
     /** @var $item Mage_Sales_Model_Order_Item */
     $item = $this->getItem();
     /** @var $itemXml Mage_XmlConnect_Model_Simplexml_Element */
     $itemXml = $orderItemXmlObj->addCustomChild('item', null, array('product_id' => $item->getProductId()));
     $itemXml->addCustomChild('name', $item->getName());
     /** @var $weeeHelper Mage_Weee_Helper_Data */
     $weeeHelper = $this->helper('weee');
     /** @var $taxHelper Mage_Tax_Helper_Data */
     $taxHelper = $this->helper('tax');
     Mage::helper('xmlconnect/customer_order')->addItemOptionsToXml($this, $itemXml);
     $addtInfoBlock = $this->getProductAdditionalInformationBlock();
     if ($addtInfoBlock) {
         // TODO: find how to set additional info block
         // $addtInfoBlock->setItem($item)->toHtml();
     }
     $links = $this->getLinks();
     if ($links) {
         $linksXml = $itemXml->addCustomChild('links', null, array('label' => $this->getLinksTitle()));
         foreach ($links->getPurchasedItems() as $link) {
             $linksXml->addCustomChild('link', $link->getLinkTitle());
         }
     }
     $itemXml->addCustomChild('entity_type', $item->getProductType());
     $itemXml->addCustomChild('description', $item->getDescription());
     $itemXml->addCustomChild('sku', Mage::helper('core/string')->splitInjection($this->getSku()));
     /** @var $priceXml Mage_XmlConnect_Model_Simplexml_Element */
     $priceXml = $itemXml->addChild('price');
     // Quantity: Ordered, Shipped, Cancelled, Refunded
     Mage::helper('xmlconnect/customer_order')->addQuantityToXml($this, $itemXml->addChild('qty'), $item);
     /** @var $subtotalXml Mage_XmlConnect_Model_Simplexml_Element */
     $subtotalXml = $itemXml->addChild('subtotal');
     $this->setWeeeTaxAppliedAmount($item->getWeeeTaxAppliedAmount());
     $this->setWeeeTaxDisposition($item->getWeeeTaxDisposition());
     $typeOfDisplay1 = $weeeHelper->typeOfDisplay($item, 1, 'sales') && $this->getWeeeTaxAppliedAmount();
     $typeOfDisplay2 = $weeeHelper->typeOfDisplay($item, 2, 'sales') && $this->getWeeeTaxAppliedAmount();
     $typeOfDisplay4 = $weeeHelper->typeOfDisplay($item, 4, 'sales') && $this->getWeeeTaxAppliedAmount();
     $typeOfDisplay014 = $weeeHelper->typeOfDisplay($item, array(0, 1, 4), 'sales') && $this->getWeeeTaxAppliedAmount();
     $this->setTypesOfDisplay(array(Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_1 => $typeOfDisplay1, Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_2 => $typeOfDisplay2, Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_4 => $typeOfDisplay4, Mage_XmlConnect_Helper_Customer_Order::PRICE_DISPLAY_TYPE_14 => $typeOfDisplay014));
     $this->setWeeeTaxes($weeeHelper->getApplied($item));
     // Price & subtotal - excluding tax
     if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceExclTax()) {
         Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml($this, $item, $priceXml, $subtotalXml);
     }
     // Price & subtotal - including tax
     if ($taxHelper->displaySalesBothPrices() || $taxHelper->displaySalesPriceInclTax()) {
         Mage::helper('xmlconnect/customer_order')->addPriceAndSubtotalToXml($this, $item, $priceXml, $subtotalXml, true);
     }
 }
开发者ID:rajanlamic,项目名称:OpenArtist,代码行数:57,代码来源:Downloadable.php

示例12: 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

示例13: collectProductPrices

 /**
  * Collect product prices to specified item xml object
  *
  * @param Mage_Catalog_Model_Product $product
  * @param Mage_XmlConnect_Model_Simplexml_Element $item
  * @return null
  */
 public function collectProductPrices(Mage_Catalog_Model_Product $product, Mage_XmlConnect_Model_Simplexml_Element $item)
 {
     $this->setProduct($product);
     if ($product->getCanShowPrice() !== false) {
         $priceListXmlObj = $item->addCustomChild('price_list');
         $min = $this->getMinAmount();
         $max = $this->getMaxAmount();
         if ($min && $max && $min == $max) {
             $pricesXmlObj = $priceListXmlObj->addCustomChild('prices', null, array('id' => 'price'));
             $pricesXmlObj->addCustomChild('price', $min, array('id' => 'regular', 'label' => $this->__('Regular'), 'formatted_value' => Mage::helper('core')->currency($min, true, false)));
         } elseif ($min && $min != 0) {
             $pricesXmlObj = $priceListXmlObj->addCustomChild('prices', null, array('id' => 'price'));
             $pricesXmlObj->addCustomChild('price', $min, array('id' => 'regular', 'label' => $this->__('From'), 'formatted_value' => Mage::helper('core')->currency($min, true, false)));
         }
     }
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:23,代码来源:Giftcard.php

示例14: addTopSearchTermsToXmlObj

 /**
  * Add last search terms info to xml object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard_TopSearchTerms
  */
 public function addTopSearchTermsToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     foreach (Mage::helper('xmlconnect/adminApplication')->getSwitcherList() as $storeId) {
         $this->_clearCollection()->_initCollection($storeId);
         $valuesXml = $xmlObj->addCustomChild('values', null, array('store_id' => $storeId ? $storeId : Mage_XmlConnect_Helper_AdminApplication::ALL_STORE_VIEWS));
         if (!count($this->getCollection()->getItems()) > 0) {
             continue;
         }
         foreach ($this->getCollection()->getItems() as $item) {
             $itemListXml = $valuesXml->addCustomChild('item');
             $itemListXml->addCustomChild('name', $item->getName(), array('label' => $this->__('Search Term')));
             $itemListXml->addCustomChild('num_results', $item->getNumResults(), array('label' => $this->__('Results')));
             $itemListXml->addCustomChild('popularity', $item->getPopularity(), array('label' => $this->__('Number of Uses')));
         }
     }
     return $this;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:23,代码来源:TopSearchTerms.php

示例15: addTotalsDataToXmlObj

 /**
  * Add cart totals data to xml object
  *
  * @param Mage_XmlConnect_Model_Simplexml_Element $xmlObj
  * @return Mage_XmlConnect_Block_Adminhtml_Connect_Dashboard_GraphTotalsData
  */
 public function addTotalsDataToXmlObj(Mage_XmlConnect_Model_Simplexml_Element $xmlObj)
 {
     $dataValuesXml = $xmlObj->addCustomChild('chart_totals');
     foreach (Mage::helper('xmlconnect/adminApplication')->getSwitcherList() as $storeFilter) {
         $storeId = $storeFilter ? $storeFilter : null;
         $totalsXml = $dataValuesXml->addCustomChild('totals', null, array('store_id' => $storeId ? $storeId : Mage_XmlConnect_Helper_AdminApplication::ALL_STORE_VIEWS));
         foreach ($this->getRangeOptions() as $rangeFilter) {
             $this->_initCollection($storeId, $rangeFilter['value']);
             $valuesXml = $totalsXml->addCustomChild('values', null, array('range_id' => $rangeFilter['value']));
             foreach ($this->getTotals() as $total) {
                 $totalValue = $valuesXml->escapeXml($total['value'] . $total['decimals']);
                 $valuesXml->addCustomChild('item', $totalValue, array('label' => $total['label']));
             }
             $this->_clearTotals();
         }
     }
     return $this;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:24,代码来源:GraphTotalsData.php


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