本文整理汇总了PHP中Mage_Customer_Model_Address_Abstract类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Customer_Model_Address_Abstract类的具体用法?PHP Mage_Customer_Model_Address_Abstract怎么用?PHP Mage_Customer_Model_Address_Abstract使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Customer_Model_Address_Abstract类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: transferPhysicalAddressPayloadToAddress
/**
* Transfer data from a physical address payload to a Magento address model.
*
* @param IPhysicalAddress
* @param Mage_Customer_Model_Address_Abstract
* @return self
*/
public function transferPhysicalAddressPayloadToAddress(IPhysicalAddress $addressPayload, Mage_Customer_Model_Address_Abstract $address)
{
/** @var string */
$region = $addressPayload->getMainDivision();
$address->setStreet($addressPayload->getLines())->setCity($addressPayload->getCity())->setCountryId($addressPayload->getCountryCode())->setRegionId($this->getRegionIdByCode($region, $addressPayload->getCountryCode()))->setRegion($region)->setPostcode($addressPayload->getPostalCode());
return $this;
}
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:14,代码来源:Data.php
示例2: 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
示例3: getAddressCosts
/**
* Returns COD fee for certain address
*
* @param Mage_Sales_Model_Quote_Address $address
* @return decimal
*
*/
public function getAddressCosts(Mage_Customer_Model_Address_Abstract $address)
{
if ($address->getCountry() == Mage::getStoreConfig('shipping/origin/country_id')) {
return $this->getInlandCosts();
} else {
return $this->getForeignCountryCosts();
}
}
开发者ID:xiaoguizhidao,项目名称:ecommerce,代码行数:15,代码来源:CashOnDelivery.php
示例4: copyShipFromAddressTo
protected function copyShipFromAddressTo(Mage_Customer_Model_Address_Abstract $address, EbayEnterprise_Inventory_Model_Details_Item $detail)
{
if ($detail->isAvailable()) {
$meta = ['sku' => $detail->getSku(), 'item_id' => $detail->getItemId()];
$this->logger->debug('applying details for item "{sku}" [{item_id}]', $this->logContext->getMetaData(__CLASS__, $meta));
$address->addData($this->exportShipFromAddress($detail));
}
}
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:8,代码来源:Origin.php
示例5: 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);
}
}
}
$formater->setVariables(array_merge($data, array('country' => $address->getCountryModel()->getName())));
$format = !is_null($format) ? $format : $this->getFormat($address);
return $formater->filter($format);
}
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:26,代码来源:Default.php
示例6: getIsoRegionCode
/**
* extracts the region code in iso format (if possible)
*
* @param Mage_Customer_Model_Address_Abstract $address
*
* @return string - the regin code in iso format
*/
public function getIsoRegionCode(Mage_Customer_Model_Address_Abstract $address)
{
$regionCode = trim($address->getRegionCode());
$countryCode = $address->getCountry();
if ($this->isAlreadyIsoCode($regionCode, $countryCode)) {
return $regionCode;
}
if (0 === strpos($regionCode, $countryCode . '-')) {
return str_replace($countryCode . '-', '', $regionCode);
}
return $this->getRegionCodeFromMapping($countryCode, $regionCode);
}
开发者ID:roshu1980,项目名称:add-computers,代码行数:19,代码来源:Request.php
示例7: 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
示例8: mapFromAddress
/**
* @param Mage_Customer_Model_Address_Abstract $address
* @return Payone_Api_Request_Consumerscore
*/
public function mapFromAddress(Mage_Customer_Model_Address_Abstract $address)
{
$factory = $this->getFactory();
$request = $factory->getRequestVerificationConsumerScore();
$helper = $this->helper();
$configGlobal = $this->getConfigGlobal();
$config = $this->getConfig();
$request->setConsumerscoretype($config->getType());
$request->setAddresschecktype(Payone_Api_Enum_AddressCheckType::NONE);
$request->setAid($configGlobal->getAid());
$request->setMid($configGlobal->getMid());
$request->setMode($config->getMode());
$request->setPortalid($configGlobal->getPortalid());
$request->setKey($configGlobal->getKey());
$request->setCity($address->getCity());
$request->setCompany($address->getCompany());
$request->setCountry($address->getCountry());
$request->setFirstname($address->getFirstname());
$request->setLastname($address->getLastname());
$request->setIntegratorName('Magento');
$request->setIntegratorVersion($helper->getMagentoVersion());
$request->setSolutionName('votum');
$request->setSolutionVersion($helper->getPayoneVersion());
if ($customerId = $address->getCustomerId()) {
$customer = $factory->getModelCustomer();
$customer->load($customerId);
$date = $customer->getDob();
$date = date('Ymd', strtotime($date));
$request->setBirthday($date);
}
$request->setEncoding('UTF-8');
$request->setLanguage($helper->getDefaultLanguage());
$request->setStreet($address->getStreetFull());
$request->setTelephonenumber($address->getTelephone());
$request->setZip($address->getPostcode());
return $request;
}
开发者ID:kirchbergerknorr,项目名称:payone-magento,代码行数:41,代码来源:Creditrating.php
示例9: 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
示例10: saveCustomerAddress
/**
* Store date and score to customerAddress.
* If the quoteAddress is not a saved customerAddress we do nothing
* If it gets saved to the addressBook at end of checkout Magento´ convert functionality saves the data for us
*
* @param Mage_Customer_Model_Address_Abstract $address
* @return bool
*/
public function saveCustomerAddress(Mage_Customer_Model_Address_Abstract $address)
{
$customerAddressId = $address->getCustomerAddressId();
if (empty($customerAddressId)) {
return false;
}
$customerAddress = $this->getFactory()->getModelCustomerAddress();
$customerAddress->load($customerAddressId);
if (!$customerAddress->hasData()) {
return false;
}
$customerAddress->setData($this->prefix . '_score', $address->getData($this->prefix . '_score'));
$customerAddress->setData($this->prefix . '_date', $address->getData($this->prefix . '_date'));
$customerAddress->setData($this->prefix . '_hash', $address->getData($this->prefix . '_hash'));
$customerAddress->setCity($address->getCity());
$customerAddress->setStreetFull($address->getStreetFull());
$customerAddress->setZip($address->getZip());
$customerAddress->save();
return true;
}
开发者ID:kirchbergerknorr,项目名称:payone-magento,代码行数:28,代码来源:Abstract.php
示例11: getFullname
/**
* Get fullname from address
* @param Mage_Customer_Model_Address_Abstract $address
* @return string
*/
public function getFullname($address)
{
$parts = array();
if ($address->getFirstname()) {
$parts[] = $address->getFirstname();
}
if ($address->getMiddlename()) {
$parts[] = $address->getMiddlename();
}
if ($address->getLastname()) {
$parts[] = $address->getLastname();
}
if (empty($parts)) {
return trim(Mage::getSingleton('customer/session')->getCustomer()->getName());
}
return trim(join(' ', $parts));
}
开发者ID:anattadesign,项目名称:AwesomeCheckout,代码行数:22,代码来源:Data.php
示例12: checkAddress
protected function checkAddress(Mage_Customer_Model_Address_Abstract $address, $validityInSeconds)
{
if (!$address->hasData()) {
return false;
}
$savedDate = $address->getData($this->prefix . '_date');
$savedScore = $address->getData($this->prefix . '_score');
if (empty($savedDate) or empty($savedScore)) {
return false;
}
if ($this->addressHasChanged($address)) {
return false;
}
// Verify the validity period is not expired:
if (!$this->helper()->isDateStillValid($savedDate, $validityInSeconds)) {
return false;
}
$address->setData($this->prefix . '_score', $savedScore);
return $savedScore;
}
开发者ID:kirchbergerknorr,项目名称:payone-magento,代码行数:20,代码来源:Abstract.php
示例13: getUsableMethod
/**
* get a magento shipping method identifer for either:
* - the shipping method used by $address
* - the first of all valid shipping methods
*
* @param Mage_Customer_Model_Address_Abstract
* @return string
*/
public function getUsableMethod(Mage_Customer_Model_Address_Abstract $address)
{
$this->fetchAvailableShippingMethods();
return $address->getShippingMethod() ?: $this->getFirstAvailable();
}
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:13,代码来源:Shipping.php
示例14: _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
示例15: generateAddressHash
/**
* generates hash from address data
*
* @param Mage_Sales_Model_Quote_Address $address the address data to hash
*
* @returns sha1 hash of address
*/
public function generateAddressHash(Mage_Customer_Model_Address_Abstract $address)
{
$addressString = $address->getFirstname();
$addressString .= $address->getMiddlename();
$addressString .= $address->getLastname();
$addressString .= $address->getCompany();
$street = $address->getStreetFull();
if (is_array($street)) {
$street = implode('', $street);
}
$addressString .= $street;
$addressString .= $address->getPostcode();
$addressString .= $address->getCity();
$addressString .= $address->getCountryId();
return sha1($addressString);
}
开发者ID:roshu1980,项目名称:add-computers,代码行数:23,代码来源:Alias.php
示例16: _extractAddressData
/**
* Extract array of address data - street, city, region code, etc. from an address object
* @param Mage_Customer_Model_Address_Abstract $address Address object to pull data from
* @return array Extracted data
*/
protected function _extractAddressData(Mage_Customer_Model_Address_Abstract $address)
{
return array('street' => $address->getStreet(), 'city' => $address->getCity(), 'region_code' => $address->getRegionCode(), 'country_id' => $address->getCountryId(), 'postcode' => $address->getPostcode());
}
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:9,代码来源:Session.php
示例17: _isAddressBilling
/**
* Check for an order address to be a billing address.
*
* @param Mage_Customer_Model_Address_Abstract
* @return bool
*/
protected function _isAddressBilling(Mage_Customer_Model_Address_Abstract $address)
{
return $address->getAddressType() === Mage_Customer_Model_Address_Abstract::TYPE_BILLING;
}
开发者ID:adderall,项目名称:magento-retail-order-management,代码行数:10,代码来源:Create.php
示例18: getStreetData
/**
* Retrieves street name, house number and house number extension from the shipping address.
* The shipping address may be in multiple street lines configuration or single line configuration. In the case of
* multi-line, each part of the street data will be in a separate field. In the single line configuration, each part
* will be in the same field and will have to be split using PREG.
*
* @param Mage_Customer_Model_Address_Abstract $address
*
* @return array
*/
public function getStreetData($address)
{
$fullStreet = $address->getStreetFull();
if ($address->getCountry() != 'NL') {
$fullStreet = $this->_getInternationalFullStreet($address);
$streetData = array('streetname' => $fullStreet, 'housenumber' => '', 'housenumberExtension' => '', 'fullStreet' => '');
return $streetData;
}
/**
* Split the address using PREG.
* @var TIG_MyParcel2014_Helper_Data $this
*/
$streetData = $this->_getSplitStreetData($fullStreet);
return $streetData;
}
开发者ID:myparcelnl,项目名称:magento1,代码行数:25,代码来源:Data.php
示例19: isTestOrder
/**
* Determine if an order should be sent to ROM as a test order by checking the second street
* address if it match the constant value IOrderCreateRequest::TEST_TYPE_AUTOCANCEL, then it is
* a test order, otherwise it is not a test order.
*
* @param Mage_Customer_Model_Address_Abstract
* @return bool
*/
protected function isTestOrder(Mage_Customer_Model_Address_Abstract $billingAddress)
{
return $billingAddress->getStreet(2) === IOrderCreateRequest::TEST_TYPE_AUTOCANCEL;
}
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:12,代码来源:Create.php
示例20: customerAddressToPhysicalAddressPayload
/**
* Transfer data from a Magento customer address to a ROM SDK
* PhysicalAddress payload.
*
* @param Mage_Customer_Model_Address_Abstract
* @param IPhysicalAddress
* @return IPhysicalAddress
*/
public function customerAddressToPhysicalAddressPayload(Mage_Customer_Model_Address_Abstract $address, IPhysicalAddress $payload)
{
return $payload->setLines($address->getStreetFull())->setCity($address->getCity())->setMainDivision($address->getRegionId())->setCountryCode($address->getCountryId())->setPostalCode($address->getPostcode());
}
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:12,代码来源:Payload.php
注:本文中的Mage_Customer_Model_Address_Abstract类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论