Respondr_Ecommerce - Version 1.0.5

Version Notes

- Added Mage/Core/Helper/Cookie.php to the package to make it compatible with 1.5.

Download this release

Release Info

Developer Leroy Ware
Extension Respondr_Ecommerce
Version 1.0.5
Comparing to
See all releases


Code changes from version 1.0.4 to 1.0.5

app/code/core/Mage/Core/Helper/Cookie.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Core
23
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Core Cookie helper
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Core
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class Mage_Core_Helper_Cookie extends Mage_Core_Helper_Abstract
35
+ {
36
+ /**
37
+ * Cookie name for users who allowed cookie save
38
+ */
39
+ const IS_USER_ALLOWED_SAVE_COOKIE = 'user_allowed_save_cookie';
40
+
41
+ /**
42
+ * Path to configuration, check is enable cookie restriction mode
43
+ */
44
+ const XML_PATH_COOKIE_RESTRICTION = 'web/cookie/cookie_restriction';
45
+
46
+ /**
47
+ * Cookie restriction lifetime configuration path
48
+ */
49
+ const XML_PATH_COOKIE_RESTRICTION_LIFETIME = 'web/cookie/cookie_restriction_lifetime';
50
+
51
+ /**
52
+ * Cookie restriction notice cms block identifier
53
+ */
54
+ const COOKIE_RESTRICTION_NOTICE_CMS_BLOCK_IDENTIFIER = 'cookie_restriction_notice_block';
55
+
56
+ /**
57
+ * Store instance
58
+ *
59
+ * @var Mage_Core_Model_Store
60
+ */
61
+ protected $_currentStore;
62
+
63
+ /**
64
+ * Cookie instance
65
+ *
66
+ * @var Mage_Core_Model_Cookie
67
+ */
68
+ protected $_cookieModel;
69
+
70
+ /**
71
+ * Website instance
72
+ *
73
+ * @var Mage_Core_Model_Website
74
+ */
75
+ protected $_website;
76
+
77
+ /**
78
+ * Initializes store, cookie and website objects.
79
+ *
80
+ * @param array $data
81
+ * @throws InvalidArgumentException
82
+ */
83
+ public function __construct(array $data = array())
84
+ {
85
+ $this->_currentStore = isset($data['current_store']) ? $data['current_store'] : Mage::app()->getStore();
86
+
87
+ if (!$this->_currentStore instanceof Mage_Core_Model_Store) {
88
+ throw new InvalidArgumentException('Required store object is invalid');
89
+ }
90
+
91
+ $this->_cookieModel = isset($data['cookie_model'])
92
+ ? $data['cookie_model'] : Mage::getSingleton('core/cookie');
93
+
94
+ if (!$this->_cookieModel instanceof Mage_Core_Model_Cookie) {
95
+ throw new InvalidArgumentException('Required cookie object is invalid');
96
+ }
97
+
98
+ $this->_website = isset($data['website']) ? $data['website'] : Mage::app()->getWebsite();
99
+
100
+ if (!$this->_website instanceof Mage_Core_Model_Website) {
101
+ throw new InvalidArgumentException('Required website object is invalid');
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Check if cookie restriction notice should be displayed
107
+ *
108
+ * @return bool
109
+ */
110
+ public function isUserNotAllowSaveCookie()
111
+ {
112
+ $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites();
113
+ return $this->_currentStore->getConfig(self::XML_PATH_COOKIE_RESTRICTION) &&
114
+ empty($acceptedSaveCookiesWebsites[$this->_website->getId()]);
115
+ }
116
+
117
+ /**
118
+ * Return serialized list of accepted save cookie website
119
+ *
120
+ * @return string
121
+ */
122
+ public function getAcceptedSaveCookiesWebsiteIds()
123
+ {
124
+ $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites();
125
+ $acceptedSaveCookiesWebsites[$this->_website->getId()] = 1;
126
+ return json_encode($acceptedSaveCookiesWebsites);
127
+ }
128
+
129
+ /**
130
+ * Get accepted save cookies websites
131
+ *
132
+ * @return array
133
+ */
134
+ protected function _getAcceptedSaveCookiesWebsites()
135
+ {
136
+ $serializedList = $this->_cookieModel->get(self::IS_USER_ALLOWED_SAVE_COOKIE);
137
+ $unSerializedList = json_decode($serializedList, true);
138
+ return is_array($unSerializedList) ? $unSerializedList : array();
139
+ }
140
+
141
+ /**
142
+ * Get cookie restriction lifetime (in seconds)
143
+ *
144
+ * @return int
145
+ */
146
+ public function getCookieRestrictionLifetime()
147
+ {
148
+ return (int)$this->_currentStore->getConfig(self::XML_PATH_COOKIE_RESTRICTION_LIFETIME);
149
+ }
150
+
151
+ /**
152
+ * Get cookie restriction notice cms block identifier
153
+ *
154
+ * @return string
155
+ */
156
+ public function getCookieRestrictionNoticeCmsBlockIdentifier()
157
+ {
158
+ return self::COOKIE_RESTRICTION_NOTICE_CMS_BLOCK_IDENTIFIER;
159
+ }
160
+ }
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Respondr_Ecommerce</name>
4
- <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="@license http://www.gnu.org/licenses/gpl-3.0.html">GPL v3</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Advanced ecommerce marketing automation for Magento retailers.</summary>
10
  <description>Increase your online revenue with automated email, mobile, and social messaging driven by your web analytics. Respondr makes it easy to re-engage your customers and bring them back to your store. Creating and managing abandoned cart, product recommendation, and cross-sell email marketing has never been easier. You can also send coupons and promotions via SMS/MMS, Facebook and more!</description>
11
- <notes>- Improvement to the way we query for optin status</notes>
12
  <authors><author><name>Leroy Ware</name><user>LeroyWare</user><email>leroy@respondr.io</email></author><author><name>Adrian Speyer</name><user>AdrianSpeyer</user><email>adriansprojects@gmail.com</email></author></authors>
13
- <date>2014-09-03</date>
14
- <time>21:54:04</time>
15
- <contents><target name="magecommunity"><dir name="RespondrMage"><dir name="RespondrAnalytics"><dir name="Block"><file name="Respondr.php" hash="c4a454fc203dd779d46618132b431087"/></dir><dir name="Helper"><file name="Data.php" hash="9ddf39026d725f7ee03b577e7981b5c3"/></dir><dir name="Model"><file name="Observer.php" hash="7301ca92b1762223cf8228439fa8468e"/></dir><dir name="controllers"><file name="IndexController.php" hash="292571ac2e24956993fb681cdd1d99a2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b28f4ddc5e0851cff79bdc1624e1192c"/><file name="config.xml" hash="ba0e13559f0515126ea5b169e6fa6ab2"/><file name="system.xml" hash="3d57e604c7b9c2eb4b11b82229531869"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="respondranalytics.xml" hash="27dc170600cb1d71cdcb7bacb6455230"/></dir><dir name="template"><dir name="respondranalytics"><file name="respondr.phtml" hash="ed8662e33db2d7c4c5a9adae72a6b994"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RespondrMage_RespondrAnalytics.xml" hash="9dd32f4b236640c74d1f08f5cb8e344d"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="RespondrMage_RespondrAnalytics.csv" hash="788bc282a1e82ff83d93a70297435376"/></dir><dir name="en_US"><file name="RespondrMage_RespondrAnalytics.csv" hash="464c1c6e0ad748dadc01bf0a1e336287"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Respondr_Ecommerce</name>
4
+ <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license uri="@license http://www.gnu.org/licenses/gpl-3.0.html">GPL v3</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Advanced ecommerce marketing automation for Magento retailers.</summary>
10
  <description>Increase your online revenue with automated email, mobile, and social messaging driven by your web analytics. Respondr makes it easy to re-engage your customers and bring them back to your store. Creating and managing abandoned cart, product recommendation, and cross-sell email marketing has never been easier. You can also send coupons and promotions via SMS/MMS, Facebook and more!</description>
11
+ <notes>- Added Mage/Core/Helper/Cookie.php to the package to make it compatible with 1.5.</notes>
12
  <authors><author><name>Leroy Ware</name><user>LeroyWare</user><email>leroy@respondr.io</email></author><author><name>Adrian Speyer</name><user>AdrianSpeyer</user><email>adriansprojects@gmail.com</email></author></authors>
13
+ <date>2014-09-18</date>
14
+ <time>19:46:13</time>
15
+ <contents><target name="magecommunity"><dir name="RespondrMage"><dir name="RespondrAnalytics"><dir name="Block"><file name="Respondr.php" hash="c4a454fc203dd779d46618132b431087"/></dir><dir name="Helper"><file name="Data.php" hash="9ddf39026d725f7ee03b577e7981b5c3"/></dir><dir name="Model"><file name="Observer.php" hash="7301ca92b1762223cf8228439fa8468e"/></dir><dir name="controllers"><file name="IndexController.php" hash="292571ac2e24956993fb681cdd1d99a2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b28f4ddc5e0851cff79bdc1624e1192c"/><file name="config.xml" hash="ba0e13559f0515126ea5b169e6fa6ab2"/><file name="system.xml" hash="3d57e604c7b9c2eb4b11b82229531869"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="respondranalytics.xml" hash="27dc170600cb1d71cdcb7bacb6455230"/></dir><dir name="template"><dir name="respondranalytics"><file name="respondr.phtml" hash="ed8662e33db2d7c4c5a9adae72a6b994"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RespondrMage_RespondrAnalytics.xml" hash="9dd32f4b236640c74d1f08f5cb8e344d"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="RespondrMage_RespondrAnalytics.csv" hash="788bc282a1e82ff83d93a70297435376"/></dir><dir name="en_US"><file name="RespondrMage_RespondrAnalytics.csv" hash="464c1c6e0ad748dadc01bf0a1e336287"/></dir></target><target name="magecore"><dir name="Mage"><dir name="Core"><dir name="Helper"><file name="Cookie.php" hash="4ce382ed569a6a1de2c693bd8c164289"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>