- 浏览: 71988 次
- 性别:
- 来自: 上海
最新评论
In Block class:
In template(phtml):
public function _toHtml(){ Mage::getSingleton('customer/session')->setBeforeAuthUrl($this->getRequest()->getRequestUri()); if (!Mage::getSingleton('customer/session')->isLoggedIn()){ header("Status: 301"); header('Location: '.$this->getUrl('customer/account/login')) ; // send to the login page exit; } }
In template(phtml):
Mage::getSingleton('customer/session')->setBeforeAuthUrl($this->getRequest()->getRequestUri()); if (!Mage::getSingleton('customer/session')->isLoggedIn()){ header("Status: 301"); header('Location: '.$this->getUrl('customer/account/login')) ; // send to the login page exit;
发表评论
-
Magento随机生成sales rule的coupon code
2013-01-02 22:09 2229在Magento中可以使用SalesRule模块下的Mage_ ... -
Magento 后台配置中实现日期选择 (Date picker)
2012-12-28 15:07 2461首先,创建一个新的Form Field 类: <?p ... -
获得指定customer 购买的产品数据
2011-12-10 20:54 1310获得指定customer 购买的产品信息,如果是configu ... -
将缺货产品放在产品列表后面
2011-12-10 20:50 1364Rewrite Mage_Catalog_Model_Laye ... -
Mac Lion上安装配置Nginx PHP PHP-FPM
2011-12-10 16:01 7994<!--?xml version="1.0&q ... -
How to customize Magento as CMS system (1.5.0 CE)
2011-03-06 22:42 1023Before install: 1. Go to app/et ... -
Use call back function to proccess Magento large collection
2011-01-19 12:58 912$orders = Mage::getModel('sal ... -
How to remove unnecessary columns in Magento collection
2011-01-19 12:56 1086$orders = Mage::getModel('sal ... -
How to calculate currency according to reward points rate in Magento
2011-01-13 18:03 1288$rate = Mage::getModel('enter ... -
Magento二次开发的利器:Rewrite
2010-12-08 17:15 2704Magento是一个十分优秀的电子商务系统,但是有时候我们需要 ... -
增加Magento后台管理功能三:在后台设置(System/Configuration)中加入自定义设置
2010-11-30 16:17 1946在模块的etc目录下新建system.xml配置文件,内容如下 ... -
增加Magento后台管理功能二:开发后台Controller
2010-11-30 16:02 2682在模块的controllers目录下创建Adminhtml目录 ... -
增加Magento后台管理功能一:在后台管理界面加入菜单
2010-11-30 15:47 4493在模块的etc目录下增加adminhtml.xml配置文件,用 ... -
Magento在CMS Page中增加用户信息变量
2010-11-26 10:14 2798Magento的cms页面和static block页面中可以 ... -
Magento根据不同的浏览器自动切换package或 theme
2010-11-26 10:05 2027在后台设置中: System > Configurat ... -
Magento让后台数据列表中的action列链接在新窗口打开
2010-11-08 16:56 1126'actions' => array( ... -
Maegen获得后台当前用户的信息
2010-11-08 16:53 839$admin = Mage::getSingleton(' ... -
Magento中用子类替换Block
2010-10-15 10:47 1823Step 1:创建一个新的Module Step 2: 编辑模 ... -
Magento中添加带有选项的属性
2010-10-14 14:49 1417下面的代码为Customer实体添加了性别属性,有两个可选值 ... -
Magento为后台用户保存操作日志(企业版)
2010-09-19 17:00 2728protected function _logAdm ...
相关推荐
如何block来电在CUCM中 1.在GW 上锁定 2.在CUCM route patten 中锁定
How to bind data to different DataTemplate in Universal Windows Platform apps
How to use epoll A complete example in C How to use epoll A complete example in C How to use epoll A complete example in C How to use epoll A complete example in C
MBA CASE, HOW TO MAKE YOUR CASE IN 30 SECOND OR LESS
HowTo PortScan in C# HowTo PortScan in C#
How to logininto another interface
how to work with crystal report in sap business one
You should ensure that the server's public keys are loaded by the client as described in How to use SFTP (with server validation - known hosts), or you may want to switch off server validation to get ...
SMB-HOWTO (12KB) Session Message Block (SMB) protocol Sound-HOWTO (29KB) 在Linux下的关於音效的支援. Sound-Playing-HOWTO (14KB) Linux上播放各式声音格式的应用程式. UPS-HOWTO (12KB) 如何...
Polya reveals how the mathematical method of demonstrating a proof or finding an unknown can be of help in attacking any problem that can be "reasoned" out - from building a bridge to winning a game ...
How to Design Worlds: Imaginative Programming in DrScheme
How to Block One or More Networks From a BGP Peer!
How to create a shortcut to another file
How to make mistakes in Python
How to use OpenCV step by step in VC, 介绍如何使用opencv
How not to Program in C++A 111 Broken Programs and 3 Working Ones, or Why Does 2+2=5986
How to Write a Good Scientific Paper by Chris A. Mack is a valuable resource for all students and faculty in science and engineering. SPIE is pleased to make it available here at no charge as a PDF ...
How to Login into another system
how-to-code-in-python3 how-to-code-in-python3 how-to-code-in-python3
how-to-c-response, 对"How to C in 2016"的评论 Matt Matt ,Sat,Sat,Sat,updated,updatedMatt ( 据我所知他的网站没有提到他最近的NAME ) 写了一篇文章。 它被链接到来自和黑客新闻的链接;后者是我看到的。...