Netgo_MulistoreNewsletter - Version 1.0.0

Version Notes

First Preview Release

Download this release

Release Info

Developer NetGo
Extension Netgo_MulistoreNewsletter
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

User_manual.pdf ADDED
Binary file
app/code/community/Netgo/MulistoreNewsletter/Helper/Data.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** Multistore Newsletter Subscription ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_MulistoreNewsletter
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+ class Netgo_MulistoreNewsletter_Helper_Data extends Mage_Core_Helper_Abstract
14
+ {
15
+ }
16
+
app/code/community/Netgo/MulistoreNewsletter/Model/Newsletter/Mysql4/Subscriber.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /***************************************
3
+ *** Multistore Newsletter Subscription ***
4
+ ***************************************
5
+ *
6
+ * @copyright Copyright (c) 2015
7
+ * @company NetAttingo Technologies
8
+ * @package Netgo_MulistoreNewsletter
9
+ * @author NetGo
10
+ * @dev netattingomails@gmail.com
11
+ *
12
+ */
13
+ class Netgo_MulistoreNewsletter_Model_Newsletter_Mysql4_Subscriber extends Mage_Newsletter_Model_Mysql4_Subscriber
14
+ {
15
+
16
+ /**
17
+ * Load subscriber from DB by email
18
+ *
19
+ * @param string $subscriberEmail
20
+ * @return array
21
+ */
22
+ public function loadByEmail($subscriberEmail)
23
+ {
24
+
25
+ /** @var $customerSession Mage_Customer_Model_Session */
26
+ $customerSession = Mage::getSingleton('customer/session');
27
+ $ownerId = Mage::getModel('customer/customer')
28
+ ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
29
+ ->loadByEmail($subscriberEmail)
30
+ ->getId();
31
+
32
+ $storeId = $customerSession->isLoggedIn() && $ownerId == $customerSession->getId()
33
+ ? $customerSession->getCustomer()->getStoreId()
34
+ : Mage::app()->getStore()->getId();
35
+
36
+ $select = $this->_read->select()
37
+ ->from($this->getMainTable())
38
+ ->where('subscriber_email=:subscriber_email')
39
+ ->where('store_id=:store_id'); // Add store ID for newsletters
40
+
41
+ $result = $this->_read->fetchRow($select, array(
42
+ 'subscriber_email' => $subscriberEmail,
43
+ 'store_id' => $storeId
44
+ ));
45
+
46
+ if (!$result) {
47
+ return array();
48
+ }
49
+
50
+ return $result;
51
+
52
+ //parent::loadByEmail($subscriberEmail);
53
+ }
54
+
55
+ /**
56
+ * Load subscriber by customer
57
+ *
58
+ * @param Mage_Customer_Model_Customer $customer
59
+ * @return array
60
+ */
61
+ public function loadByCustomer(Mage_Customer_Model_Customer $customer)
62
+ {
63
+
64
+
65
+ $select = $this->_read->select()
66
+ ->from($this->getMainTable())
67
+ ->where('customer_id=:customer_id')
68
+ ->where('store_id=:store_id');
69
+
70
+ $result = $this->_read->fetchRow($select, array(
71
+ 'customer_id' => $customer->getId(),
72
+ 'store_id' => $customer->getStoreId()
73
+ ));
74
+
75
+ if ($result) {
76
+ return $result;
77
+ }
78
+
79
+ $select = $this->_read->select()
80
+ ->from($this->getMainTable())
81
+ ->where('subscriber_email=:subscriber_email')
82
+ ->where('store_id=:store_id');
83
+
84
+ $result = $this->_read->fetchRow($select, array(
85
+ 'subscriber_email' => $customer->getEmail(),
86
+ 'store_id' => $customer->getStoreId()
87
+ ));
88
+
89
+ if ($result) {
90
+ return $result;
91
+ }
92
+
93
+ return array();
94
+ }
95
+ }
app/code/community/Netgo/MulistoreNewsletter/etc/adminhtml.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** Multistore Newsletter Subscription ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_MulistoreNewsletter
10
+ * @author NetGo
11
+ * @dev netattingomails@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <acl>
17
+ <resources>
18
+ <admin>
19
+ <children>
20
+ <system>
21
+ <children>
22
+ <config>
23
+ <children>
24
+ <multinews translate="title" module="mulistorenewsletter">
25
+ <title>Multistore Newsletter Section</title>
26
+ <sort_order>0</sort_order>
27
+ </multinews>
28
+ </children>
29
+ </config>
30
+ </children>
31
+ </system>
32
+ </children>
33
+ </admin>
34
+ </resources>
35
+ </acl>
36
+ </config>
app/code/community/Netgo/MulistoreNewsletter/etc/config.xml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** Multistore Newsletter Subscription ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_MulistoreNewsletter
10
+ * @author NetGo
11
+ * @dev netattingomails@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <modules>
17
+ <Netgo_MulistoreNewsletter>
18
+ <version>1.0.0</version>
19
+ </Netgo_MulistoreNewsletter>
20
+ </modules>
21
+ <global>
22
+ <helpers>
23
+ <mulistorenewsletter>
24
+ <class>Netgo_MulistoreNewsletter_Helper</class>
25
+ </mulistorenewsletter>
26
+ </helpers>
27
+ <models>
28
+ <mulistorenewsletter>
29
+ <class>Netgo_MulistoreNewsletter_Model</class>
30
+ <resourceModel>mulistorenewsletter_mysql4</resourceModel>
31
+ </mulistorenewsletter>
32
+ <newsletter_mysql4>
33
+ <rewrite>
34
+ <subscriber>Netgo_MulistoreNewsletter_Model_Newsletter_Mysql4_Subscriber</subscriber>
35
+ </rewrite>
36
+ </newsletter_mysql4>
37
+ </models>
38
+ </global>
39
+ </config>
app/code/community/Netgo/MulistoreNewsletter/etc/system.xml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** Multistore Newsletter Subscription ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_MulistoreNewsletter
10
+ * @author NetGo
11
+ * @dev netattingomails@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <tabs>
17
+ <netgo translate="label" module="mulistorenewsletter">
18
+ <label>Netgo</label>
19
+ <sort_order>0</sort_order>
20
+ </netgo>
21
+ </tabs>
22
+ <sections>
23
+ <multinews translate="label" module="mulistorenewsletter">
24
+ <label>Multistore Newsletter</label>
25
+ <tab>netgo</tab>
26
+ <frontend_type>text</frontend_type>
27
+ <sort_order>0</sort_order>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ <groups>
32
+ <multinewss translate="label">
33
+ <label>Multistore Newsletter Setting</label>
34
+ <frontend_type>text</frontend_type>
35
+ <sort_order>0</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <fields>
40
+ <enable translate="label">
41
+ <label>Multistore Newsletter Setting</label>
42
+ <frontend_type>select</frontend_type>
43
+ <source_model>adminhtml/system_config_source_yesno</source_model>
44
+ <sort_order>0</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ <comment>Please enable/disable module</comment>
49
+ </enable>
50
+ </fields>
51
+ </multinewss>
52
+ </groups>
53
+ </multinews>
54
+ </sections>
55
+ </config>
app/etc/modules/Netgo_MulistoreNewsletter.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /***************************************
4
+ *** Multistore Newsletter Subscription ***
5
+ ***************************************
6
+ *
7
+ * @copyright Copyright (c) 2015
8
+ * @company NetAttingo Technologies
9
+ * @package Netgo_MulistoreNewsletter
10
+ * @author NetGo
11
+ * @dev netattingomails@gmail.com
12
+ *
13
+ */
14
+ -->
15
+ <config>
16
+ <modules>
17
+ <Netgo_MulistoreNewsletter>
18
+ <active>true</active>
19
+ <codePool>community</codePool>
20
+ <version>1.0.0</version>
21
+ </Netgo_MulistoreNewsletter>
22
+ </modules>
23
+ </config>
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Netgo_MulistoreNewsletter</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Allows customer to subscribe newsletter more than one store</summary>
10
+ <description>This extension is developed with the purpose to sign up newsletter in any website having multi store with &#xD;
11
+ &#xD;
12
+ similar e-mail id. Any user can sign up newsletter with their same e-mail id in all the stores.</description>
13
+ <notes>First Preview Release</notes>
14
+ <authors><author><name>NetGo</name><user>NetGo</user><email>netattingomails@gmail.com</email></author></authors>
15
+ <date>2015-07-29</date>
16
+ <time>00:02:20</time>
17
+ <contents><target name="magecommunity"><dir name="Netgo"><dir name="MulistoreNewsletter"><dir name="Helper"><file name="Data.php" hash="b3ef37ebbe79d7c2ca720d91b3d9ddcb"/></dir><dir name="Model"><dir name="Newsletter"><dir name="Mysql4"><file name="Subscriber.php" hash="4b1f6a77fe60de5cac7fd77d119da748"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="1a98db1f6c675edc01146ae1366e425d"/><file name="config.xml" hash="789efaeaed4275444fcef3b89a800364"/><file name="system.xml" hash="8b9061e920b03509a78741705ba215e9"/></dir></dir></dir></target><target name="mage"><dir name="."><file name="User_manual.pdf" hash="5c326e3afdf077740ab28728b488ecba"/></dir></target><target name="mageetc"><dir name="modules"><file name="Netgo_MulistoreNewsletter.xml" hash="5308875609666058d1b2b672b3abb7f5"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
20
+ </package>