Respondr_Ecommerce - Version 1.0.6

Version Notes

Minor bug fix

Download this release

Release Info

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


Code changes from version 1.0.5 to 1.0.6

app/code/community/RespondrMage/RespondrAnalytics/Block/Respondr.php DELETED
@@ -1,218 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Respondr Extension for Magento created by Respondr Inc.
5
- * Based on Piwik Extension for Magento by Adrian Speyer
6
- *
7
- * @category RespondrMage
8
- * @package RespondrMage_RespondrAnalytics
9
- * @copyright Copyright (c) 2014 Respondr Inc. (http://www.respondr.io)
10
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
11
- *
12
- */
13
-
14
- class RespondrMage_RespondrAnalytics_Block_Respondr extends Mage_Core_Block_Template
15
- {
16
-
17
- /**
18
- * Get a specific page name (may be customized via layout)
19
- *
20
- * @return string|null
21
- */
22
- public function getPageName()
23
- {
24
- return $this->_getData('page_name');
25
- }
26
-
27
- /**
28
- * Render information about specified orders and their items
29
- * http://piwik.org/docs/ecommerce-analytics/
30
- */
31
- protected function _getOrdersTrackingCode()
32
- {
33
- $orderIds = $this->getOrderIds();
34
- if (empty($orderIds) || !is_array($orderIds)) {
35
- return;
36
- }
37
-
38
- $collection = Mage::getResourceModel('sales/order_collection')
39
- ->addFieldToFilter('entity_id', array('in' => $orderIds));
40
- $result = array();
41
-
42
- foreach ($collection as $order) {
43
- foreach ($order->getAllVisibleItems() as $item) {
44
-
45
- //get category name
46
- $product_id = $item->product_id;
47
- $_product = Mage::getModel('catalog/product')->load($product_id);
48
- $cats = $_product->getCategoryIds();
49
- $category_id = $cats[0]; // just grab the first id
50
- $category = Mage::getModel('catalog/category')->load($category_id);
51
- $category_name = $category->getName();
52
-
53
-
54
- if ($item->getQtyOrdered()) {
55
- $qty = number_format($item->getQtyOrdered(), 0, '.', '');
56
- } else {
57
- $qty = '0';
58
- }
59
- $result[] = sprintf("respondrTracker.addEcommerceItem( '%s', '%s', '%s', %s, %s);",
60
- $this->jsQuoteEscape($item->getSku()),
61
- $this->jsQuoteEscape($item->getName()),
62
- $category_name,
63
- $item->getBasePrice(),
64
- $qty
65
- );
66
-
67
- }
68
- foreach ($collection as $order) {
69
- if ($order->getGrandTotal()) {
70
- $subtotal = $order->getGrandTotal() - $order->getShippingAmount() - $order->getShippingTaxAmount();
71
- } else {
72
- $subtotal = '0.00';
73
- }
74
- $result[] = sprintf("respondrTracker.trackEcommerceOrder( '%s', %s, %s, %s, %s);",
75
- $order->getIncrementId(),
76
- $order->getBaseGrandTotal(),
77
- $subtotal,
78
- $order->getBaseTaxAmount(),
79
- $order->getBaseShippingAmount()
80
- );
81
-
82
-
83
- }
84
- }
85
- return implode("\n", $result);
86
- }
87
-
88
- /**
89
- * Render information when cart updated
90
- * http://piwik.org/docs/ecommerce-analytics/
91
- */
92
- protected function _getEcommerceCartUpdate()
93
- {
94
-
95
- $cart = Mage::getModel('checkout/cart')->getQuote()->getAllVisibleItems();
96
-
97
- foreach ($cart as $cartitem) {
98
-
99
- //get category name
100
- $product_id = $cartitem->product_id;
101
- $_product = Mage::getModel('catalog/product')->load($product_id);
102
- $cats = $_product->getCategoryIds();
103
- if (isset($cats)) {
104
- $category_id = $cats[0];
105
- } // just grab the first id
106
- $category = Mage::getModel('catalog/category')->load($category_id);
107
- $category_name = $category->getName();
108
- $nameofproduct = $cartitem->getName();
109
- $nameofproduct = str_replace('"', "", $nameofproduct);
110
-
111
- if ($cartitem->getPrice() == 0 || $cartitem->getPrice() < 0.00001):
112
- continue;
113
- endif;
114
- echo 'respondrTracker.addEcommerceItem("' . $cartitem->getSku() . '","' . $nameofproduct . '","' . $category_name . '",' . $cartitem->getPrice() . ',' . $cartitem->getQty() . ');';
115
- echo "\n";
116
- }
117
-
118
- //total in cart
119
- $grandTotal = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();
120
- if ($grandTotal == 0) echo ''; else
121
- echo 'respondrTracker.trackEcommerceCartUpdate(' . $grandTotal . ');';
122
- echo "\n";
123
- }
124
-
125
- /**
126
- * Render information when product page view
127
- * http://piwik.org/docs/ecommerce-analytics/
128
- */
129
- protected function _getProductPageview()
130
- {
131
-
132
- $currentproduct = Mage::registry('current_product');
133
-
134
- if (!($currentproduct instanceof Mage_Catalog_Model_Product)) {
135
- return;
136
- }
137
-
138
-
139
- $product_id = $currentproduct->getId();
140
- $_product = Mage::getModel('catalog/product')->load($product_id);
141
- $cats = $_product->getCategoryIds();
142
- $category_id = $cats[0]; // just grab the first id
143
- //$category_id = if (isset($cats[0]) {$category_id = $cats[0]} else $category_id = null; potential fix when no catgeories
144
- $category = Mage::getModel('catalog/category')->load($category_id);
145
- $category_name = $category->getName();
146
- $product = $currentproduct->getName();
147
- //$product = str_replace('"', "", $product);
148
- //$description = str_replace('"', "", $_product->getDescription());
149
- $description = "";
150
-
151
- echo 'respondrTracker.setEcommerceView("' . $this->jsQuoteEscape($currentproduct->getSku()) . '", "' . $this->jsQuoteEscape($product) . '","' . $this->jsQuoteEscape($category_name) . '",' . $currentproduct->getPrice() . ',"'. $_product->getImageUrl() . '","'. $this->jsQuoteEscape($description) .'");';
152
- Mage::unregister('current_category');
153
- }
154
-
155
- /**
156
- * Render information of category view
157
- * http://piwik.org/docs/ecommerce-analytics/
158
- */
159
- protected function _getCategoryPageview()
160
- {
161
- $currentcategory = Mage::registry('current_category');
162
-
163
- if (!($currentcategory instanceof Mage_Catalog_Model_Category)) {
164
- return;
165
- }
166
- echo 'respondrTracker.setEcommerceView(false,false,"' . $currentcategory->getName() . '",false,false);';
167
- Mage::unregister('current_product');
168
- }
169
-
170
- /**
171
- * Respondr lead/customer capture...
172
- * Saves user's firstname, lastname, company, email, telephone
173
- * and optin status as json-encoded custom variable
174
- */
175
- protected function _getUser() {
176
-
177
- if (Mage::getSingleton('customer/session')->isLoggedIn()) {
178
- $customer = Mage::getSingleton('customer/session')->getCustomer();
179
- $customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
180
- $optin = Mage::helper('respondranalytics')->isCustomerSubscribed($customer->getData("email"));
181
- echo 'respondrTracker.setCustomVariable (1, "email", "'.$customer->getData("email").'", scope = "visit");';
182
- echo 'respondrTracker.setCustomVariable (2, "firstName", "'.$customer->getData("firstname").'", scope = "visit");';
183
- echo 'respondrTracker.setCustomVariable (3, "lastName", "'.$customer->getData("lastname").'", scope = "visit");';
184
- if ($customerAddressId){
185
- $address = Mage::getModel('customer/address')->load($customerAddressId);
186
- echo 'respondrTracker.setCustomVariable (4, "company", "'.$address->getData("company").'", scope = "visit");';
187
- echo 'respondrTracker.setCustomVariable (5, "phone", "'.$address->getData("telephone").'", scope = "visit");';
188
- }
189
- }
190
-
191
-
192
- }
193
-
194
- protected function _getOptinStatus() {
195
-
196
- if (Mage::getSingleton('customer/session')->isLoggedIn()) {
197
- $customer = Mage::getSingleton('customer/session')->getCustomer();
198
- $optin = Mage::helper('respondranalytics')->isCustomerSubscribed($customer->getData("email"));
199
- echo 'respondrTracker.setCustomVariable (10, "optin", "'.$optin.'", scope = "visit");';
200
- }
201
-
202
-
203
- }
204
-
205
- /**
206
- * Render Respondr tracking scripts
207
- *
208
- * @return string
209
- */
210
- protected function _toHtml()
211
- {
212
- if (!Mage::helper('respondranalytics')->isRespondrAnalyticsAvailable()) {
213
- return '';
214
- }
215
-
216
- return parent::_toHtml();
217
- }
218
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RespondrMage/RespondrAnalytics/Helper/Data.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Respondr Extension for Magento created by Respondr Inc.
5
- * Based on Piwik Extension for Magento by Adrian Speyer
6
- *
7
- * @category RespondrMage
8
- * @package RespondrMage_RespondrAnalytics
9
- * @copyright Copyright (c) 2014 Respondr Inc. (http://www.respondr.io)
10
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
11
- *
12
- */
13
- class RespondrMage_RespondrAnalytics_Helper_Data extends Mage_Core_Helper_Abstract
14
- {
15
- /**
16
- * Config paths for using throughout the code
17
- */
18
- const XML_PATH_ACTIVE = 'respondr/analytics/active';
19
- const XML_PATH_SITE = 'respondr/analytics/site';
20
- const XML_PATH_PWTOKEN = 'respondr/analytics/pwtoken';
21
-
22
- // hard-code Respondr URL
23
- const SERVER_URL = 'http://analytics.respondr.io';
24
-
25
-
26
- /**
27
- *
28
- * @param mixed $store
29
- * @return bool
30
- */
31
- public function isRespondrAnalyticsAvailable($store = null)
32
- {
33
- $siteId = Mage::getStoreConfig(self::XML_PATH_SITE, $store);
34
- return $siteId && Mage::getStoreConfigFlag(self::XML_PATH_ACTIVE, $store);
35
- }
36
-
37
- /**
38
- * Check the customer's newsletter optin status
39
- * @return string
40
- */
41
- public function isCustomerSubscribed($email) {
42
- $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
43
- if($subscriber->getId()) {
44
- return $subscriber->getData('subscriber_status') == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED;
45
- } else {
46
- return 0;
47
- }
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RespondrMage/RespondrAnalytics/Model/Observer.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Respondr Extension for Magento created by Respondr Inc.
5
- * Based on Piwik Extension for Magento by Adrian Speyer
6
- *
7
- * @category RespondrMage
8
- * @package RespondrMage_RespondrAnalytics
9
- * @copyright Copyright (c) 2014 Respondr Inc. (http://www.respondr.io)
10
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
11
- *
12
- */
13
-
14
- class RespondrMage_RespondrAnalytics_Model_Observer
15
- {
16
-
17
-
18
- /**
19
- * Add order information into Respondr block to render on checkout success pages
20
- *
21
- * @param Varien_Event_Observer $observer
22
- */
23
- public function setRespondrAnalyticsOnOrderSuccessPageView(Varien_Event_Observer $observer)
24
- {
25
- $orderIds = $observer->getEvent()->getOrderIds();
26
- if (empty($orderIds) || !is_array($orderIds)) {
27
- return;
28
- }
29
- $block = Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('respondr_analytics');
30
- if ($block) {
31
- $block->setOrderIds($orderIds);
32
- }
33
- }
34
-
35
-
36
-
37
- }
38
-
39
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RespondrMage/RespondrAnalytics/controllers/IndexController.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Respondr Extension for Magento created by Respondr Inc.
5
- * Based on Piwik Extension for Magento by Adrian Speyer
6
- *
7
- * @category RespondrMage
8
- * @package RespondrMage_RespondrAnalytics
9
- * @copyright Copyright (c) 2014 Respondr Inc. (http://www.respondr.io)
10
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
11
- *
12
- */
13
-
14
- class RespondrMage_RespondrAnalytics_IndexController extends Mage_Adminhtml_Controller_Action
15
- {
16
- public function indexAction()
17
- {
18
-
19
- $this->loadLayout();
20
-
21
- $active = Mage::getStoreConfig(RespondrMage_RespondrAnalytics_Helper_Data::XML_PATH_ACTIVE);
22
- $siteId = Mage::getStoreConfig(RespondrMage_RespondrAnalytics_Helper_Data::XML_PATH_SITE);
23
- $pwtoken= Mage::getStoreConfig(RespondrMage_RespondrAnalytics_Helper_Data::XML_PATH_PWTOKEN);
24
-
25
- $installPath = RespondrMage_RespondrAnalytics_Helper_Data::SERVER_URL;
26
- /*
27
- if (!empty($pwtoken)){
28
- $block = $this->getLayout()->createBlock('core/text', 'respondr-block')->setText('<iframe src="'.$installPath.'/index.php?module=Widgetize&action=iframe&moduleToWidgetize=Dashboard&actionToWidgetize=index&idSite='.$siteId.'&period=week&date=yesterday&token_auth='.$pwtoken.'" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="1000px"></iframe>');
29
- $this->_addContent($block);
30
- $this->_setActiveMenu('respondr_menu')->renderLayout();
31
- }
32
-
33
-
34
- if (empty($pwtoken)){
35
- $block = $this->getLayout()->createBlock('core/text', 'respondr-block')->setText('You are missing your Piwik Token Auth Key. Get it from your API tab in your Piwik Install.');
36
- $this->_addContent($block);
37
- $this->_setActiveMenu('respondr_menu')->renderLayout();
38
- }
39
-
40
- }
41
- */
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RespondrMage/RespondrAnalytics/etc/adminhtml.xml DELETED
@@ -1,78 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- *
5
- * Respondr Extension for Magento created by Adrian Speyer
6
- * Get Respondr at http://www.respondr.org - Open source web analytics
7
- *
8
- * @category Mage
9
- * @package Mage_RespoNdranalytics_etc_adminhtml
10
- * @copyright Copyright (c) 2012 Adrian Speyer. (http://www.adrianspeyer.com)
11
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
12
- *
13
- */
14
- -->
15
- <config>
16
- <menu>
17
- <report translate="title" module="reports">
18
- <title>Reports</title>
19
- <sort_order>80</sort_order>
20
- <children>
21
- <iframe_respondr translate="title" module="reports">
22
- <title>Respondr iFrame</title>
23
- <sort_order>99999</sort_order>
24
- <action>respondranalytics/index/index</action>
25
- <depends><config>respondr/analytics/active</config></depends>
26
- </iframe_respondr>
27
- </children>
28
- </report>
29
- </menu>
30
-
31
- <acl>
32
- <resources>
33
- <admin>
34
- <children>
35
- <system>
36
- <children>
37
- <config>
38
- <children>
39
- <respondr translate="title" module="respondranalytics">
40
- <title>Respondr Analytics</title>
41
- </respondr>
42
- </children>
43
- </config>
44
- </children>
45
- </system>
46
- </children>
47
- </admin>
48
- </resources>
49
- </acl>
50
- <acl>
51
- <resources>
52
- <admin>
53
- <children>
54
- <report translate="title" module="reports">
55
- <title>Reports</title>
56
- <sort_order>80</sort_order>
57
- <children>
58
- <iframe_respondr translate="title">
59
- <title>Respondr Iframe</title>
60
- </iframe_respondr>
61
- </children>
62
- </report>
63
- <system>
64
- <children>
65
- <config>
66
- <children>
67
- <reports translate="title" module="reports">
68
- <title>Reports</title>
69
- </reports>
70
- </children>
71
- </config>
72
- </children>
73
- </system>
74
- </children>
75
- </admin>
76
- </resources>
77
- </acl>
78
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RespondrMage/RespondrAnalytics/etc/config.xml DELETED
@@ -1,96 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- *
5
- * Piwik Extension for Magento created by Adrian Speyer
6
- * Get Piwik at http://www.piwik.org - Open source web analytics
7
- *
8
- * @category PiwikMage
9
- * @package RespondrMage_RespondrAnalytics
10
- * @copyright Copyright (c) 2012 Adrian Speyer. (http://www.adrianspeyer.com)
11
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
12
- *
13
- */
14
- -->
15
- <config>
16
- <modules>
17
- <RespondrMage_RespondrAnalytics>
18
- <version>1.0.0.0</version>
19
- </RespondrMage_RespondrAnalytics>
20
- </modules>
21
- <global>
22
- <models>
23
- <respondranalytics>
24
- <class>RespondrMage_RespondrAnalytics_Model</class>
25
- </respondranalytics>
26
- </models>
27
- <blocks>
28
- <respondranalytics>
29
- <class>RespondrMage_RespondrAnalytics_Block</class>
30
- </respondranalytics>
31
- </blocks>
32
- <helpers>
33
- <respondranalytics>
34
- <class>RespondrMage_RespondrAnalytics_Helper</class>
35
- </respondranalytics>
36
- </helpers>
37
- </global>
38
- <frontend>
39
- <translate>
40
- <modules>
41
- <RespondrMage_RespondrAnalytics>
42
- <files>
43
- <default>RespondrMage_RespondrAnalytics.csv</default>
44
- </files>
45
- </RespondrMage_RespondrAnalytics>
46
- </modules>
47
- </translate>
48
- <events>
49
- <checkout_onepage_controller_success_action>
50
- <observers>
51
- <respondranalytics_order_success>
52
- <class>respondranalytics/observer</class>
53
- <method>setRespondrAnalyticsOnOrderSuccessPageView</method>
54
- </respondranalytics_order_success>
55
- </observers>
56
- </checkout_onepage_controller_success_action>
57
- <checkout_multishipping_controller_success_action>
58
- <observers>
59
- <respondranalytics_order_success>
60
- <class>respondranalytics/observer</class>
61
- <method>setRespondrAnalyticsOnOrderSuccessPageView</method>
62
- </respondranalytics_order_success>
63
- </observers>
64
- </checkout_multishipping_controller_success_action>
65
- </events>
66
- <layout>
67
- <updates>
68
- <respondranalytics>
69
- <file>respondranalytics.xml</file>
70
- </respondranalytics>
71
- </updates>
72
- </layout>
73
- </frontend>
74
- <adminhtml>
75
- <translate>
76
- <modules>
77
- <RespondrMage_RespondrAnalytics>
78
- <files>
79
- <default>RespondrMage_RespondrAnalytics.csv</default>
80
- </files>
81
- </RespondrMage_RespondrAnalytics>
82
- </modules>
83
- </translate>
84
- </adminhtml>
85
- <admin>
86
- <routers>
87
- <RespondrMage_RespondrAnalytics>
88
- <use>admin</use>
89
- <args>
90
- <module>RespondrMage_RespondrAnalytics</module>
91
- <frontName>respondranalytics</frontName>
92
- </args>
93
- </RespondrMage_RespondrAnalytics>
94
- </routers>
95
- </admin>
96
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/RespondrMage/RespondrAnalytics/etc/system.xml DELETED
@@ -1,59 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- *
5
- * Respondr Extension for Magento created by Adrian Speyer
6
- * Get Respondr at http://www.respondr.org - Open source web analytics
7
- *
8
- * @category RespondrMage
9
- * @package RespondrMage_RespondrAnalytics
10
- * @copyright Copyright (c) 2012 Adrian Speyer. (http://www.adrianspeyer.com)
11
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
12
- *
13
- */
14
- -->
15
- <config>
16
- <sections>
17
- <respondr translate="label" module="respondranalytics">
18
- <label>Respondr</label>
19
- <tab>sales</tab>
20
- <frontend_type>text</frontend_type>
21
- <sort_order>350</sort_order>
22
- <show_in_default>1</show_in_default>
23
- <show_in_website>1</show_in_website>
24
- <show_in_store>1</show_in_store>
25
- <groups>
26
- <analytics translate="label">
27
- <label>Settings</label>
28
- <frontend_type>text</frontend_type>
29
- <comment>Don't have a Respondr account? Create one at <![CDATA[<a href="http://respondr.io/" target="_blank">www.respondr.io</a>]]></comment>
30
- <sort_order>10</sort_order>
31
- <show_in_default>1</show_in_default>
32
- <show_in_website>1</show_in_website>
33
- <show_in_store>1</show_in_store>
34
- <fields>
35
- <active translate="label">
36
- <label>Enable</label>
37
- <frontend_type>select</frontend_type>
38
- <source_model>adminhtml/system_config_source_yesno</source_model>
39
- <sort_order>10</sort_order>
40
- <show_in_default>1</show_in_default>
41
- <show_in_website>1</show_in_website>
42
- <show_in_store>1</show_in_store>
43
- </active>
44
-
45
- <site translate="label">
46
- <label>Site Id</label>
47
- <frontend_type>text</frontend_type>
48
- <sort_order>30</sort_order>
49
- <show_in_default>1</show_in_default>
50
- <show_in_website>1</show_in_website>
51
- <show_in_store>1</show_in_store>
52
- </site>
53
-
54
- </fields>
55
- </analytics>
56
- </groups>
57
- </respondr>
58
- </sections>
59
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/core/Mage/Core/Helper/Cookie.php DELETED
@@ -1,160 +0,0 @@
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
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/respondranalytics.xml DELETED
@@ -1,24 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- *
4
- * Respondr Extension for Magento created by Respondr Inc.
5
- * Based on Piwik Extension for Magento by Adrian Speyer
6
- *
7
- * @category RespondrMage
8
- * @package RespondrMage_RespondrAnalytics
9
- * @copyright Copyright (c) 2014 Respondr Inc. (http://www.respondr.io)
10
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
11
- *
12
- -->
13
- <layout version="0.1.0">
14
-
15
- <!--
16
- Default layout, loads most of the pages
17
- -->
18
-
19
- <default>
20
- <reference name="before_body_end">
21
- <block type="respondranalytics/respondr" name="respondr_analytics" as="respondr_analytics" template="respondranalytics/respondr.phtml" />
22
- </reference>
23
- </default>
24
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/respondranalytics/respondr.phtml DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- * Respondr Extension for Magento created by Respondr Inc.
5
- * Based on Piwik Extension for Magento by Adrian Speyer
6
- *
7
- * @category RespondrMage
8
- * @package RespondrMage_RespondrAnalytics
9
- * @copyright Copyright (c) 2014 Respondr Inc. (http://www.respondr.io)
10
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
11
- *
12
- */
13
- ?>
14
- <?php if (!Mage::helper('core/cookie')->isUserNotAllowSaveCookie()): ?>
15
- <?php $siteId = Mage::getStoreConfig(RespondrMage_RespondrAnalytics_Helper_Data::XML_PATH_SITE) ?>
16
- <?php $installPath = RespondrMage_RespondrAnalytics_Helper_Data::SERVER_URL ?>
17
-
18
- <?php
19
-
20
- if ($siteId) {
21
- if (strpos($installPath, "https://") !== false) {
22
- $secureinstallPath = $installPath;
23
- $installPath = str_replace("https://", "http://", $installPath);
24
- }
25
- if (strpos($installPath, "http://") === false)
26
- $installPath = "http://" . $installPath;
27
-
28
- $secureinstallPath = str_replace("http://", "https://", $installPath);
29
-
30
- $last = $installPath[strlen($installPath)-1];
31
-
32
- if ($last != "/") {
33
- $installPath .= "/";
34
- $secureinstallPath .= "/";
35
- }
36
- ?>
37
-
38
- <?php
39
- //0 Search Results
40
- if($this->getRequest()->getControllerName()=='result')
41
- {
42
- $nores = Mage::helper('catalogsearch')->getEngine()->getResultCollection()->addSearchFilter(Mage::helper('catalogsearch')->getQuery()->getQueryText())->getSize();
43
- }?>
44
-
45
-
46
-
47
- <!-- RESPONDR TRACKING CODE -->
48
- <script type="text/javascript">
49
- //<![CDATA[
50
-
51
- var rBaseURL = (("https:" == document.location.protocol) ? "<?php echo $secureinstallPath ?>" : "<?php echo $installPath ?>");
52
- document.write(unescape("%3Cscript src='" + rBaseURL + "respondr.js' type='text/javascript'%3E%3C/script%3E"));
53
- </script><script type="text/javascript">
54
- try {
55
- var respondrTracker = Piwik.getTracker(rBaseURL + "respondr.php", <?php echo $siteId ?>);
56
- <?php echo $this->_getEcommerceCartUpdate()?>
57
- <?php echo $this->_getOrdersTrackingCode()?>
58
- <?php echo $this->_getProductPageview()?>
59
- <?php echo $this->_getCategoryPageview()?>
60
- <?php echo $this->_getUser()?> // added by Respondr
61
- <?php echo $this->_getOptinStatus()?> // added by Respondr
62
- <?php if (isset($nores))
63
- {?>
64
- var searchCount = <? echo $nores?>;
65
- respondrTracker.setCustomUrl(document.URL + '&search_count=' + searchCount);
66
- <?php }?>
67
-
68
- <?php
69
- //404 tracking
70
- $action = Mage::app()->getRequest()->getActionName();
71
- if($action == 'noRoute'){?>
72
- respondrTracker.setDocumentTitle('404/URL = '+String(document.location.pathname+document.location.search).replace(/\//g,"%2f") + '/From = ' + String(document.referrer).replace(/\//g,"%2f"));
73
- <?php }?>
74
-
75
- <?php echo "\n";?>
76
- respondrTracker.trackPageView();
77
- respondrTracker.enableLinkTracking();
78
- } catch( err ) {}
79
- //]]>
80
- </script>
81
- <noscript><p><img src="<?php echo $installPath ?>respondr.php?idsite=<?php echo $siteId ?>" style="border:0" alt="" /></p></noscript>
82
- <!-- END RESPONDR TRACKING CODE -->
83
-
84
- <?php } ?>
85
- <?php endif; ?>
86
-
87
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/RespondrMage_RespondrAnalytics.xml DELETED
@@ -1,26 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- *
5
- * Respondr Extension for Magento created by Respondr Inc.
6
- * Based on Piwik Extension for Magento by Adrian Speyer
7
- *
8
- * @category RespondrMage
9
- * @package RespondrMage_RespondrAnalytics
10
- * @copyright Copyright (c) 2014 Respondr Inc. (http://www.respondr.io)
11
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
12
- *
13
- */
14
- -->
15
-
16
- <config>
17
- <modules>
18
- <RespondrMage_RespondrAnalytics>
19
- <active>true</active>
20
- <codePool>community</codePool>
21
- <depends>
22
- <Mage_Core/>
23
- </depends>
24
- </RespondrMage_RespondrAnalytics>
25
- </modules>
26
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/locale/de_DE/RespondrMage_RespondrAnalytics.csv DELETED
@@ -1,5 +0,0 @@
1
- "Site Id","Seiten-ID"
2
- "Install Path","Installationspfad"
3
- "Enable","Aktivieren"
4
- "Respondr Analytics Control","Respondr Analytics Control"
5
- "Respondr Analytics","Respondr Analytics"
 
 
 
 
 
app/locale/en_US/RespondrMage_RespondrAnalytics.csv DELETED
@@ -1,5 +0,0 @@
1
- "Site Id","Site Id"
2
- "Install Path","Install Path"
3
- "Enable","Enable"
4
- "Respondr Analytics Control","Respondr Analytics Control"
5
- "Respondr Analytics","Respondr Analytics"
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,18 @@
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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Respondr_Ecommerce</name>
4
+ <version>1.0.6</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>Minor bug fix</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-24</date>
14
+ <time>17:47:55</time>
15
+ <contents><target name="magecommunity"><dir name="RespondrMage"><dir name="RespondrAnalytics"><dir name="Block"><file name="Respondr.php" hash=""/></dir><dir name="Helper"><file name="Data.php" hash=""/></dir><dir name="Model"><file name="Observer.php" hash=""/></dir><dir name="controllers"><file name="IndexController.php" hash=""/></dir><dir name="etc"><file name="adminhtml.xml" hash=""/><file name="config.xml" hash=""/><file name="system.xml" hash=""/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="respondranalytics.xml" hash=""/></dir><dir name="template"><dir name="respondranalytics"><file name="respondr.phtml" hash=""/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RespondrMage_RespondrAnalytics.xml" hash=""/></dir></target><target name="magelocale"><dir name="de_DE"><file name="RespondrMage_RespondrAnalytics.csv" hash=""/></dir><dir name="en_US"><file name="RespondrMage_RespondrAnalytics.csv" hash=""/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>