TavishInfo_Customer - Version 0.1.0

Version Notes

Customer login Redirect

Download this release

Release Info

Developer MagentoModules
Extension TavishInfo_Customer
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/local/TavishInfo/Customer/Helper/Data.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * http://www.magentomodules.in/
4
+ *
5
+ * @category Tavish Info
6
+ * @package Tavish_Info
7
+ * @author Magento Modules <magentomodules.in@gmail.com>
8
+ *
9
+ */
10
+ class TavishInfo_Customer_Helper_Data extends Mage_Core_Helper_Abstract
11
+ {
12
+
13
+ }
app/code/local/TavishInfo/Customer/controllers/AccountController.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * http://www.magentomodules.in/
4
+ *
5
+ * @category Tavish Info
6
+ * @package Tavish_Info
7
+ * @author Magento Modules <magentomodules.in@gmail.com>
8
+ *
9
+ */
10
+ require_once Mage::getModuleDir('controllers', 'Mage_Customer').DS.'AccountController.php';
11
+
12
+ class TavishInfo_Customer_AccountController extends Mage_Customer_AccountController
13
+ {
14
+
15
+ protected function _loginPostRedirect()
16
+ {
17
+ $session = $this->_getSession();
18
+ $moduleStaus = Mage::getStoreConfig('customer/tavishcustomerloginredirect/enable');
19
+ $redirectUrl = trim(Mage::getStoreConfig('customer/tavishcustomerloginredirect/url'));
20
+
21
+ if($moduleStaus){
22
+ if($session->isLoggedIn()){
23
+ $redirectUrl = Mage::getUrl(ltrim( str_replace(Mage::getBaseUrl(), '', $redirectUrl), '/'));
24
+ $session->setBeforeAuthUrl($redirectUrl);
25
+ }else{
26
+ $session->setBeforeAuthUrl(Mage::helper('customer')->getLoginUrl());
27
+ }
28
+ }else{
29
+ parent::_loginPostRedirect();
30
+ return;
31
+ }
32
+ $this->_redirectUrl($session->getBeforeAuthUrl(true));
33
+ }
34
+ }
app/code/local/TavishInfo/Customer/etc/config.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <TavishInfo_Customer>
5
+ <version>0.1.0</version>
6
+ </TavishInfo_Customer>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <customer>
11
+ <args>
12
+ <modules>
13
+ <tavishinfo_customer before="Mage_Customer">TavishInfo_Customer</tavishinfo_customer>
14
+ </modules>
15
+ </args>
16
+ </customer>
17
+ </routers>
18
+ </frontend>
19
+ </config>
app/code/local/TavishInfo/Customer/etc/system.xml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <customer translate="label" module="customer">
5
+ <class>separator-top</class>
6
+ <label>Customer Configuration</label>
7
+ <tab>customer</tab>
8
+ <sort_order>130</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <tavishcustomerloginredirect translate="label">
14
+ <label>Customer Login Redirect</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>0</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <fields>
21
+ <enable translate="label">
22
+ <label>Enable</label>
23
+ <frontend_type>select</frontend_type>
24
+ <source_model>adminhtml/system_config_source_yesno</source_model>
25
+ <sort_order>1</sort_order>
26
+ <show_in_default>1</show_in_default>
27
+ <show_in_website>1</show_in_website>
28
+ <show_in_store>1</show_in_store>
29
+ </enable>
30
+ <url translate="label">
31
+ <label>Redirect Url After Login</label>
32
+ <frontend_type>text</frontend_type>
33
+ <sort_order>2</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ <comment><![CDATA[ <span style ="color:red;">Note:-
38
+ For example: customer/account/edit <br/>leave empty for homepage </span>]]></comment>
39
+ </url>
40
+ </fields>
41
+ </tavishcustomerloginredirect>
42
+ </groups>
43
+ </customer>
44
+ </sections>
45
+ </config>
app/etc/modules/TavishInfo_Customer.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <TavishInfo_Customer>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </TavishInfo_Customer>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>TavishInfo_Customer</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license>OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Customer login Redirect</summary>
10
+ <description>Customer login Redirect</description>
11
+ <notes>Customer login Redirect</notes>
12
+ <authors><author><name>MagentoModules</name><user>MagentoModules</user><email>magentomodules.in@gmail.com</email></author></authors>
13
+ <date>2014-04-04</date>
14
+ <time>15:43:10</time>
15
+ <contents><target name="magelocal"><dir name="TavishInfo"><dir name="Customer"><dir name="Helper"><file name="Data.php" hash="4d4f300df3e0193228b046b68f1e63d6"/></dir><dir name="controllers"><file name="AccountController.php" hash="baaac65b4a4c2fdc2d8310d2c2c72454"/></dir><dir name="etc"><file name="config.xml" hash="88f537eac019c2d08f7d60913297826a"/><file name="system.xml" hash="1fb91f8a213c083a95e15a00f2ce75dd"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TavishInfo_Customer.xml" hash="d966b241877dadecb6c1fd4c0c953147"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>