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


PHP Mage_Customer_Model_Customer::getGroupId方法代码示例

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


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

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

示例2: setGroupNameAndGenderNameForCustomer

 /**
  * Sets API attributes on a customer object
  *
  * @param Mage_Customer_Model_Customer $customer Customer to work with
  *
  * @return void
  */
 public function setGroupNameAndGenderNameForCustomer($customer)
 {
     if ($this->_customerGroups == null) {
         $this->_customerGroups = array();
         /* @var Mage_Customer_Model_Resource_Group $customerGroups */
         $customerGroups = Mage::getModel('customer/group')->getCollection();
         foreach ($customerGroups as $group) {
             $groupId = $group['customer_group_id'];
             $groupCode = $group['customer_group_code'];
             $this->_customerGroups[$groupId] = $groupCode;
         }
     }
     if (array_key_exists($customer->getGroupId(), $this->_customerGroups)) {
         $customer->setGroupName($this->_customerGroups[$customer->getGroupId()]);
     }
     $customer->setGenderName(Mage::getResourceSingleton('customer/customer')->getAttribute('gender')->getSource()->getOptionText($customer->getGender()));
 }
开发者ID:RxOuchy,项目名称:LDS_Client_Solutions,代码行数:24,代码来源:Data.php

示例3: addSubscriberToSegment

 /**
  * @param Mage_Customer_Model_Customer $customer
  * @param $subscriberId
  * @return $this
  */
 public function addSubscriberToSegment(Mage_Customer_Model_Customer $customer, $subscriberId)
 {
     $segments = Mage::helper('newsman_newsletter')->getSegments();
     if (!$segments) {
         return $this;
     }
     foreach ($segments as $segment) {
         if ($segment['customer_group_id'] == $customer->getGroupId()) {
             Mage::getModel('newsman_newsletter/api_segment')->addSubscriber($segment['segment'], $subscriberId);
         }
     }
     return $this;
 }
开发者ID:Newsman,项目名称:Magento-Newsman,代码行数:18,代码来源:Observer.php

示例4: send

 /**
  * Send customer email
  *
  * @return bool
  */
 public function send()
 {
     if (is_null($this->_website) || is_null($this->_customer)) {
         return false;
     }
     if ($this->_type == 'price' && count($this->_priceProducts) == 0 || $this->_type == 'stock' && count($this->_stockProducts) == 0) {
         return false;
     }
     if (!$this->_website->getDefaultGroup() || !$this->_website->getDefaultGroup()->getDefaultStore()) {
         return false;
     }
     $store = $this->_website->getDefaultStore();
     $storeId = $store->getId();
     if ($this->_type == 'price' && !Mage::getStoreConfig(self::XML_PATH_EMAIL_PRICE_TEMPLATE, $storeId)) {
         return false;
     } elseif ($this->_type == 'stock' && !Mage::getStoreConfig(self::XML_PATH_EMAIL_STOCK_TEMPLATE, $storeId)) {
         return false;
     }
     // set design parameters, required for email (remember current)
     $currentDesign = Mage::getDesign()->setAllGetOld(array('store' => $storeId, 'area' => 'frontend', 'package' => Mage::getStoreConfig('design/package/name', $storeId)));
     Mage::app()->getLocale()->emulate($storeId);
     $translate = Mage::getSingleton('core/translate');
     /* @var $translate Mage_Core_Model_Translate */
     $translate->setTranslateInline(false);
     if ($this->_type == 'price') {
         $this->_getPriceBlock()->setStore($store)->reset();
         foreach ($this->_priceProducts as $product) {
             $product->setCustomerGroupId($this->_customer->getGroupId());
             $this->_getPriceBlock()->addProduct($product);
         }
         $block = $this->_getPriceBlock()->toHtml();
         $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_PRICE_TEMPLATE, $storeId);
     } elseif ($this->_type == 'stock') {
         $this->_getStockBlock()->setStore($store)->reset();
         foreach ($this->_stockProducts as $product) {
             $product->setCustomerGroupId($this->_customer->getGroupId());
             $this->_getStockBlock()->addProduct($product);
         }
         $block = $this->_getStockBlock()->toHtml();
         $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_STOCK_TEMPLATE, $storeId);
     } else {
         Mage::app()->getLocale()->revert();
         return false;
     }
     Mage::getModel('core/email_template')->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))->sendTransactional($templateId, Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId), $this->_customer->getEmail(), $this->_customer->getName(), array('customerName' => $this->_customer->getName(), 'alertGrid' => $block));
     $translate->setTranslateInline(true);
     // revert current design
     Mage::getDesign()->setAllGetOld($currentDesign);
     Mage::app()->getLocale()->revert();
     return true;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:56,代码来源:Email.php

