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


PHP Mage_Customer_Model_Address_Abstract::getRegion方法代码示例

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


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

示例1: render

 /**
  * Render address
  *
  * @param Mage_Customer_Model_Address_Abstract $address
  * @return string
  */
 public function render(Mage_Customer_Model_Address_Abstract $address, $format = null)
 {
     $address->getRegion();
     $address->getCountry();
     $address->explodeStreetAddress();
     $formater = new Varien_Filter_Template();
     $data = $address->getData();
     if ($this->getType()->getHtmlEscape()) {
         foreach ($data as $key => $value) {
             if (is_object($value)) {
                 unset($data[$key]);
             } else {
                 $data[$key] = $this->htmlEscape($value);
             }
         }
     }
     /**
      * Remove data that mustn't show
      */
     if (!$this->helper('customer/address')->canShowConfig('prefix_show')) {
         unset($data['prefix']);
     }
     if (!$this->helper('customer/address')->canShowConfig('middlename_show')) {
         unset($data['middlename']);
     }
     if (!$this->helper('customer/address')->canShowConfig('suffix_show')) {
         unset($data['suffix']);
     }
     $formater->setVariables(array_merge($data, array('country' => $address->getCountryModel()->getName())));
     $format = !is_null($format) ? $format : $this->getFormat($address);
     return $formater->filter($format);
 }
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:38,代码来源:Default.php

示例2: render

 /**
  * Render address
  *
  * @param Mage_Customer_Model_Address_Abstract $address
  * @return string
  */
 public function render(Mage_Customer_Model_Address_Abstract $address)
 {
     $format = $this->getType()->getDefaultFormat();
     $countryFormat = $address->getCountryModel()->getFormat($this->getType()->getCode());
     $address->getRegion();
     $address->getCountry();
     $address->explodeStreetAddress();
     if ($countryFormat) {
         $format = $countryFormat->getFormat();
     }
     $formater = new Varien_Filter_Template();
     $formater->setVariables(array_merge($address->getData(), array('country' => $address->getCountryModel()->getName())));
     return $formater->filter($format);
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:20,代码来源:Default.php

示例3: render

 /**
  * Render address
  *
  * @param Mage_Customer_Model_Address_Abstract $address
  * @return string
  */
 public function render(Mage_Customer_Model_Address_Abstract $address, $format = null)
 {
     $address->getRegion();
     $address->getCountry();
     $address->explodeStreetAddress();
     $formater = new Varien_Filter_Template();
     $data = $address->getData();
     if ($this->getType()->getHtmlEscape()) {
         foreach ($data as $key => $value) {
             $data[$key] = $this->htmlEscape($value);
         }
     }
     $formater->setVariables(array_merge($data, array('country' => $address->getCountryModel()->getName())));
     $format = !is_null($format) ? $format : $this->getFormat($address);
     return $formater->filter($format);
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:22,代码来源:Address_Renderer_Default.php

示例4: render

 /**
  * Render address
  *
  * @param Mage_Customer_Model_Address_Abstract $address
  * @return string
  */
 public function render(Mage_Customer_Model_Address_Abstract $address, $format = null)
 {
     switch ($this->getType()->getCode()) {
         case 'html':
             $dataFormat = Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_HTML;
             break;
         case 'pdf':
             $dataFormat = Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_PDF;
             break;
         case 'oneline':
             $dataFormat = Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ONELINE;
             break;
         default:
             $dataFormat = Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_TEXT;
             break;
     }
     $formater = new Varien_Filter_Template();
     $attributes = Mage::helper('customer/address')->getAttributes();
     $data = array();
     foreach ($attributes as $attribute) {
         /* @var $attribute Mage_Customer_Model_Attribute */
         if (!$attribute->getIsVisible()) {
             continue;
         }
         if ($attribute->getAttributeCode() == 'country_id') {
             $data['country'] = $address->getCountryModel()->getName();
         } else {
             if ($attribute->getAttributeCode() == 'region') {
                 $data['region'] = Mage::helper('directory')->__($address->getRegion());
             } else {
                 $dataModel = Mage_Customer_Model_Attribute_Data::factory($attribute, $address);
                 $value = $dataModel->outputValue($dataFormat);
                 if ($attribute->getFrontendInput() == 'multiline') {
                     $values = $dataModel->outputValue(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_ARRAY);
                     // explode lines
                     foreach ($values as $k => $v) {
                         $key = sprintf('%s%d', $attribute->getAttributeCode(), $k + 1);
                         $data[$key] = $v;
                     }
                 }
                 $data[$attribute->getAttributeCode()] = $value;
             }
         }
     }
     if ($this->getType()->getHtmlEscape()) {
         foreach ($data as $key => $value) {
             $data[$key] = $this->escapeHtml($value);
         }
     }
     $formater->setVariables($data);
     $format = !is_null($format) ? $format : $this->getFormat($address);
     return $formater->filter($format);
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:59,代码来源:Default.php

示例5: _getAddressData

 /**
  * @param Mage_Customer_Model_Address_Abstract $address
  * @return array
  */
 protected function _getAddressData(Mage_Customer_Model_Address_Abstract $address)
 {
     $data = array();
     if ($address) {
         $data['name'] = $address->getName();
         $data['address'] = $address->getStreetFull();
         $data['city'] = $address->getCity();
         $data['postcode'] = $address->getPostcode();
         $data['country'] = $address->getCountry();
         $data['state'] = $address->getRegion() ? $address->getRegion() : '';
     }
     return $data;
 }
开发者ID:yurevichcv,项目名称:UniversalVariable-Magento-Extension,代码行数:17,代码来源:Uv.php

示例6: getRegion

 /**
  * If the country for the Address is US then get the 2 character ISO region code;
  * otherwise, for any other country get the fully qualified region name.
  *
  * @param  Mage_Customer_Model_Address_Abstract
  * @return string
  */
 protected function getRegion(Mage_Customer_Model_Address_Abstract $address)
 {
     return $address->getCountry() === 'US' ? $address->getRegionCode() : $address->getRegion();
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:11,代码来源:Payload.php

示例7: createAddress

 /**
  * Create OCL Address record
  *
  * @param Mage_Customer_Model_Address_Abstract|Mage_Sales_Model_Order_Address $address
  * @param string|null                          $billingEntityId
  * @return array
  */
 public function createAddress($address, $tags = null)
 {
     $region = $address->getRegion();
     $data = array('street1' => (string) $address->getStreet1(), 'street2' => (string) $address->getStreet2(), 'street3' => (string) $address->getStreet3(), 'street4' => (string) $address->getStreet4(), 'city' => (string) $address->getCity(), 'county' => null, 'stateOrProvince' => empty($region) ? null : $region, 'postalCode' => (string) $address->getPostcode(), 'country' => (string) Mage::getModel('directory/country')->loadByCode($address->getCountryId())->getIso3Code(), 'tags' => $tags);
     return $data;
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:13,代码来源:Data.php


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