• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Mage_Customer_Model_Customer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _welcomeCustomer

 protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
 {
     $this->_getSession()->addSuccess($this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()));
     if ($this->_isVatValidationEnabled()) {
         // Show corresponding VAT message to customer
         $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType();
         $userPrompt = '';
         switch ($configAddressType) {
             case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING:
                 $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you shipping address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
                 break;
             default:
                 $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you billing address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
         }
         $this->_getSession()->addSuccess($userPrompt);
     }
     $customer->sendNewAccountEmail($isJustConfirmed ? 'confirmed' : 'registered', '', Mage::app()->getStore()->getId());
     if (Mage::getModel("bmicalculator/bmi")->getMyw8status()) {
         $successUrl = Mage::getUrl("bmicalculator/index/myw8", array('_secure' => true));
     } else {
         $successUrl = Mage::getUrl("customer/account/edit", array('_secure' => true));
     }
     //      $successUrl = Mage::getUrl("bmicalculator/index/myw8", array('_secure'=>true));
     if ($this->_getSession()->getBeforeAuthUrl()) {
         $successUrl = $this->_getSession()->getBeforeAuthUrl(true);
     }
     return $successUrl;
 }
开发者ID:radoantal9,项目名称:magento_pac,代码行数:28,代码来源:AccountController.php


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


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


示例4: triggerEvent

 /**
  * Referral Signup trigger
  * 
  * @param Mage_Customer_Model_Customer $customer
  * @return TBT_RewardsReferral_Model_Referral_Abstract 
  */
 public function triggerEvent(Mage_Customer_Model_Customer $customer)
 {
     $this->loadByEmail($customer->getEmail());
     if (!$this->getReferralParentId()) {
         Mage::helper('rewardsref')->initateSessionReferral($customer);
         $this->loadByEmail($customer->getEmail());
         if (!$this->getReferralParentId()) {
             return $this;
         }
     }
     // update referral status
     $this->setReferralChildId($customer->getId());
     $this->setReferralStatus($this->getReferralStatusId());
     $this->save();
     $points = $this->getTotalReferralPoints();
     if ($points->isEmpty()) {
         return $this;
     }
     try {
         foreach ($points->getPoints() as $currencyId => $points_amount) {
             $transfer = Mage::getModel('rewardsref/transfer');
             $transferStatus = Mage::getStoreConfig('rewards/InitialTransferStatus/ReferralSignup');
             $transfer->create($points_amount, $currencyId, $this->getReferralParentId(), $customer->getId(), $this->getReferralTransferMessage($customer), $this->getTransferReasonId(), $transferStatus);
         }
         // send affiliate an email of the transaction
         $affiliate = $this->getParentCustomer();
         if ($affiliate->getRewardsrefNotifyOnReferral()) {
             $msg = $this->getReferralTransferMessage($customer);
             $this->sendConfirmation($affiliate, $customer->getEmail(), $customer->getName(), $msg, (string) $points);
         }
     } catch (Exception $e) {
         Mage::logException($e);
     }
     return $this;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:41,代码来源:Signup.php


示例5: setCustomerData

 /**
  * Set customer data.
  *
  * @param Mage_Customer_Model_Customer $customer
  */
 public function setCustomerData(Mage_Customer_Model_Customer $customer)
 {
     $this->customer = $customer;
     $this->setReviewCollection();
     $website = $customer->getStore()->getWebsite();
     if ($website && Mage::helper('ddg')->isSweetToothToGo($website)) {
         $this->setRewardCustomer($customer);
     }
     foreach ($this->getMappingHash() as $key => $field) {
         /**
          * call user function based on the attribute mapped.
          */
         $function = 'get';
         $exploded = explode('_', $key);
         foreach ($exploded as $one) {
             $function .= ucfirst($one);
         }
         try {
             $value = call_user_func(array('self', $function));
             $this->customerData[$key] = $value;
         } catch (Exception $e) {
             Mage::logException($e);
         }
     }
 }
开发者ID:dotmailer,项目名称:dotmailer-magento-extension,代码行数:30,代码来源:Customer.php


示例6: _welcomeCustomer

 protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
 {
     $this->_getSession()->addSuccess($this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()));
     if ($this->_isVatValidationEnabled()) {
         $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType();
         $userPrompt = '';
         switch ($configAddressType) {
             case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING:
                 $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you shipping address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
                 break;
             default:
                 $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you billing address for proper VAT calculation', Mage::getUrl('customer/address/edit'));
         }
         $this->_getSession()->addSuccess($userPrompt);
     }
     $customer->sendNewAccountEmail($isJustConfirmed ? 'confirmed' : 'registered', '', Mage::app()->getStore()->getId());
     $cusromerRedirectStatus = Mage::getStoreConfig('customer/customercreateredirect/active');
     $customerCreateRedirectUrl = Mage::getStoreConfig('customer/customercreateredirect/redirecturl');
     if ($cusromerRedirectStatus == 1) {
         $successUrl = Mage::getUrl() . $customerCreateRedirectUrl;
     } else {
         $successUrl = Mage::getUrl('*/*/index', array('_secure' => true));
     }
     if ($this->_getSession()->getBeforeAuthUrl()) {
         if ($cusromerRedirectStatus == 1) {
             $successUrl = Mage::getUrl() . $customerCreateRedirectUrl;
         } else {
             $successUrl = $this->_getSession()->getBeforeAuthUrl(true);
         }
     }
     return $successUrl;
 }