示例5: send

 /**
  * Send customer email
  *
  * @return bool
  */
 public function send()
 {
     if (is_null($this->_website) || is_null($this->_customer)) {
         return false;
     }
     if ($this->_type == 'price' && count($this->_priceProducts) == 0 || $this->_type == 'stock' && count($this->_stockProducts) == 0) {
         return false;
     }
     if (!$this->_website->getDefaultGroup() || !$this->_website->getDefaultGroup()->getDefaultStore()) {
         return false;
     }
     $storeId = $this->_website->getDefaultGroup()->getDefaultStore()->getId();
     $storeCode = $this->_website->getDefaultGroup()->getDefaultStore()->getCode();
     if ($this->_type == 'price' && !Mage::getStoreConfig(self::XML_PATH_EMAIL_PRICE_TEMPLATE, $storeId)) {
         return false;
     } elseif ($this->_type == 'stock' && !Mage::getStoreConfig(self::XML_PATH_EMAIL_STOCK_TEMPLATE, $storeId)) {
         return false;
     }
     Mage::getDesign()->setStore($storeId);
     Mage::getDesign()->setArea('frontend');
     $translate = Mage::getSingleton('core/translate');
     /* @var $translate Mage_Core_Model_Translate */
     $translate->setTranslateInline(false);
     if ($this->_type == 'price') {
         $this->_getPriceBlock()->setStoreCode($storeCode);
         foreach ($this->_priceProducts as $product) {
             $product->setCustomerGroupId($this->_customer->getGroupId());
             $this->_getPriceBlock()->addProduct($product);
         }
         $block = $this->_getPriceBlock()->toHtml();
         $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_PRICE_TEMPLATE, $storeId);
     } elseif ($this->_type == 'stock') {
         $this->_getStockBlock()->setStoreCode($storeCode);
         foreach ($this->_stockProducts as $product) {
             $product->setCustomerGroupId($this->_customer->getGroupId());
             $this->_getStockBlock()->addProduct($product);
         }
         $block = $this->_getStockBlock()->toHtml();
         $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_STOCK_TEMPLATE, $storeId);
     } else {
         return false;
     }
     Mage::getModel('core/email_template')->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))->sendTransactional($templateId, Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId), $this->_customer->getEmail(), $this->_customer->getName(), array('customerName' => $this->_customer->getName(), 'alertGrid' => $block));
     $translate->setTranslateInline(true);
     return true;
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:51,代码来源:Email.php

