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


PHP Mage_Customer_Model_Customer::getLastname方法代码示例

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


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

示例1: withCustomer

 /**
  * @param \Mage_Customer_Model_Customer $customer
  * @return $this
  */
 public function withCustomer($customer)
 {
     $this->attributes['customer_id'] = $customer->getId();
     $this->attributes['firstname'] = $customer->getFirstname();
     $this->attributes['lastname'] = $customer->getLastname();
     return $this;
 }
开发者ID:jameshalsall,项目名称:Manager,代码行数:11,代码来源:Address.php

示例2: subscribeAfterRegistration

 /**
  * Subscribe customer after registration
  * @param Mage_Customer_Model_Customer $customer 
  */
 protected function subscribeAfterRegistration($customer)
 {
     if (Mage::helper('advancednewsletter')->showSegmentsAtCustomerRegistration()) {
         $subscribedSegments = Mage::app()->getRequest()->getParam('segments_select');
         if (!empty($subscribedSegments)) {
             $customer->setIsSubscribed(true);
             $params = array('first_name' => $customer->getFirstname(), 'last_name' => $customer->getLastname());
             try {
                 Mage::getModel('advancednewsletter/subscriber')->setCustomer($customer)->subscribe($customer->getEmail(), $subscribedSegments);
             } catch (Exception $ex) {
             }
         }
     } else {
         if ($customer->getIsSubscribed()) {
             $segmentsToSubscribe = array();
             $params = array('first_name' => $customer->getFirstname(), 'last_name' => $customer->getLastname());
             $segmentsCollection = Mage::getModel('advancednewsletter/segment')->getCollection()->addFieldToFilter('frontend_visibility', array('eq' => array(1)))->addDefaultStoreFilter(Mage::app()->getStore()->getId());
             foreach ($segmentsCollection as $segment) {
                 $segmentsToSubscribe[] = $segment->getCode();
             }
             try {
                 Mage::getModel('advancednewsletter/subscriber')->setCustomer($customer)->subscribe($customer->getEmail(), $segmentsToSubscribe);
             } catch (Exception $ex) {
             }
         }
     }
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:31,代码来源:Observer.php

示例3: createFromCustomer

 public static function createFromCustomer(Mage_Customer_Model_Customer $customer)
 {
     /** @var Mage_Log_Model_Customer $logCustomer */
     $logCustomer = Mage::getModel('log/customer')->loadByCustomer($customer->getId());
     switch ($customer->getGender()) {
         case '1':
             $gender = 1;
             break;
         case '2':
             $gender = 2;
             break;
         default:
             $gender = 0;
     }
     $aCustomer = new self();
     $aCustomer->email = $customer->getEmail();
     $aCustomer->type = 'e';
     $aCustomer->gender = $gender;
     $aCustomer->id = $customer->getId();
     $aCustomer->first_name = $customer->getFirstname();
     $aCustomer->last_name = $customer->getLastname();
     if (($birthday = $customer->getDob()) !== null) {
         $aCustomer->birthday = Aplazame_Sdk_Serializer_Date::fromDateTime(new DateTime($birthday));
     }
     if (($document_id = $customer->getTaxvat()) !== null) {
         $aCustomer->document_id = $document_id;
     }
     $aCustomer->date_joined = Aplazame_Sdk_Serializer_Date::fromDateTime(new DateTime('@' . $customer->getCreatedAtTimestamp()));
     if (($lastLogin = $logCustomer->getLoginAtTimestamp()) != null) {
         $aCustomer->last_login = Aplazame_Sdk_Serializer_Date::fromDateTime(new DateTime('@' . $lastLogin));
     }
     return $aCustomer;
 }
开发者ID:aplazame,项目名称:magento,代码行数:33,代码来源:Customer.php

示例4: paytraceCustomer

 /**
  * EITHER CREATE OR UPDATE THE CUSTOMER
  * 
  * TO CREATE
  * http://help.paytrace.com/api-create-customer-profile
  * 
  * TO UPDATE
  * http://help.paytrace.com/api-update-customer-profile
  * 
  * TO DELETE
  * if $card is empty then we delete the card from paytrace
  * 
  * @param Mage_Customer_Model_Customer $customer
  */
 public function paytraceCustomer(Mage_Customer_Model_Customer $customer, Widgetized_Level3_Model_Card $card = null)
 {
     $defaults = array('UN' => $this->getConfigData('login'), 'PSWD' => $this->getConfigData('trans_key'), 'TERMS' => 'Y', 'METHOD' => 'CreateCustomer', 'CUSTID' => $customer->getId(), 'BNAME' => $customer->getFirstname() . ' ' . $customer->getLastname(), 'CC' => '', 'EXPMNTH' => '', 'EXPYR' => '');
     $addressId = $customer->getDefaultBilling();
     $billing = Mage::getModel('sales/order_address')->load($addressId);
     if ($billing) {
         $defaults['BADDRESS'] = $billing->getPostcode();
         $defaults['BCITY'] = $billing->getCity();
         $defaults['BSTATE'] = $billing->getRegion();
         $defaults['BZIP'] = $billing->getPostcode();
         $defaults['BCOUNTRY'] = $billing->getCountryId();
     }
     if ($card) {
         $defaults['CC'] = $card->getNumber();
         $defaults['EXPMNTH'] = $card->getMonth();
         $defaults['EXPYR'] = $card->getYear();
     }
     try {
         $result = $this->call(array_keys($defaults), $defaults);
     } catch (Exception $ex) {
         $message = $this->__($ex->getMessage());
         if ($card) {
             $card->setToken($message);
             $card->save();
         }
     }
 }
开发者ID:Jonathonbyrd,项目名称:Optimized-Magento-1.9.x,代码行数:41,代码来源:Paytrace.php

示例5: sendSubscription

 public function sendSubscription(Mage_Customer_Model_Customer $parent, $destination, $destination_name)
 {
     $translate = Mage::getSingleton('core/translate');
     /* @var $translate Mage_Core_Model_Translate */
     $translate->setTranslateInline(false);
     //$template = Mage::getStoreConfig(self::XML_PATH_SUBSCRIPTION_EMAIL_TEMPLATE, $this->getStoreId());
     $email = Mage::getModel('core/email_template');
     /* @var $email Mage_Core_Model_Email_Template */
     //$email->setDesignConfig(array('area'=>'frontend', 'store'=>$this->getStoreId()));
     $template = Mage::getStoreConfig(self::XML_PATH_SUBSCRIPTION_EMAIL_TEMPLATE, Mage::app()->getStore()->getId());
     $recipient = array('email' => $destination, 'name' => $destination_name);
     if (Mage::helper('core')->isModuleEnabled('Aschroder_SMTPPro')) {
         $sender = Mage::getStoreConfig(self::XML_PATH_CONFIRMATION_EMAIL_IDENTITY);
     } else {
         $sender = array('name' => strip_tags($parent->getFirstname() . ' ' . $parent->getLastname()), 'email' => strip_tags($parent->getEmail()));
     }
     /*        $sender  = array(
                 'name' => strip_tags($parent->getFirstname().' '.$parent->getLastname()),
                 'email' => strip_tags($parent->getEmail())
             );
     */
     $real_url = Mage::getUrl('rewardpoints/index/goReferral', array("referrer" => $parent->getId()));
     $used_url = Mage::getUrl('', array("referral-program" => str_replace('/', '-', base64_encode($parent->getId() . 'j2t'))));
     $email->setDesignConfig(array('area' => 'frontend', 'store' => Mage::app()->getStore()->getId()))->sendTransactional($template, $sender, $recipient['email'], $recipient['name'], array('parent' => $parent, 'referral' => $this, 'store_name' => Mage::getModel('core/store')->load(Mage::app()->getStore()->getCode())->getName(), 'referral_url' => $used_url));
     $translate->setTranslateInline(true);
     return $email->getSentSuccess();
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:27,代码来源:Referral.php

示例6: sendSubscription

 public function sendSubscription(Mage_Customer_Model_Customer $parent, $destination, $destination_name)
 {
     $translate = Mage::getSingleton('core/translate');
     /* @var $translate Mage_Core_Model_Translate */
     $translate->setTranslateInline(false);
     //$template = Mage::getStoreConfig(self::XML_PATH_SUBSCRIPTION_EMAIL_TEMPLATE, $this->getStoreId());
     $email = Mage::getModel('core/email_template');
     /* @var $email Mage_Core_Model_Email_Template */
     //$email->setDesignConfig(array('area'=>'frontend', 'store'=>$this->getStoreId()));
     $template = Mage::getStoreConfig(self::XML_PATH_SUBSCRIPTION_EMAIL_TEMPLATE, Mage::app()->getStore()->getId());
     $recipient = array('email' => $destination, 'name' => $destination_name);
     $sender = array('name' => strip_tags($parent->getFirstname() . ' ' . $parent->getLastname()), 'email' => strip_tags($parent->getEmail()));
     $email->setDesignConfig(array('area' => 'frontend', 'store' => Mage::app()->getStore()->getId()))->sendTransactional($template, $sender, $recipient['email'], $recipient['name'], array('parent' => $parent, 'referral' => $this, 'store_name' => Mage::getModel('core/store')->load(Mage::app()->getStore()->getCode())->getName()));
     $translate->setTranslateInline(true);
     return $email->getSentSuccess();
 }
开发者ID:ntnhan220488,项目名称:ggm,代码行数:16,代码来源:Referral.php

示例7: getCustomerData

 /**
  * Create array of customer values for API
  *
  * @param Mage_Customer_Model_Customer $customer
  * @return array
  */
 public function getCustomerData(Mage_Customer_Model_Customer $customer)
 {
     try {
         if ($primaryBillingAddress = $customer->getPrimaryBillingAddress()) {
             $address = implode(', ', $primaryBillingAddress->getStreet());
             $state = $customer->getPrimaryBillingAddress()->getRegion();
             $zipcode = $customer->getPrimaryBillingAddress()->getPostcode();
         } else {
             $address = '';
             $state = '';
             $zipcode = '';
         }
         $data = array('id' => $customer->getEmail(), 'key' => 'email', 'fields' => array('keys' => 1), 'keysconfict' => 'merge', 'vars' => array('id' => $customer->getId(), 'name' => $customer->getName(), 'suffix' => $customer->getSuffix() ? $customer->getSuffix() : '', 'prefix' => $customer->getPrefix() ? $customer->getPrefix() : '', 'firstName' => $customer->getFirstname(), 'middleName' => $customer->getMiddlename() ? $customer->getMiddlename() : '', 'lastName' => $customer->getLastname(), 'address' => $address, 'storeID' => $customer->getStoreId(), 'groupId' => $customer->getGroupId(), 'taxClassId' => $customer->getTaxClassId(), 'createdAt' => date("Y-m-d H:i:s", $customer->getCreatedAtTimestamp()), 'primaryBillingAddress' => $this->getAddress($customer->getPrimaryBillingAddress()), 'defaultBillingAddress' => $this->getAddress($customer->getDefaultBillingAddress()), 'defaultShippingAddress' => $this->getAddress($customer->getDefaultShippingAddress()), 'state' => $state, 'zipCode' => $zipcode), 'lists' => array(Mage::helper('sailthruemail')->getMasterList() => 1));
         return $data;
     } catch (Exception $e) {
         Mage::logException($e);
     }
 }
开发者ID:xiaoguizhidao,项目名称:sailthru-magento-extension,代码行数:24,代码来源:User.php

示例8: getCustomerHtml

 public function getCustomerHtml(Mage_Customer_Model_Customer $customer)
 {
     $html = "<li onclick=\"addCustomerToCart(" . $customer->getId() . ")\" style='width:100%; float:left; cursor: pointer' class='email-customer col-lg-6 col-md-6'><span style='float:left;'>" . $customer->getFirstname() . " " . $customer->getLastname() . "</span><span style='float:right'><a href='mailto:" . $customer->getEmail() . "'>" . $customer->getEmail() . "</a></span><br/><span style='float:right'>" . $customer->getTelephone() . "</span></li>";
     return $html;
 }
开发者ID:javik223,项目名称:Evron-Magento,代码行数:5,代码来源:Customer.php

示例9: setCustomer

 /**
  * Define customer object
  *
  * @param   Mage_Customer_Model_Customer $customer
  * @return  Mage_Sales_Model_Quote
  */
 public function setCustomer(Mage_Customer_Model_Customer $customer)
 {
     $this->_customer = $customer;
     $this->setCustomerId($customer->getId());
     $this->setCustomerEmail($customer->getEmail());
     $this->setCustomerFirstname($customer->getFirstname());
     $this->setCustomerLastname($customer->getLastname());
     $this->setCustomerGroupId($customer->getGroupId());
     $this->setCustomerTaxClassId($customer->getTaxClassId());
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:17,代码来源:Quote.php

示例10: _filterCustomer

 /**
  * @param Mage_Customer_Model_Customer $customer
  *
  * @return Bronto_Common_Model_Email_Template_Filter
  */
 protected function _filterCustomer(Mage_Customer_Model_Customer $customer)
 {
     if (!in_array('customer', $this->_filteredObjects)) {
         // Handle Defaults from settings
         $customerName = trim($customer->getName()) == '' ? Mage::helper('bronto_common')->getDefaultGreeting('full', 'store', $this->getStoreId()) : $customer->getName();
         $customerPrefix = trim($customer->getPrefix()) == '' ? Mage::helper('bronto_common')->getDefaultGreeting('prefix', 'store', $this->getStoreId()) : $customer->getPrefix();
         $customerFirstName = trim($customer->getFirstname()) == '' ? Mage::helper('bronto_common')->getDefaultGreeting('firstname', 'store', $this->getStoreId()) : $customer->getFirstname();
         $customerLastName = trim($customer->getLastname()) == '' ? Mage::helper('bronto_common')->getDefaultGreeting('lastname', 'store', $this->getStoreId()) : $customer->getLastname();
         $this->setField('customerName', $customerName);
         $this->setField('firstName', $customerFirstName);
         $this->setField('prefix', $customerPrefix);
         $this->setField('lastName', $customerLastName);
         $this->setField('customerEmail', $customer->getEmail());
         $this->setField('customerPassword', $customer->getPassword());
         if ($store = $customer->getStore()) {
             $this->setField('confirmationLink', $store->getUrl('customer/account/confirm', array('_query' => array('id' => $customer->getId(), 'key' => $customer->getConfirmation()))));
             if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('>=', '6')))) {
                 $this->setField('passwordResetLink', $store->getUrl('customer/account/resetpassword', array('_query' => array('id' => $customer->getId(), 'token' => $customer->getRpToken()))));
             }
         } else {
             $this->setField('confirmationLink', Mage::getUrl('customer/account/confirm', array('_query' => array('id' => $customer->getId(), 'key' => $customer->getConfirmation()))));
             if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('>=', '6')))) {
                 $this->setField('passwordResetLink', Mage::getUrl('customer/account/resetpassword', array('_query' => array('id' => $customer->getId(), 'token' => $customer->getRpToken()))));
             }
         }
         $this->_filteredObjects[] = 'customer';
     }
     return $this;
 }