开发者ID:enjoy2000,项目名称:gemz,代码行数:32,代码来源:AccountController.php


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


示例8: load

 public function load($printQuery = false, $logQuery = false)
 {
     $this->_select = $this->_read->select();
     $entityTable = $this->getEntity()->getEntityTable();
     $paidTable = $this->getAttribute('grand_total')->getBackend()->getTable();
     $idField = $this->getEntity()->getIdFieldName();
     $this->getSelect()->from(array('sales' => $entityTable), array('store_id', 'lifetime' => 'sum(sales.base_grand_total)', 'avgsale' => 'avg(sales.base_grand_total)', 'num_orders' => 'count(sales.base_grand_total)'))->where('sales.entity_type_id=?', $this->getEntity()->getTypeId())->group('sales.store_id');
     if ($this->_customer instanceof Mage_Customer_Model_Customer) {
         $this->getSelect()->where('sales.customer_id=?', $this->_customer->getId());
     }
     $this->printLogQuery($printQuery, $logQuery);
     try {
         $values = $this->_read->fetchAll($this->getSelect()->__toString());
     } catch (Exception $e) {
         $this->printLogQuery(true, true, $this->getSelect()->__toString());
         throw $e;
     }
     $stores = Mage::getResourceModel('core/store_collection')->setWithoutDefaultFilter()->load()->toOptionHash();
     if (!empty($values)) {
         foreach ($values as $v) {
             $obj = new Varien_Object($v);
             $storeName = isset($stores[$obj->getStoreId()]) ? $stores[$obj->getStoreId()] : null;
             $this->_items[$v['store_id']] = $obj;
             $this->_items[$v['store_id']]->setStoreName($storeName);
             $this->_items[$v['store_id']]->setAvgNormalized($obj->getAvgsale() * $obj->getNumOrders());
             foreach ($this->_totals as $key => $value) {
                 $this->_totals[$key] += $obj->getData($key);
             }
         }
         if ($this->_totals['num_orders']) {
             $this->_totals['avgsale'] = $this->_totals['lifetime'] / $this->_totals['num_orders'];
         }
     }
     return $this;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:35,代码来源:Collection.php


示例9: isCustomerFacebookUser

 /**
  * @param Mage_Customer_Model_Customer $customer
  * @return bool
  * @throws Exception
  */
 public function isCustomerFacebookUser(Mage_Customer_Model_Customer $customer)
 {
     $customerEmail = $customer->getData('email');
     $facebookUser = $this->getFacebookUser()->setData('store_id', $customer->getStoreId());
     $facebookUser->loadByEmail($customerEmail);
     return (bool) $facebookUser->getId() && $customer->getStoreId() == $facebookUser->getData('store_id');
 }
开发者ID:alaa-almaliki,项目名称:facebookconnect,代码行数:12,代码来源:Customer.php


示例10: assignCustomerWithAddressChange

 public function assignCustomerWithAddressChange(Mage_Customer_Model_Customer $customer, Mage_Sales_Model_Quote_Address $billingAddress = null, Mage_Sales_Model_Quote_Address $shippingAddress = null)
 {
     if ($customer->getId()) {
         $this->setCustomer($customer);
         if (!is_null($billingAddress)) {
             $this->setBillingAddress($billingAddress);
         } else {
             $defaultBillingAddress = $customer->getDefaultBillingAddress();
             if ($defaultBillingAddress && $defaultBillingAddress->getId()) {
                 $billingAddress = Mage::getModel('request4quote/quote_address')->importCustomerAddress($defaultBillingAddress);
                 $this->setBillingAddress($billingAddress);
             }
         }
         if (is_null($shippingAddress)) {
             $defaultShippingAddress = $customer->getDefaultShippingAddress();
             if ($defaultShippingAddress && $defaultShippingAddress->getId()) {
                 $shippingAddress = Mage::getModel('request4quote/quote_address')->importCustomerAddress($defaultShippingAddress);
             } else {
                 $shippingAddress = Mage::getModel('request4quote/quote_address');
             }
         }
         $this->setShippingAddress($shippingAddress);
     }
     return $this;
 }
开发者ID:VinuWebtech,项目名称:production267,代码行数:25,代码来源:Quote.php


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


示例12: setCustomer

 /**
  * Setter for $_customer
  *
  * @param Mage_Customer_Model_Customer $customer
  * @return Enterprise_Checkout_Model_Cart
  */
 public function setCustomer($customer)
 {
     if ($customer instanceof Varien_Object && $customer->getId()) {
         $this->_customer = $customer;
         $this->_quote = null;
     }
     return $this;
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:14,代码来源:Cart.php


示例13: setUp

 protected function setUp()
 {
     $customer = new Mage_Customer_Model_Customer();
     $customer->load(1);
     Mage::register('current_customer', $customer);
     $layout = new Mage_Core_Model_Layout(array('area' => 'adminhtml'));
     $this->_block = $layout->createBlock('Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion');
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:8,代码来源:Accordion.php


示例14: minimunOrderQty

 /**
  * Check if quote meets the minimun quantity
  * of total items for a specific customer
  *
  * @todo   Change to more meaningful name
  *
  * @param  Mage_Sales_Model_Quote       $quote
  * @param  Mage_Customer_Model_Customer $customer
  * @return int|false
  */
 public function minimunOrderQty(Mage_Sales_Model_Quote $quote, Mage_Customer_Model_Customer $customer)
 {
     $minQtyForCustomer = $this->getConfigValue($customer->getGroupId());
     if ($quote->getItemsQty() < $minQtyForCustomer && $quote->getItemsQty() !== 0) {
         return $minQtyForCustomer;
     }
     return false;
 }
开发者ID:jahvi,项目名称:MinTotalQty,代码行数:18,代码来源:Data.php


示例15: beforeSave

 /**
  * Prepare data before attribute save
  *
  * @param Mage_Customer_Model_Customer $customer
  * @return Mage_Customer_Model_Attribute_Backend_Data_Boolean
  */
 public function beforeSave($customer)
 {
     $attributeName = $this->getAttribute()->getName();
     $inputValue = $customer->getData($attributeName);
     $sanitizedValue = !empty($inputValue) ? '1' : '0';
     $customer->setData($attributeName, $sanitizedValue);
     return $this;
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:14,代码来源:Boolean.php


示例16: loginByCustomer

 public function loginByCustomer(Mage_Customer_Model_Customer $customer)
 {
     if ($customer->getConfirmation()) {
         $customer->setConfirmation(null);
         $customer->save();
     }
     Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
 }
开发者ID:markus99,项目名称:Inchoo_SocialConnect,代码行数:8,代码来源:Google.php


示例17: getCustomerTipoPessoa

 /**
  * @param Mage_Customer_Model_Customer $customer
  *
  * @return bool|string
  * @throws \Mage_Core_Exception
  */
 protected function getCustomerTipoPessoa($customer)
 {
     $attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'tipopessoa');
     $tipopessoa = $customer->getTipopessoa();
     if ($attribute && $attribute->usesSource() && $tipopessoa) {
         return $attribute->getSource()->getOptionText($tipopessoa);
     }
     return false;
 }
开发者ID:edvanmacedo,项目名称:vindi-magento,代码行数:15,代码来源:PaymentMethod.php


示例18: setCustomerFilter

 /**
  * Set customer filter
  *
  * @param Mage_Customer_Model_Customer $customer
  * @return Mage_Customer_Model_Resource_Address_Collection
  */
 public function setCustomerFilter($customer)
 {
     if ($customer->getId()) {
         $this->addAttributeToFilter('parent_id', $customer->getId());
     } else {
         $this->addAttributeToFilter('parent_id', '-1');
     }
     return $this;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:15,代码来源:Collection.php


示例19: getAllPasswordHashesForCustomer

 public function getAllPasswordHashesForCustomer(Mage_Customer_Model_Customer $customer)
 {
     $passwordHashes = [];
     $records = $this->getCollection()->addFilter('customer_id', $customer->getId());
     foreach ($records as $record) {
         array_push($passwordHashes, $record->getPasswordHash());
     }
     return $passwordHashes;
 }
开发者ID:all-bear,项目名称:magento.pci_password,代码行数:9,代码来源:PasswordHistory.php


示例20: validateCustomerGroup

 /**
  * Check customer's group
  *
  * @param Mage_Customer_Model_Customer $customer
  *
  * @return bool
  */
 public function validateCustomerGroup($customer)
 {
     if (!$this->getId() || !$customer->getId()) {
         return FALSE;
     }
     $customerGroupId = $customer->getData('group_id');
     $couponGroupIds = $this->getData('customer_group_ids');
     $result = in_array($customerGroupId, $couponGroupIds);
     return $result;
 }
开发者ID:HPTTeam,项目名称:hackathon,代码行数:17,代码来源:Coupon.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Mage_Downloadable_Model_Link类代码示例发布时间:2022-05-23
下一篇:
PHP Mage_Customer_Model_Address_Abstract类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap