1. How to get customer First Name, Last Name , Email Address or Details in magento
Before geting the details of a customer you must to have check whether
Customer is Logged in or not, If a customer is logged in then only you
can get details fo the customer. To check whether user logged in or not click here
or you can go to http://xhtmlandcsshelp.blogspot.com/2010/11/magento-check-if-user-logged-in-or-log.html
to get the code. Then write the code below to get customer details
$customer = Mage::getSingleton('customer/session')->getCustomer();
$email = $customer->getEmail();// To get Email Id of a customer
$firstname = $customer->getFirstname();// To get Firstname of a customer
$lastnam e= $customer->getLastname();// To get Last name of a customer
来源: http://xhtmlandcsshelp.blogspot.com/2011/03/get-customer-details-in-magento-how.html
2. Magento: Get customer details : customer id, name, email
Get the logged in customer details like customer id, name, email, etc.
$customer = Mage::getModel('customer/customer')->load(1)->getData();
print_r($customer);
Output:
Array
(
[entity_id] => 1
[entity_type_id] => 1
[attribute_set_id] => 0
[website_id] => 1
[email] => john.doe@example.com
[group_id] => 1
[increment_id] => 000000001
[store_id] => 1
[created_at] => 2007-08-30 23:23:13
[updated_at] => 2008-08-08 12:28:24
[is_active] => 1
[firstname] => John
[lastname] => Doe
[password_hash] => 204948a4020ed1d0e4238db2277d5:eg
[prefix] =>
[middlename] =>
[suffix] =>
[taxvat] =>
[default_billing] => 274
[default_shipping] => 274
)
Getting customer firstname.
$customer = Mage::getModel('customer/customer')->load(1);
$customerFirstName = $customer->getFirstname();
Similarly, we can get lastname, email, etc. ( [website_id] = getWebsiteId() )
来源: http://ka.lpe.sh/2011/06/19/magento-get-customer-details-customer-id-name-email/
3. Magento: Get customer details via helper
echo $this->helper('customer')->getCustomerName();
// echo $customerName = Mage::helper('customer')->getCustomerName();
或者
echo "<pre>"; print_r($this->helper('customer')->getCustomer()->getData()); echo "</pre>";
//echo "<pre>"; print_r(Mage::helper('customer')->getCustomer()->getData()); echo "</pre>";
来源: http://stackoverflow.com/questions/416553/current-user-in-magento
分享到:
相关推荐
什么是Magento........................................................................................................................6 Magento的元素和专业术语.............................................
《Magento全面指南》是Apress出版社在2009年12月出版的一本专业书籍,专注于介绍Magento电子商务平台的详细知识。这本书是 Magento开发者、店主和电子商务从业者的必备参考资料,它深入浅出地讲解了Magento平台的...
#### 一、书籍基本信息 - **书名**:Magento 1.3 PHP Developer's Guide - **出版社**:Packt Publishing - **出版时间**:2010年1月 - **作者**:Jamie Huskisson - **ISBN**:978-1-847197-42-9 #### 二、书籍...
.Magento安装.Magento安装.Magento安装.Magento安装.Magento安装.Magento安装
本书籍《Magento Theme Design》与《The Definitive Guide to Magento》都是深入探讨这个平台的重要资源,旨在帮助读者掌握Magento的主题设计和全面理解。 首先,《Magento Theme Design》专注于主题开发,这是...
在Magento中,处理用户登录状态和获取登录用户的信息是一项基本但至关重要的任务,这不仅关系到用户体验,还涉及到安全性、个性化推荐等多个方面。 ### Magento判断用户登录状态 在Magento中,判断用户是否已经...
### Magento 全面指南知识点概览 #### 一、引言 《Magento全面指南》是电子商务平台Magento的权威参考书籍,由Adam McCombs与Robert Banh共同编写。本书不仅适用于初学者,对于有一定经验的开发者和技术人员也同样...
Chapter 2, Magento 2 System Tools, explains how to install Magento 2 via the command shell. Magento released a new powerful tool to manage and install sample data, reindex your database, back up your ...
《Magento 1.3 销售策略实战指南》是由Packt Publishing在2010年3月出版的一本专门针对Magento电子商务平台的销售技巧书籍。这本书面向的是那些想要提升在线商店销售业绩、优化购物体验的 Magento 用户。Magento 是...
Magento是一款功能强大的开源电子商务解决方案,以其高度可定制化、模块化的架构和丰富的功能集深受开发者的喜爱。 本书内容涵盖了Magento的基础知识到高级开发技巧,包括但不限于以下关键知识点: 1. **Magento...
Chapter 2, Magento 2 System Tools, explains how to install Magento 2 via the command shell. Magento released a new powerful tool to manage and install sample data, reindex your database, back up your ...
2. **多店支持**:Magento 1.8.0.0 支持多店铺管理,用户可以在同一个后台管理系统下运营多个不同主题的商店。 3. **强大的商品管理**:提供了详细的商品分类、属性和选项设置,支持多种促销规则,如优惠券、折扣、...
这个版本是Magento的早期稳定版本,具有多项改进和增强的功能,旨在提高性能、安全性和用户体验。 一、Magento 1.9.0.1的核心特性: 1. 多店铺管理:Magento 1.9.0.1 支持多个店面和网站,允许商家在一个后台管理...
The book is a step-by-step guide to theming Magento, aimed at readers with little technical expertise. In short, the book guides the common aspects of theming and customizing Magento 1.4 and an ...
Magento是开源电子商务平台的一个强大代表,它为商家提供了一个高度可定制和功能丰富的环境来创建在线商店。在本文中,我们将深入探讨Magento 1.9.2.0版本,这是一个针对网站开发和商务独立站的老版64位系统。 首先...
You’ll start by getting a general understanding of what Magento is, why and how you should use it, and whether it is possible and feasible to migrate from an old web store to Magento 2. As you work ...
### Magento中文用户指南知识点概述 #### Magento简介 - **什么是Magento?** - Magento是一款基于开源技术构建的电子商务平台,为在线商家提供了前所未有的灵活性以及对电子商务网站外观、内容和功能的强大控制...
- RSS订阅可以让用户实时获取更新信息。 - 如新品发布、促销活动等。 **层次性定价 (Tier Pricing):** - 根据购买数量提供折扣价格。 - 适用于批发业务。 **目录定价规则 (Catalog Price Rules):** - 设置特定...
【深入理解Magento——配置系统详解】 Magento是一款强大的开源电子商务平台,其配置系统是其核心组成部分,被...通过学习和掌握这一系统,开发者能够更有效地构建和维护Magento电商平台,提升用户体验和运营效率。