开发者ID:bevello,项目名称:bevello,代码行数:34,代码来源:Filter.php

示例11: synchroniseCustomer

 /**
  * Synchronise a Magento customer with WordPress
  *
  * @param Mage_Customer_Model_Customer $customer
  * @return bool
  */
 public function synchroniseCustomer(Mage_Customer_Model_Customer $customer)
 {
     $email = $customer->getEmail();
     if ($customer->getCsData() && $customer->getCsData()->getEmail()) {
         $email = $customer->getCsData()->getEmail();
     }
     $user = Mage::getModel('wordpress/user')->loadByEmail($email);
     if (!$user->getId() && !$customer->getPassword()) {
         return false;
     }
     $user->setUserEmail($customer->getEmail())->setUserRegistered($customer->getCreatedAt())->setUserNicename($customer->getName())->setDisplayName($customer->getFirstname())->setFirstName($customer->getFirstname())->setLastName($customer->getLastname())->setNickname($customer->getFirstname());
     if (!$user->getUserLogin() || strpos($user->getUserLogin(), '@') !== false) {
         $user->setUserLogin($customer->getEmail());
     }
     try {
         if ($customer->hasPassword()) {
             if ($customer->validatePassword($customer->getPassword())) {
                 $wpHash = $this->hashPasswordForWordPress($customer->getPassword());
                 if ($this->isValidWordPressPassword($customer->getPassword(), $wpHash)) {
                     $user->setUserPass($wpHash);
                 }
             }
         }
         $user->save();
         $customer->setWordpressUser($user);
     } catch (Exception $e) {
         Mage::helper('wordpress')->log($e);
     }
 }