示例6: send

 /**
  * Send customer email
  *
  * @return bool
  */
 public function send()
 {
     if (is_null($this->_website) || is_null($this->_customer)) {
         return false;
     }
     if ($this->_type == 'price' && count($this->_priceProducts) == 0 || $this->_type == 'stock' && count($this->_stockProducts) == 0) {
         return false;
     }
     if (!$this->_website->getDefaultGroup() || !$this->_website->getDefaultGroup()->getDefaultStore()) {
         return false;
     }
     $store = Mage::getModel('core/store')->load($this->_customer->getStoreId());
     $storeId = $store->getId();
     if ($this->_type == 'price' && !Mage::getStoreConfig(self::XML_PATH_EMAIL_PRICE_TEMPLATE, $storeId)) {
         return false;
     } elseif ($this->_type == 'stock' && !Mage::getStoreConfig(self::XML_PATH_EMAIL_STOCK_TEMPLATE, $storeId)) {
         return false;
     }
     if ($this->_type != 'price' && $this->_type != 'stock') {
         return false;
     }
     $appEmulation = Mage::getSingleton('core/app_emulation');
     $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
     Mage::app()->getTranslator()->init('frontend', true);
     if ($this->_type == 'price') {
         $this->_getPriceBlock()->setStore($store)->reset();
         foreach ($this->_priceProducts as $product) {
             $product->setCustomerGroupId($this->_customer->getGroupId());
             $this->_getPriceBlock()->addProduct($product);
         }
         $block = $this->_getPriceBlock()->toHtml();
         $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_PRICE_TEMPLATE, $storeId);
     } else {
         $this->_getStockBlock()->setStore($store)->reset();
         foreach ($this->_stockProducts as $product) {
             $product->setCustomerGroupId($this->_customer->getGroupId());
             $this->_getStockBlock()->addProduct($product);
         }
         $block = $this->_getStockBlock()->toHtml();
         $templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_STOCK_TEMPLATE, $storeId);
     }
     $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
     Mage::getModel('core/email_template')->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))->sendTransactional($templateId, Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId), $this->_customer->getEmail(), $this->_customer->getName(), array('customerName' => $this->_customer->getName(), 'alertGrid' => $block));
     return true;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:50,代码来源:Email.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: _getCustomerGroupCode

 /**
  * Gets group code by customer's groupId
  *
  * @param Mage_Customer_Model_Customer $customer
  * @return string|null
  */
 protected function _getCustomerGroupCode($customer)
 {
     if (is_null($this->_customerGroups)) {
         $groups = Mage::getResourceModel('customer/group_collection')->load();
         foreach ($groups as $group) {
             $this->_customerGroups[$group->getId()] = $group->getData('customer_group_code');
         }
     }
     if (isset($this->_customerGroups[$customer->getGroupId()])) {
         return $this->_customerGroups[$customer->getGroupId()];
     } else {
         return null;
     }
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:20,代码来源:Customer.php

示例9: setCustomer

 /**
  * Setter.
  * Set customer id
  *
  * @param Mage_Customer_Model_Customer $customer
  * @return Enterprise_Reward_Model_Reward
  */
 public function setCustomer($customer)
 {
     $this->setData('customer_id', $customer->getId());
     $this->setData('customer_group_id', $customer->getGroupId());
     $this->setData('customer', $customer);
     return $this;
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:14,代码来源:Reward.php

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

示例11: getShopgateCustomerGroups

 /**
  * @param Mage_Customer_Model_Customer $magentoCustomer
  * @return array $collection
  */
 public function getShopgateCustomerGroups($magentoCustomer)
 {
     $collection = Mage::getModel('customer/group')->getCollection();
     if (!$magentoCustomer->getId()) {
         $collection->addFieldToFilter('customer_group_code', 'NOT LOGGED IN');
     } else {
         $collection->addFieldToFilter('customer_group_id', $magentoCustomer->getGroupId());
     }
     $groups = array();
     foreach ($collection->getItems() as $customerGroup) {
         $group = array();
         $group['id'] = $customerGroup->getCustomerGroupId();
         $group['name'] = $customerGroup->getCustomerGroupCode();
         $groups[] = $group;
     }
     return $groups;
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:21,代码来源:Customer.php

示例12: isAuthorized

 /**
  * Check if customer is authorized to access store
  *
  * @param Mage_Customer_Model_Customer $customer
  * @param Mage_Core_Model_Store $store
  * @return boolean
  */
 public function isAuthorized($customer, $store = null)
 {
     $groups = $this->getAllowedCustomerGroups($store);
     if (in_array(0, $groups) && !(bool) $customer->getId()) {
         // not logged in
         return true;
     } else {
         // logged in customers within the right group
         return (bool) $customer->getId() && in_array($customer->getGroupId(), $groups);
     }
 }
开发者ID:jocelyn1,项目名称:basemagento,代码行数:18,代码来源:Store.php


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