开发者ID:shashankkanungo,项目名称:magento,代码行数:35,代码来源:Fishpig_Wordpress_Addon_CS_Model_Observer.php

示例12: createDiamanteUser

 /**
  * @param Mage_Customer_Model_Customer $customer
  * @return bool|mixed
  */
 public function createDiamanteUser(Mage_Customer_Model_Customer $customer)
 {
     try {
         $this->init()->setMethod('desk/users')->setHttpMethod('POST')->addPostData(array('email' => $customer->getEmail(), 'firstName' => $customer->getFirstname(), 'lastName' => $customer->getLastname()))->doRequest(false);
     } catch (Exception $e) {
         return false;
     }
     if ($this->result->getStatus() === 201) {
         $diamanteUser = json_decode($this->result->getBody());
         $customerRelation = Mage::getModel('eltrino_diamantedesk/customerRelation');
         $customerRelation->setData(array('customer_id' => $customer->getId(), 'user_id' => $diamanteUser->id));
         $customerRelation->save();
         return $diamanteUser;
     }
     return false;
 }
开发者ID:eltrino,项目名称:DiamanteDeskMagentoExtension,代码行数:20,代码来源:Api.php

示例13: createName

 /**
  * Create OCL Name record
  *
  * @param Mage_Sales_Model_Order_Address|Mage_Customer_Model_Customer $address
  * @return array
  */
 public function createName($address)
 {
     $data = array('firstName' => (string) $address->getFirstname(), 'middleName' => $address->getMiddlename(), 'lastName' => (string) $address->getLastname(), 'prefix' => $address->getPrefix(), 'suffix' => $address->getSuffix());
     return $data;
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:11,代码来源:Data.php


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