Woopra_Analytics_Event_And_Visitor_Tracking - Version 1.6.0

Version Notes

Undefined constant and variable fixes.

Download this release

Release Info

Developer Woopra
Extension Woopra_Analytics_Event_And_Visitor_Tracking
Version 1.6.0
Comparing to
See all releases


Code changes from version 1.5.0 to 1.6.0

app/code/community/Woopra/Analytics/Block/Script.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package Woopra_Analytics
6
  * @author K3Live for Woopra
7
- * @copyright Copyright (c) 2013 Woopra (http://www.woopra.com/)
8
  * @license Open Software License (OSL 3.0)
9
  */
10
 
@@ -21,9 +21,7 @@ class Woopra_Analytics_Block_Script extends Mage_Core_Block_Template
21
  {
22
  parent::_construct();
23
 
24
- // Decide whether the Woopra Module has been activated
25
- //$website_id = Mage::helper('woopra')->getApiKey();
26
- if(Mage::helper('woopra')->getEnabled() == true) {
27
  $this->setTemplate('woopra/script.phtml');
28
  }
29
  }
@@ -38,11 +36,9 @@ class Woopra_Analytics_Block_Script extends Mage_Core_Block_Template
38
  public function getSetting($key = null)
39
  {
40
  static $data;
41
- if(empty($data)) {
42
  $data = array(
43
  'enabled' => Mage::helper('woopra')->getEnabled(),
44
- 'app_id' => Mage::helper('woopra')->getAppId(),
45
- 'secret_key' => Mage::helper('woopra')->getSecretKey(),
46
  'test' => Mage::helper('woopra')->getTest(),
47
  'visitor_timeout' => Mage::helper('woopra')->getVistorTimeout(),
48
  'track_url_parameters' => Mage::helper('woopra')->getTrackUrlParameters(),
@@ -59,253 +55,283 @@ class Woopra_Analytics_Block_Script extends Mage_Core_Block_Template
59
  'outgoing_tracking' => Mage::helper('woopra')->getOutgoingTracking(),
60
  'outgoing_tracking_pause' => Mage::helper('woopra')->getOutgoingTrackingPause(),
61
  'outgoing_ignore_subdomain' => Mage::helper('woopra')->getOutgoingIgnoreSubdomain(),
62
- 'hide_campaign' => Mage::helper('woopra')->getHideCampaign(),
63
- 'url' => $_SERVER['HTTP_HOST']
64
  );
65
 
66
- // Add customer records
67
  $customer = Mage::getSingleton('customer/session')->getCustomer();
68
- if(!empty($customer)) {
69
- //Customer Name
70
  if ($customer->getName() != ' ' && Mage::helper('woopra')->getCustomerName() != NULL) {
71
  $data['customer_name'] = Mage::helper('core')->escapeHtml(addslashes($customer->getName()));
72
  }
73
- //Customer Email
74
  if (Mage::helper('woopra')->getCustomerEmail() != NULL) {
75
  $data['customer_email'] = $customer->getEmail();
76
  }
77
 
78
- //Customer Address Array
79
  $address = $customer->getDefaultBillingAddress();
80
- if(!empty($address)) {
81
  $address = $customer->getDefaultShippingAddress();
82
  }
83
- if(!empty($address)) {
84
- //Customer Company
85
  if (Mage::helper('woopra')->getCustomerCompany() != NULL) {
86
- $data['customer_company'] = Mage::helper('core')->escapeHtml(addslashes($address->getCompany()));
 
87
  }
88
- //Customer Location
89
  if (Mage::helper('woopra')->getCustomerLocation() != NULL) {
90
- $data['customer_location'] = Mage::helper('core')->escapeHtml(addslashes($address->getCity())) . ', ' . Mage::helper('core')->escapeHtml(addslashes($address->getRegion())) . ' (' . $address->getCountryId() . ')';
 
 
 
91
  }
92
- //Customer Phone
93
  if (Mage::helper('woopra')->getCustomerPhone() != NULL) {
94
- $data['customer_phone'] = Mage::helper('core')->escapeHtml(addslashes($address->getTelephone()));
 
95
  }
96
  }
97
 
98
- //Customer Group
99
  if (Mage::helper('woopra')->getCustomerGroup() != NULL) {
100
  $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
101
  $group = Mage::getModel('customer/group')->load($groupId);
102
  $data['customer_group'] = addslashes($group->getCode());
103
  }
104
 
105
- //Customer Account Creation Date
106
  if (Mage::helper('woopra')->getCustomerCreateDate() != NULL) {
107
  $date = Mage::app()->getLocale()->storeDate(
108
  $customer->getStoreId(),
109
  $customer->getCreatedAtTimestamp(),
110
  true
111
  );
112
- if(strtotime($date) != Mage::app()->getLocale()->storeTimeStamp()) {
113
- $data['customer_create_date'] = addslashes(Mage::helper('core')->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, true));
 
114
  }
115
  }
116
 
117
- //Customer Lifetime Array
118
  $customerTotals = Mage::getResourceModel('sales/sale_collection')
119
  ->setOrderStateFilter(Mage_Sales_Model_Order::STATE_CANCELED, true)
120
  ->setCustomerFilter($customer)
121
  ->load()
122
  ->getTotals();
123
- //Customer Lifetime Sales Count
124
  if (Mage::helper('woopra')->getCustomerLifetimeSales() != NULL && $group != 'NOT LOGGED IN') {
125
  $data['customer_lifetime_sales'] = round($customerTotals->getLifetime(), 2);
126
  }
127
- //Customer Lifetime Orders
128
  if (Mage::helper('woopra')->getCustomerNumberOrders() != NULL && $group != 'NOT LOGGED IN') {
129
  $data['customer_number_orders'] = $customerTotals->getNumOrders();
130
  }
131
 
132
- //Customer Wishlist Array
133
  $wishList = Mage::getSingleton('wishlist/wishlist')->loadByCustomer($customer);
134
- $wishListItemCollection = $wishList->getItemCollection();
135
  $wishlistItems = 0;
136
  $wishListTotal = 0;
137
- foreach ($wishListItemCollection as $item) {
138
  $product = $item->getProduct();
139
  $wishlistItems = $wishlistItems + 1;
140
  $wishListTotal = $wishListTotal + $product->getPrice();
141
  }
142
- //Wishlist Items Count
143
  if (Mage::helper('woopra')->getCustomerWishlistItems() != NULL) {
144
  $data['customer_wishlist_items'] = $wishlistItems;
145
  }
146
- //Wishlist Total
147
  if (Mage::helper('woopra')->getCustomerWishlistTotal() != NULL) {
148
  $data['customer_wishlist_total'] = $wishListTotal;
149
  }
150
  }
151
 
152
- //Cart Items Count
153
  if (Mage::helper('woopra')->getCustomerCartItems() != NULL) {
154
  $data['customer_cart_items'] = Mage::helper('checkout/cart')->getCart()->getItemsCount();
155
  }
156
- //Cart Total
157
  if (Mage::helper('woopra')->getCustomerCartTotal() != NULL) {
158
- $data['customer_cart_total'] = round(Mage::getSingleton('checkout/session')->getQuote()->getBaseSubtotal(), 2);
 
159
  }
160
- //Current Catagory
161
  $currentCategory = Mage::registry('current_category');
162
- if(!empty($currentCategory)) {
163
  $data['category'] = addslashes($currentCategory->getName());
164
  }
165
- //Current Product
166
  $currentProduct = Mage::registry('current_product');
167
- if(!empty($currentProduct)) {
168
  $data['product_sku'] = $currentProduct->getSku();
169
  $data['product_price'] = strip_tags(Mage::app()->getStore()->formatPrice($currentProduct->getPrice()));
170
  }
171
 
172
- //Newsletter changes
173
  if (Mage::helper('woopra')->getNewsletterSubscribed() != NULL) {
174
- $data['woopra_subscriber_changed'] = Mage::getSingleton('core/session')->getData('woopra_subscriber_changed', true);
175
- $data['woopra_subscriber_status'] = Mage::getSingleton('core/session')->getData('woopra_subscriber_status', true);
176
- $data['woopra_subscriber_email'] = Mage::getSingleton('core/session')->getData('woopra_subscriber_email', true);
177
- //Mage::log($data['woopra_subscriber_changed'] ." | ". $data['woopra_subscriber_status'] ." | ". $data['woopra_subscriber_email'], null, 'woopra.log');
 
 
178
  }
179
 
180
- //Contacts Form
181
  if (Mage::helper('woopra')->getContactFormSent() != NULL) {
182
- $data['woopra_contacts_index_post'] = Mage::getSingleton('core/session')->getData('woopra_contacts_index_post', true);
183
- $data['woopra_contacts_name'] = Mage::getSingleton('core/session')->getData('woopra_contacts_name', true);
184
- $data['woopra_contacts_email'] = Mage::getSingleton('core/session')->getData('woopra_contacts_email', true);
185
- $data['woopra_contacts_telephone'] = Mage::getSingleton('core/session')->getData('woopra_contacts_telephone', true);
186
- $data['woopra_contacts_comment'] = Mage::getSingleton('core/session')->getData('woopra_contacts_comment', true);
 
 
 
 
 
187
  }
188
 
189
- //Cart/Wishlist/Compare Add/Remove
190
- $data['woopra_cart_wishlist_trigger'] = Mage::getSingleton('core/session')->getData('woopra_cart_wishlist_trigger', true);
191
- $data['woopra_cart_wishlist_status'] = Mage::getSingleton('core/session')->getData('woopra_cart_wishlist_status', true);
192
- $data['woopra_cart_wishlist_name'] = Mage::getSingleton('core/session')->getData('woopra_cart_wishlist_name', true);
193
- $data['woopra_cart_wishlist_sku'] = Mage::getSingleton('core/session')->getData('woopra_cart_wishlist_sku', true);
194
- $data['woopra_cart_wishlist_price'] = Mage::getSingleton('core/session')->getData('woopra_cart_wishlist_price', true);
 
 
 
 
195
 
196
- //Site Search
197
  if (Mage::helper('woopra')->getCatalogSearch() != NULL) {
198
  $data['woopra_search_name'] = Mage::helper('woopra')->getCatalogSearch();
199
- $data['woopra_search_trigger'] = Mage::getSingleton('core/session')->getData('woopra_search_trigger', true);
200
- $data['woopra_search_keywords'] = Mage::getSingleton('core/session')->getData('woopra_search_keywords', true);
 
 
201
  }
202
 
203
- //Create Account
204
  if (Mage::helper('woopra')->getCustomerCreateAccount() != NULL) {
205
- $data['woopra_create_account_trigger'] = Mage::getSingleton('core/session')->getData('woopra_create_account_trigger', true);
 
206
  }
207
 
208
- //Create Account Success
209
  if (Mage::helper('woopra')->getCustomerCreateAccountSuccess() != NULL) {
210
- $data['woopra_create_account_success_trigger'] = Mage::getSingleton('core/session')->getData('woopra_create_account_success_trigger', true);
 
211
  }
212
 
213
- //Checkout Trigger
214
  if (Mage::helper('woopra')->getCheckoutBillingAddress() != NULL) {
215
- $data['woopra_checkout_trigger'] = Mage::getSingleton('core/session')->getData('woopra_checkout_trigger', true);
 
216
  }
217
 
218
- //Checkout Success
219
  if (Mage::helper('woopra')->getCheckoutSuccess() != NULL) {
220
- $data['woopra_checkout_payment_method'] = Mage::getSingleton('core/session')->getData('woopra_checkout_payment_method', true);
221
- $data['woopra_checkout_payment_cc_type'] = Mage::getSingleton('core/session')->getData('woopra_checkout_payment_cc_type', true);
222
- $data['woopra_checkout_success_trigger'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_trigger', true);
223
- $data['woopra_checkout_success_coupon_code'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_coupon_code', true);
224
- $data['woopra_checkout_success_discount_amount'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_discount_amount', true);
225
- $data['woopra_checkout_success_order_id'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_order_id', true);
226
- $data['woopra_checkout_success_order_subtotal'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_order_subtotal', true);
227
- $data['woopra_checkout_success_order_total'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_order_total', true);
228
- $data['woopra_checkout_success_order_weight'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_order_weight', true);
229
- $data['woopra_checkout_success_shipping_amount'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_shipping_amount', true);
230
- $data['woopra_checkout_success_shipping_description'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_shipping_description', true);
231
- $data['woopra_checkout_success_total_items_ordered'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_total_items_ordered', true);
232
- $data['woopra_checkout_success_profit'] = Mage::getSingleton('core/session')->getData('woopra_checkout_success_profit', true);
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  }
234
 
235
- //CMS No Route
236
  if (Mage::helper('woopra')->getCmsNoRoute() != NULL) {
237
- $data['woopra_cms_noroute_trigger'] = Mage::getSingleton('core/session')->getData('woopra_cms_noroute_trigger', true);
238
- $data['woopra_cms_noroute_path'] = Mage::getSingleton('core/session')->getData('woopra_cms_noroute_path', true);
 
 
239
  $data['woopra_cms_noroute_url'] = Mage::helper('core/url')->getCurrentUrl();
240
  }
241
 
242
- //Coupon Code
243
  if (Mage::helper('woopra')->getCouponCodeAdded() != NULL) {
244
- $data['woopra_coupon_code_trigger'] = Mage::getSingleton('core/session')->getData('woopra_coupon_code_trigger', true);
245
- $data['woopra_coupon_code_status'] = Mage::getSingleton('core/session')->getData('woopra_coupon_code_status', true);
 
 
246
  $data['woopra_coupon_code'] = Mage::getSingleton('core/session')->getData('woopra_coupon_code', true);
247
- $data['woopra_coupon_code_validity'] = Mage::getSingleton('core/session')->getData('woopra_coupon_code_validity', true);
248
- $data['woopra_coupon_code_active'] = Mage::getSingleton('core/session')->getData('woopra_coupon_code_active', true);
249
- $data['woopra_coupon_code_name'] = Mage::getSingleton('core/session')->getData('woopra_coupon_code_name', true);
 
 
 
250
  }
251
 
252
- //Login / Logout Trigger
253
  if (Mage::helper('woopra')->getCustomerLogin() != NULL) {
254
- $data['woopra_login_logout_trigger'] = Mage::getSingleton('core/session')->getData('woopra_login_logout_trigger', true);
255
- $data['woopra_login_logout_status'] = Mage::getSingleton('core/session')->getData('woopra_login_logout_status', true);
 
 
256
  }
257
 
258
- //Forgot Password
259
  if (Mage::helper('woopra')->getForgotPassword() != NULL) {
260
- $data['woopra_forgot_password_trigger'] = Mage::getSingleton('core/session')->getData('woopra_forgot_password_trigger', true);
261
- $data['woopra_forgot_password_email'] = Mage::getSingleton('core/session')->getData('woopra_forgot_password_email', true);
 
 
262
  }
263
 
264
- //Changed Password
265
  if (Mage::helper('woopra')->getChangedPassword() != NULL) {
266
- $data['woopra_password_changed_trigger'] = Mage::getSingleton('core/session')->getData('woopra_password_changed_trigger', true);
 
267
  }
268
 
269
- //Product Tag Added
270
  if (Mage::helper('woopra')->getProductTagAdded() != NULL) {
271
- $data['woopra_product_tag_added_trigger'] = Mage::getSingleton('core/session')->getData('woopra_product_tag_added_trigger', true);
272
- $data['woopra_product_tag_name'] = Mage::getSingleton('core/session')->getData('woopra_product_tag_name', true);
 
 
273
  }
274
 
275
- //Poll Vote
276
  if (Mage::helper('woopra')->getPollVote() != NULL) {
277
- $data['woopra_poll_vote_trigger'] = Mage::getSingleton('core/session')->getData('woopra_poll_vote_trigger', true);
278
- $data['woopra_poll_vote_title'] = Mage::getSingleton('core/session')->getData('woopra_poll_vote_title', true);
279
- $data['woopra_poll_vote_answer'] = Mage::getSingleton('core/session')->getData('woopra_poll_vote_answer', true);
 
 
 
280
  }
281
 
282
- //Product Review Posted
283
- if (Mage::helper('woopra')->getProductReviewRead() != NULL && Mage::getSingleton('core/session')->getData('woopra_product_review_trigger') == 1) {
284
  $data['woopra_cart_wishlist_status'] = 'product_review_posted';
285
- $data['woopra_product_review_trigger'] = Mage::getSingleton('core/session')->getData('woopra_product_review_trigger', true);
286
- $data['woopra_product_review_nickname'] = Mage::getSingleton('core/session')->getData('woopra_product_review_nickname', true);
287
- $data['woopra_product_review_title'] = Mage::getSingleton('core/session')->getData('woopra_product_review_title', true);
288
- $data['woopra_product_review_detail'] = Mage::getSingleton('core/session')->getData('woopra_product_review_detail', true);
 
 
 
 
289
  }
290
 
291
- //Estimate Post
292
- if (Mage::helper('woopra')->getEstimatePost() != NULL && Mage::getSingleton('core/session')->getData('woopra_estimate_post_trigger') == 1) {
293
- $data['woopra_estimate_post_trigger'] = Mage::getSingleton('core/session')->getData('woopra_estimate_post_trigger', true);
294
- $data['woopra_estimate_post_country'] = Mage::getSingleton('core/session')->getData('woopra_estimate_post_country', true);
295
- $data['woopra_estimate_post_state'] = Mage::getSingleton('core/session')->getData('woopra_estimate_post_state', true);
296
- $data['woopra_estimate_post_zip'] = Mage::getSingleton('core/session')->getData('woopra_estimate_post_zip', true);
 
 
 
 
297
  }
298
 
299
- //Product Email to Friend
300
  if (Mage::helper('woopra')->getProductEmailToFriend() != NULL) {
301
- $data['woopra_sendfriend_product_trigger'] = Mage::getSingleton('core/session')->getData('woopra_sendfriend_product_trigger', true);
302
- $data['woopra_sendfriend_product_name'] = Mage::getSingleton('core/session')->getData('woopra_sendfriend_product_name', true);
303
- $data['woopra_sendfriend_product_sku'] = Mage::getSingleton('core/session')->getData('woopra_sendfriend_product_sku', true);
304
- $data['woopra_sendfriend_product_price'] = Mage::getSingleton('core/session')->getData('woopra_sendfriend_product_price', true);
 
 
 
 
305
  }
306
  }
307
 
308
- if(isset($data[$key])) {
309
  return $data[$key];
310
  } else {
311
  return null;
4
  *
5
  * @package Woopra_Analytics
6
  * @author K3Live for Woopra
7
+ * @copyright Copyright (c) 2015 Woopra (http://www.woopra.com/)
8
  * @license Open Software License (OSL 3.0)
9
  */
10
 
21
  {
22
  parent::_construct();
23
 
24
+ if (Mage::helper('woopra')->getEnabled() == true) {
 
 
25
  $this->setTemplate('woopra/script.phtml');
26
  }
27
  }
36
  public function getSetting($key = null)
37
  {
38
  static $data;
39
+ if (empty($data)) {
40
  $data = array(
41
  'enabled' => Mage::helper('woopra')->getEnabled(),
 
 
42
  'test' => Mage::helper('woopra')->getTest(),
43
  'visitor_timeout' => Mage::helper('woopra')->getVistorTimeout(),
44
  'track_url_parameters' => Mage::helper('woopra')->getTrackUrlParameters(),
55
  'outgoing_tracking' => Mage::helper('woopra')->getOutgoingTracking(),
56
  'outgoing_tracking_pause' => Mage::helper('woopra')->getOutgoingTrackingPause(),
57
  'outgoing_ignore_subdomain' => Mage::helper('woopra')->getOutgoingIgnoreSubdomain(),
58
+ 'hide_campaign' => Mage::helper('woopra')->getHideCampaign()
 
59
  );
60
 
 
61
  $customer = Mage::getSingleton('customer/session')->getCustomer();
62
+ if (!empty($customer)) {
 
63
  if ($customer->getName() != ' ' && Mage::helper('woopra')->getCustomerName() != NULL) {
64
  $data['customer_name'] = Mage::helper('core')->escapeHtml(addslashes($customer->getName()));
65
  }
 
66
  if (Mage::helper('woopra')->getCustomerEmail() != NULL) {
67
  $data['customer_email'] = $customer->getEmail();
68
  }
69
 
 
70
  $address = $customer->getDefaultBillingAddress();
71
+ if (!empty($address)) {
72
  $address = $customer->getDefaultShippingAddress();
73
  }
74
+ if (!empty($address)) {
 
75
  if (Mage::helper('woopra')->getCustomerCompany() != NULL) {
76
+ $data['customer_company'] = Mage::helper('core')
77
+ ->escapeHtml(addslashes($address->getCompany()));
78
  }
 
79
  if (Mage::helper('woopra')->getCustomerLocation() != NULL) {
80
+ $data['customer_location'] = Mage::helper('core')
81
+ ->escapeHtml(addslashes($address->getCity())) . ', ' .
82
+ Mage::helper('core')
83
+ ->escapeHtml(addslashes($address->getRegion())) . ' (' . $address->getCountryId() . ')';
84
  }
 
85
  if (Mage::helper('woopra')->getCustomerPhone() != NULL) {
86
+ $data['customer_phone'] = Mage::helper('core')
87
+ ->escapeHtml(addslashes($address->getTelephone()));
88
  }
89
  }
90
 
 
91
  if (Mage::helper('woopra')->getCustomerGroup() != NULL) {
92
  $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
93
  $group = Mage::getModel('customer/group')->load($groupId);
94
  $data['customer_group'] = addslashes($group->getCode());
95
  }
96
 
 
97
  if (Mage::helper('woopra')->getCustomerCreateDate() != NULL) {
98
  $date = Mage::app()->getLocale()->storeDate(
99
  $customer->getStoreId(),
100
  $customer->getCreatedAtTimestamp(),
101
  true
102
  );
103
+ if (strtotime($date) != Mage::app()->getLocale()->storeTimeStamp()) {
104
+ $data['customer_create_date'] = addslashes(Mage::helper('core')->formatDate($date,
105
+ Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, true));
106
  }
107
  }
108
 
 
109
  $customerTotals = Mage::getResourceModel('sales/sale_collection')
110
  ->setOrderStateFilter(Mage_Sales_Model_Order::STATE_CANCELED, true)
111
  ->setCustomerFilter($customer)
112
  ->load()
113
  ->getTotals();
 
114
  if (Mage::helper('woopra')->getCustomerLifetimeSales() != NULL && $group != 'NOT LOGGED IN') {
115
  $data['customer_lifetime_sales'] = round($customerTotals->getLifetime(), 2);
116
  }
 
117
  if (Mage::helper('woopra')->getCustomerNumberOrders() != NULL && $group != 'NOT LOGGED IN') {
118
  $data['customer_number_orders'] = $customerTotals->getNumOrders();
119
  }
120
 
 
121
  $wishList = Mage::getSingleton('wishlist/wishlist')->loadByCustomer($customer);
122
+ $wishListCollection = $wishList->getItemCollection();
123
  $wishlistItems = 0;
124
  $wishListTotal = 0;
125
+ foreach ($wishListCollection as $item) {
126
  $product = $item->getProduct();
127
  $wishlistItems = $wishlistItems + 1;
128
  $wishListTotal = $wishListTotal + $product->getPrice();
129
  }
 
130
  if (Mage::helper('woopra')->getCustomerWishlistItems() != NULL) {
131
  $data['customer_wishlist_items'] = $wishlistItems;
132
  }
 
133
  if (Mage::helper('woopra')->getCustomerWishlistTotal() != NULL) {
134
  $data['customer_wishlist_total'] = $wishListTotal;
135
  }
136
  }
137
 
 
138
  if (Mage::helper('woopra')->getCustomerCartItems() != NULL) {
139
  $data['customer_cart_items'] = Mage::helper('checkout/cart')->getCart()->getItemsCount();
140
  }
 
141
  if (Mage::helper('woopra')->getCustomerCartTotal() != NULL) {
142
+ $data['customer_cart_total'] = round(Mage::getSingleton('checkout/session')
143
+ ->getQuote()->getBaseSubtotal(), 2);
144
  }
 
145
  $currentCategory = Mage::registry('current_category');
146
+ if (!empty($currentCategory)) {
147
  $data['category'] = addslashes($currentCategory->getName());
148
  }
 
149
  $currentProduct = Mage::registry('current_product');
150
+ if (!empty($currentProduct)) {
151
  $data['product_sku'] = $currentProduct->getSku();
152
  $data['product_price'] = strip_tags(Mage::app()->getStore()->formatPrice($currentProduct->getPrice()));
153
  }
154
 
 
155
  if (Mage::helper('woopra')->getNewsletterSubscribed() != NULL) {
156
+ $data['woopra_subscriber_changed'] = Mage::getSingleton('core/session')
157
+ ->getData('woopra_subscriber_changed', true);
158
+ $data['woopra_subscriber_status'] = Mage::getSingleton('core/session')
159
+ ->getData('woopra_subscriber_status', true);
160
+ $data['woopra_subscriber_email'] = Mage::getSingleton('core/session')
161
+ ->getData('woopra_subscriber_email', true);
162
  }
163
 
 
164
  if (Mage::helper('woopra')->getContactFormSent() != NULL) {
165
+ $data['woopra_contacts_index_post'] = Mage::getSingleton('core/session')
166
+ ->getData('woopra_contacts_index_post', true);
167
+ $data['woopra_contacts_name'] = Mage::getSingleton('core/session')
168
+ ->getData('woopra_contacts_name', true);
169
+ $data['woopra_contacts_email'] = Mage::getSingleton('core/session')
170
+ ->getData('woopra_contacts_email', true);
171
+ $data['woopra_contacts_telephone'] = Mage::getSingleton('core/session')
172
+ ->getData('woopra_contacts_telephone', true);
173
+ $data['woopra_contacts_comment'] = Mage::getSingleton('core/session')
174
+ ->getData('woopra_contacts_comment', true);
175
  }
176
 
177
+ $data['woopra_cart_wishlist_trigger'] = Mage::getSingleton('core/session')
178
+ ->getData('woopra_cart_wishlist_trigger', true);
179
+ $data['woopra_cart_wishlist_status'] = Mage::getSingleton('core/session')
180
+ ->getData('woopra_cart_wishlist_status', true);
181
+ $data['woopra_cart_wishlist_name'] = Mage::getSingleton('core/session')
182
+ ->getData('woopra_cart_wishlist_name', true);
183
+ $data['woopra_cart_wishlist_sku'] = Mage::getSingleton('core/session')
184
+ ->getData('woopra_cart_wishlist_sku', true);
185
+ $data['woopra_cart_wishlist_price'] = Mage::getSingleton('core/session')
186
+ ->getData('woopra_cart_wishlist_price', true);
187
 
 
188
  if (Mage::helper('woopra')->getCatalogSearch() != NULL) {
189
  $data['woopra_search_name'] = Mage::helper('woopra')->getCatalogSearch();
190
+ $data['woopra_search_trigger'] = Mage::getSingleton('core/session')
191
+ ->getData('woopra_search_trigger', true);
192
+ $data['woopra_search_keywords'] = Mage::getSingleton('core/session')
193
+ ->getData('woopra_search_keywords', true);
194
  }
195
 
 
196
  if (Mage::helper('woopra')->getCustomerCreateAccount() != NULL) {
197
+ $data['woopra_create_account_trigger'] = Mage::getSingleton('core/session')
198
+ ->getData('woopra_create_account_trigger', true);
199
  }
200
 
 
201
  if (Mage::helper('woopra')->getCustomerCreateAccountSuccess() != NULL) {
202
+ $data['woopra_create_account_success_trigger'] = Mage::getSingleton('core/session')
203
+ ->getData('woopra_create_account_success_trigger', true);
204
  }
205
 
 
206
  if (Mage::helper('woopra')->getCheckoutBillingAddress() != NULL) {
207
+ $data['woopra_checkout_trigger'] = Mage::getSingleton('core/session')
208
+ ->getData('woopra_checkout_trigger', true);
209
  }
210
 
 
211
  if (Mage::helper('woopra')->getCheckoutSuccess() != NULL) {
212
+ $data['woopra_checkout_payment_method'] = Mage::getSingleton('core/session')
213
+ ->getData('woopra_checkout_payment_method', true);
214
+ $data['woopra_checkout_payment_cc_type'] = Mage::getSingleton('core/session')
215
+ ->getData('woopra_checkout_payment_cc_type', true);
216
+ $data['woopra_checkout_success_trigger'] = Mage::getSingleton('core/session')
217
+ ->getData('woopra_checkout_success_trigger', true);
218
+ $data['woopra_checkout_success_coupon_code'] = Mage::getSingleton('core/session')
219
+ ->getData('woopra_checkout_success_coupon_code', true);
220
+ $data['woopra_checkout_success_discount_amount'] = Mage::getSingleton('core/session')
221
+ ->getData('woopra_checkout_success_discount_amount', true);
222
+ $data['woopra_checkout_success_order_id'] = Mage::getSingleton('core/session')
223
+ ->getData('woopra_checkout_success_order_id', true);
224
+ $data['woopra_checkout_success_order_subtotal'] = Mage::getSingleton('core/session')
225
+ ->getData('woopra_checkout_success_order_subtotal', true);
226
+ $data['woopra_checkout_success_order_total'] = Mage::getSingleton('core/session')
227
+ ->getData('woopra_checkout_success_order_total', true);
228
+ $data['woopra_checkout_success_order_weight'] = Mage::getSingleton('core/session')
229
+ ->getData('woopra_checkout_success_order_weight', true);
230
+ $data['woopra_checkout_success_shipping_amount'] = Mage::getSingleton('core/session')
231
+ ->getData('woopra_checkout_success_shipping_amount', true);
232
+ $data['woopra_checkout_success_shipping_description'] = Mage::getSingleton('core/session')
233
+ ->getData('woopra_checkout_success_shipping_description', true);
234
+ $data['woopra_checkout_success_total_items_ordered'] = Mage::getSingleton('core/session')
235
+ ->getData('woopra_checkout_success_total_items_ordered', true);
236
+ $data['woopra_checkout_success_profit'] = Mage::getSingleton('core/session')
237
+ ->getData('woopra_checkout_success_profit', true);
238
  }
239
 
 
240
  if (Mage::helper('woopra')->getCmsNoRoute() != NULL) {
241
+ $data['woopra_cms_noroute_trigger'] = Mage::getSingleton('core/session')
242
+ ->getData('woopra_cms_noroute_trigger', true);
243
+ $data['woopra_cms_noroute_path'] = Mage::getSingleton('core/session')
244
+ ->getData('woopra_cms_noroute_path', true);
245
  $data['woopra_cms_noroute_url'] = Mage::helper('core/url')->getCurrentUrl();
246
  }
247
 
 
248
  if (Mage::helper('woopra')->getCouponCodeAdded() != NULL) {
249
+ $data['woopra_coupon_code_trigger'] = Mage::getSingleton('core/session')
250
+ ->getData('woopra_coupon_code_trigger', true);
251
+ $data['woopra_coupon_code_status'] = Mage::getSingleton('core/session')
252
+ ->getData('woopra_coupon_code_status', true);
253
  $data['woopra_coupon_code'] = Mage::getSingleton('core/session')->getData('woopra_coupon_code', true);
254
+ $data['woopra_coupon_code_validity'] = Mage::getSingleton('core/session')
255
+ ->getData('woopra_coupon_code_validity', true);
256
+ $data['woopra_coupon_code_active'] = Mage::getSingleton('core/session')
257
+ ->getData('woopra_coupon_code_active', true);
258
+ $data['woopra_coupon_code_name'] = Mage::getSingleton('core/session')
259
+ ->getData('woopra_coupon_code_name', true);
260
  }
261
 
 
262
  if (Mage::helper('woopra')->getCustomerLogin() != NULL) {
263
+ $data['woopra_login_logout_trigger'] = Mage::getSingleton('core/session')
264
+ ->getData('woopra_login_logout_trigger', true);
265
+ $data['woopra_login_logout_status'] = Mage::getSingleton('core/session')
266
+ ->getData('woopra_login_logout_status', true);
267
  }
268
 
 
269
  if (Mage::helper('woopra')->getForgotPassword() != NULL) {
270
+ $data['woopra_forgot_password_trigger'] = Mage::getSingleton('core/session')
271
+ ->getData('woopra_forgot_password_trigger', true);
272
+ $data['woopra_forgot_password_email'] = Mage::getSingleton('core/session')
273
+ ->getData('woopra_forgot_password_email', true);
274
  }
275
 
 
276
  if (Mage::helper('woopra')->getChangedPassword() != NULL) {
277
+ $data['woopra_password_changed_trigger'] = Mage::getSingleton('core/session')
278
+ ->getData('woopra_password_changed_trigger', true);
279
  }
280
 
 
281
  if (Mage::helper('woopra')->getProductTagAdded() != NULL) {
282
+ $data['woopra_product_tag_added_trigger'] = Mage::getSingleton('core/session')
283
+ ->getData('woopra_product_tag_added_trigger', true);
284
+ $data['woopra_product_tag_name'] = Mage::getSingleton('core/session')
285
+ ->getData('woopra_product_tag_name', true);
286
  }
287
 
 
288
  if (Mage::helper('woopra')->getPollVote() != NULL) {
289
+ $data['woopra_poll_vote_trigger'] = Mage::getSingleton('core/session')
290
+ ->getData('woopra_poll_vote_trigger', true);
291
+ $data['woopra_poll_vote_title'] = Mage::getSingleton('core/session')
292
+ ->getData('woopra_poll_vote_title', true);
293
+ $data['woopra_poll_vote_answer'] = Mage::getSingleton('core/session')
294
+ ->getData('woopra_poll_vote_answer', true);
295
  }
296
 
297
+ if (Mage::helper('woopra')->getProductReviewRead() != NULL && Mage::getSingleton('core/session')
298
+ ->getData('woopra_product_review_trigger') == 1) {
299
  $data['woopra_cart_wishlist_status'] = 'product_review_posted';
300
+ $data['woopra_product_review_trigger'] = Mage::getSingleton('core/session')
301
+ ->getData('woopra_product_review_trigger', true);
302
+ $data['woopra_product_review_nickname'] = Mage::getSingleton('core/session')
303
+ ->getData('woopra_product_review_nickname', true);
304
+ $data['woopra_product_review_title'] = Mage::getSingleton('core/session')
305
+ ->getData('woopra_product_review_title', true);
306
+ $data['woopra_product_review_detail'] = Mage::getSingleton('core/session')
307
+ ->getData('woopra_product_review_detail', true);
308
  }
309
 
310
+ if (Mage::helper('woopra')->getEstimatePost() != NULL && Mage::getSingleton('core/session')
311
+ ->getData('woopra_estimate_post_trigger') == 1) {
312
+ $data['woopra_estimate_post_trigger'] = Mage::getSingleton('core/session')
313
+ ->getData('woopra_estimate_post_trigger', true);
314
+ $data['woopra_estimate_post_country'] = Mage::getSingleton('core/session')
315
+ ->getData('woopra_estimate_post_country', true);
316
+ $data['woopra_estimate_post_state'] = Mage::getSingleton('core/session')
317
+ ->getData('woopra_estimate_post_state', true);
318
+ $data['woopra_estimate_post_zip'] = Mage::getSingleton('core/session')
319
+ ->getData('woopra_estimate_post_zip', true);
320
  }
321
 
 
322
  if (Mage::helper('woopra')->getProductEmailToFriend() != NULL) {
323
+ $data['woopra_sendfriend_product_trigger'] = Mage::getSingleton('core/session')
324
+ ->getData('woopra_sendfriend_product_trigger', true);
325
+ $data['woopra_sendfriend_product_name'] = Mage::getSingleton('core/session')
326
+ ->getData('woopra_sendfriend_product_name', true);
327
+ $data['woopra_sendfriend_product_sku'] = Mage::getSingleton('core/session')
328
+ ->getData('woopra_sendfriend_product_sku', true);
329
+ $data['woopra_sendfriend_product_price'] = Mage::getSingleton('core/session')
330
+ ->getData('woopra_sendfriend_product_price', true);
331
  }
332
  }
333
 
334
+ if (isset($data[$key])) {
335
  return $data[$key];
336
  } else {
337
  return null;
app/code/community/Woopra/Analytics/Helper/Data.php CHANGED
@@ -4,20 +4,12 @@
4
  *
5
  * @package Woopra_Analytics
6
  * @author K3Live for Woopra
7
- * @copyright Copyright (c) 2013 Woopra (http://www.woopra.com/)
8
  * @license Open Software License (OSL 3.0)
9
  */
10
 
11
  class Woopra_Analytics_Helper_Data extends Mage_Core_Helper_Abstract
12
  {
13
- public function getAppId()
14
- {
15
- return Mage::getStoreConfig('woopra_analytics/woopra/app_id');
16
- }
17
- public function getSecretKey()
18
- {
19
- return Mage::getStoreConfig('woopra_analytics/woopra/secret_key');
20
- }
21
  public function getEnabled()
22
  {
23
  return (bool)Mage::getStoreConfig('woopra_analytics/woopra/enabled');
4
  *
5
  * @package Woopra_Analytics
6
  * @author K3Live for Woopra
7
+ * @copyright Copyright (c) 2015 Woopra (http://www.woopra.com/)
8
  * @license Open Software License (OSL 3.0)
9
  */
10
 
11
  class Woopra_Analytics_Helper_Data extends Mage_Core_Helper_Abstract
12
  {
 
 
 
 
 
 
 
 
13
  public function getEnabled()
14
  {
15
  return (bool)Mage::getStoreConfig('woopra_analytics/woopra/enabled');
app/code/community/Woopra/Analytics/Model/Observer.php CHANGED
@@ -1,10 +1,11 @@
1
  <?php
 
2
  /**
3
  * Woopra Module for Magento
4
  *
5
  * @package Woopra_Analytics
6
  * @author K3Live for Woopra
7
- * @copyright Copyright (c) 2013 Woopra (http://www.woopra.com/)
8
  * @license Open Software License (OSL 3.0)
9
  */
10
 
@@ -15,195 +16,214 @@ class Woopra_Analytics_Model_Observer extends Varien_Event_Observer
15
  if (Mage::helper('woopra')->getNewsletterSubscribed() != NULL) {
16
  $event = $observer->getEvent();
17
  $model = $event->getSubscriber();
18
- $subscriber_email = $model->getData('subscriber_email');
19
- if ($model->getIsStatusChanged() == 1 && $model->getData(subscriber_status) == 1) {
20
  Mage::getSingleton('core/session')->setData('woopra_subscriber_changed', 1);
21
- Mage::getSingleton('core/session')->setData('woopra_subscriber_status', Mage::helper('woopra')->getNewsletterSubscribed());
22
- Mage::getSingleton('core/session')->setData('woopra_subscriber_email', Mage::helper('core')->escapeHtml(addslashes($subscriber_email)));
23
- } else if ($model->getIsStatusChanged() == 1 && $model->getData(subscriber_status) == 3) {
 
 
24
  Mage::getSingleton('core/session')->setData('woopra_subscriber_changed', 1);
25
- Mage::getSingleton('core/session')->setData('woopra_subscriber_status', Mage::helper('woopra')->getNewsletterUnsubscribed());
26
- Mage::getSingleton('core/session')->setData('woopra_subscriber_email', Mage::helper('core')->escapeHtml(addslashes($subscriber_email)));
 
 
27
  } else {
 
28
  }
29
  }
30
  }
31
 
32
  public function controllerActionBefore(Varien_Event_Observer $observer)
33
  {
34
- //Mage::log($observer->getEvent()->getControllerAction()->getFullActionName(), null, 'woopra.log');
35
-
36
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_loginPost' && Mage::helper('woopra')->getCustomerLogin() != NULL)
37
- {
38
  Mage::getSingleton('core/session')->setData('woopra_login_logout_trigger', 1);
39
- Mage::getSingleton('core/session')->setData('woopra_login_logout_status', Mage::helper('woopra')->getCustomerLogin());
 
40
  }
41
 
42
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_logoutSuccess' && Mage::helper('woopra')->getCustomerLogout() != NULL)
43
- {
44
- Mage::getSingleton('core/session')->setData('woopra_login_logout_trigger', 1);
45
- Mage::getSingleton('core/session')->setData('woopra_login_logout_status', Mage::helper('woopra')->getCustomerLogout());
46
- }
 
47
 
48
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'contacts_index_post' && Mage::helper('woopra')->getContactFormSent() != NULL)
49
- {
50
- $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
51
  if ($request) {
52
  Mage::getSingleton('core/session')->setData('woopra_contacts_index_post', 1);
53
- Mage::getSingleton('core/session')->setData('woopra_contacts_name', Mage::helper('core')->escapeHtml(addslashes($request['name'])));
54
- Mage::getSingleton('core/session')->setData('woopra_contacts_email', Mage::helper('core')->escapeHtml(addslashes($request['email'])));
55
- Mage::getSingleton('core/session')->setData('woopra_contacts_telephone', Mage::helper('core')->escapeHtml(addslashes($request['telephone'])));
56
- Mage::getSingleton('core/session')->setData('woopra_contacts_comment', Mage::helper('core')->escapeHtml(addslashes($request['comment'])));
57
- //Mage::log($request['name']." | ".$request['email']." | ".$request['telephone']." | ".$request['comment'], null, 'woopra.log');
 
 
 
58
  }
59
- }
60
 
61
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_add' && Mage::helper('woopra')->getProductAddedToCart() != NULL)
62
- {
63
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
64
  if ($request) {
65
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
66
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
67
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status', Mage::helper('woopra')->getProductAddedToCart());
 
68
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
69
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
70
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
71
- //Mage::log($product['name']." | ".$product['sku']." | ".round($product['price'], 2), null, 'woopra.log');
72
  }
73
  }
74
 
75
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_delete' && Mage::helper('woopra')->getProductRemovedFromCart() != NULL)
76
- {
77
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
78
  if ($request) {
79
- $product_id = Mage::getModel('checkout/cart')->getQuote()->getItemById($request['id'])->getProduct()->getId();
80
- $product = Mage::getModel('catalog/product')->load($product_id)->getData();
 
81
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
82
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status', Mage::helper('woopra')->getProductRemovedFromCart());
 
83
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
84
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
85
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
86
- //Mage::log($product['name']." | ".$product['sku']." | ".round($product['price'], 2), null, 'woopra.log');
87
  }
88
  }
89
 
90
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'wishlist_index_add' && Mage::helper('woopra')->getProductAddedToWishlist() != NULL)
91
- {
92
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
93
  if ($request) {
94
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
95
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
96
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status', Mage::helper('woopra')->getProductAddedToWishlist());
 
97
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
98
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
99
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
100
- //Mage::log($product['name']." | ".$product['sku']." | ".round($product['price'], 2), null, 'woopra.log');
101
  }
102
  }
103
 
104
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'wishlist_index_remove' && Mage::helper('woopra')->getProductRemovedFromWishlist() != NULL)
105
- {
106
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
107
  if ($request) {
108
- $product_id = Mage::getModel('wishlist/item')->load($request['item'])->getProduct()->getId();
109
- $product = Mage::getModel('catalog/product')->load($product_id)->getData();
110
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
111
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status', Mage::helper('woopra')->getProductRemovedFromWishlist());
 
112
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', $product['name']);
113
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', $product['sku']);
114
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
115
- //Mage::log($product['name']." | ".$product['sku']." | ".round($product['price'], 2), null, 'woopra.log');
116
  }
117
  }
118
 
119
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'catalog_product_compare_add' && Mage::helper('woopra')->getProductAddedToCompare() != NULL)
120
- {
121
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
122
  if ($request) {
123
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
124
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
125
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status', Mage::helper('woopra')->getProductAddedToCompare());
 
126
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
127
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
128
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
129
- //Mage::log($product['name']." | ".$product['sku']." | ".round($product['price'], 2), null, 'woopra.log');
130
  }
131
  }
132
 
133
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'catalog_product_compare_remove' && Mage::helper('woopra')->getProductRemovedFromCompare() != NULL)
134
- {
135
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
136
  if ($request) {
137
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
138
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
139
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status', Mage::helper('woopra')->getProductRemovedFromCompare());
 
140
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', $product['name']);
141
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', $product['sku']);
142
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
143
- //Mage::log($product['name']." | ".$product['sku']." | ".round($product['price'], 2), null, 'woopra.log');
144
  }
145
  }
146
 
147
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_onepage_index' && Mage::helper('woopra')->getCheckoutBillingAddress() != NULL)
148
- {
149
  Mage::getSingleton('core/session')->setData('woopra_checkout_trigger', 1);
150
  }
151
 
152
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_onepage_savePayment' && Mage::helper('woopra')->getCheckoutPaymentMethod() != NULL)
153
- {
154
- $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
155
  Mage::getSingleton('core/session')->setData('woopra_checkout_trigger', 1);
156
- Mage::getSingleton('core/session')->setData('woopra_checkout_payment_method', $request['payment']['method']);
157
- if ($request['payment']['method'] == 'ccsave')
158
- {
159
- Mage::getSingleton('core/session')->setData('woopra_checkout_payment_cc_type', $request['payment']['cc_type']);
 
160
  }
161
- //Mage::log($request['payment']['cc_type'], null, 'woopra.log');
162
  }
163
 
164
- if (($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_onepage_success' || $observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_multishipping_success') && Mage::helper('woopra')->getCheckoutSuccess() != NULL)
165
- {
 
166
  $lastOrderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
167
  if ($lastOrderId) {
168
  $order = Mage::getModel('sales/order')->loadByIncrementId($lastOrderId);
169
  $cost = 0;
170
  Mage::getSingleton('core/session')->setData('woopra_checkout_success_trigger', 1);
171
- Mage::getSingleton('core/session')->setData('woopra_checkout_success_coupon_code', addslashes($order->getCouponCode()));
172
- Mage::getSingleton('core/session')->setData('woopra_checkout_success_discount_amount', round($order->getDiscountAmount(), 2));
173
- Mage::getSingleton('core/session')->setData('woopra_checkout_success_order_id', addslashes($lastOrderId));
174
- Mage::getSingleton('core/session')->setData('woopra_checkout_success_order_subtotal', round($order->getSubtotal(), 2));
175
- Mage::getSingleton('core/session')->setData('woopra_checkout_success_order_total', round($order->getGrandTotal(), 2));
176
- Mage::getSingleton('core/session')->setData('woopra_checkout_success_order_weight', round($order->getWeight(), 2));
177
- Mage::getSingleton('core/session')->setData('woopra_checkout_success_shipping_amount', round($order->getShippingAmount(), 2));
178
- Mage::getSingleton('core/session')->setData('woopra_checkout_success_shipping_description', addslashes($order->getShippingDescription()));
179
- Mage::getSingleton('core/session')->setData('woopra_checkout_success_total_items_ordered', round($order->getTotalQtyOrdered(), 0));
 
 
 
 
 
 
 
 
 
180
  $items = $order->getAllVisibleItems();
181
- foreach ($items as $itemId => $item)
182
- {
183
  $cost = $cost + Mage::getModel('catalog/product')->load($item->getProductId())->getData('cost');
184
  }
185
  $profit = $order->getSubtotal() - $cost;
186
- if ($cost != 0)
187
- {
188
  Mage::getSingleton('core/session')->setData('woopra_checkout_success_profit', round($profit, 2));
189
  }
190
- //Mage::log($order, null, 'woopra.log');
191
  }
192
  }
193
 
194
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'catalogsearch_result_index' && Mage::helper('woopra')->getCatalogSearch() != NULL)
195
- {
196
- $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
197
  if ($request) {
198
  Mage::getSingleton('core/session')->setData('woopra_search_trigger', 1);
199
- Mage::getSingleton('core/session')->setData('woopra_search_keywords', Mage::helper('core')->escapeHtml(addslashes($request['q'])));
200
- //Mage::log($request['q'], null, 'woopra.log');
201
  }
202
  }
203
 
204
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'catalogsearch_advanced_result' && Mage::helper('woopra')->getCatalogSearch() != NULL)
205
- {
206
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
 
 
207
  if ($request) {
208
  foreach ($request as $key => $answer) {
209
  if (is_array($answer) == true) {
@@ -211,246 +231,192 @@ class Woopra_Analytics_Model_Observer extends Varien_Event_Observer
211
  $subtotal = $subtotal." ".$subkey.":".$subanswer;
212
  $answer = $subtotal;
213
  }
214
- $subtotal = NULL;
215
  }
216
- $search_keywords = $search_keywords." | ".$key.": ".$answer;
217
  }
218
  Mage::getSingleton('core/session')->setData('woopra_search_trigger', 1);
219
- Mage::getSingleton('core/session')->setData('woopra_search_keywords', Mage::helper('core')->escapeHtml(addslashes($search_keywords)));
220
- //Mage::log($search_keywords, null, 'woopra.log');
221
  }
222
  }
223
 
224
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'review_product_list' && Mage::helper('woopra')->getProductReviewRead() != NULL)
225
- {
226
- $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
227
  if ($request) {
228
  $product = Mage::getModel('catalog/product')->load($request['id'])->getData();
229
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
230
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status', Mage::helper('woopra')->getProductReviewRead());
231
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
232
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
233
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
234
- //Mage::log($product['name']." | ".$product['sku']." | ".round($product['price'], 2), null, 'woopra.log');
235
  }
236
  }
237
 
238
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'review_product_post' && Mage::helper('woopra')->getProductReviewPosted() != NULL)
239
- {
240
- $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
241
  if ($request) {
242
  $product = Mage::getModel('catalog/product')->load($request['id'])->getData();
243
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
244
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status', Mage::helper('woopra')->getProductReviewPosted());
245
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
246
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
247
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
 
248
  Mage::getSingleton('core/session')->setData('woopra_product_review_trigger', 1);
249
- Mage::getSingleton('core/session')->setData('woopra_product_review_nickname', Mage::helper('core')->escapeHtml(addslashes($request['nickname'])));
250
- Mage::getSingleton('core/session')->setData('woopra_product_review_title', Mage::helper('core')->escapeHtml(addslashes($request['title'])));
251
- Mage::getSingleton('core/session')->setData('woopra_product_review_detail', Mage::helper('core')->escapeHtml(addslashes($request['detail'])));
252
- //Mage::log($product['name']." | ".$product['sku']." | ".round($product['price'], 2)." | ".$request['nickname']." | ".$request['title']." | ".$request['detail'], null, 'woopra.log');
 
 
253
  }
254
  }
255
 
256
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_forgotpasswordpost' && Mage::helper('woopra')->getForgotPassword() != NULL)
257
- {
258
- $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
259
- Mage::getSingleton('core/session')->setData('woopra_forgot_password_trigger', 1);
 
260
  if ($request) {
261
- Mage::getSingleton('core/session')->setData('woopra_forgot_password_email', Mage::helper('core')->escapeHtml(addslashes($request['email'])));
262
- //Mage::log($request['email'], null, 'woopra.log');
263
  }
264
  }
265
 
266
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_editPost' && Mage::helper('woopra')->getChangedPassword() != NULL)
267
- {
268
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
269
  if ($request['change_password'] == 1 && $request['current_password'] != $request['password']) {
270
  Mage::getSingleton('core/session')->setData('woopra_password_changed_trigger', 1);
271
  }
272
- //Mage::log($request, null, 'woopra.log');
273
  }
274
 
275
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'tag_index_save' && Mage::helper('woopra')->getProductTagAdded() != NULL)
276
- {
277
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
278
  if ($request) {
279
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
280
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
281
- Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status', Mage::helper('woopra')->getProductTagAdded());
 
282
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
283
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
284
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
285
  Mage::getSingleton('core/session')->setData('woopra_product_tag_added_trigger', 1);
286
- Mage::getSingleton('core/session')->setData('woopra_product_tag_name', Mage::helper('core')->escapeHtml(addslashes($request['productTagName'])));
287
- //Mage::log($product['name']." | ".$product['sku']." | ".round($product['price'], 2)." | ".$request['productTagName'], null, 'woopra.log');
288
  }
289
  }
290
 
291
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_couponPost' && Mage::helper('woopra')->getCouponCodeAdded() != NULL)
292
- {
293
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
294
  if ($request) {
295
- $coupon_id = Mage::getModel('salesrule/coupon')->load($request['coupon_code'], 'code');
296
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_trigger', 1);
297
  if ($request['remove'] == 1) {
298
- Mage::getSingleton('core/session')->setData('woopra_coupon_code_status', Mage::helper('woopra')->getCouponCodeRemoved());
 
299
  } else {
300
- Mage::getSingleton('core/session')->setData('woopra_coupon_code_status', Mage::helper('woopra')->getCouponCodeAdded());
301
- //Mage::log($coupon_id->getData(), null, 'woopra.log');
302
  }
303
- if ($coupon_id['coupon_id'] != null) {
304
- $coupon_rules = Mage::getModel('salesrule/rule')->load($coupon_id->getRuleId());
305
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_validity', 'valid');
306
- Mage::getSingleton('core/session')->setData('woopra_coupon_code_name', addslashes($coupon_rules->getData('name')));
307
- //Mage::log($coupon_rules->getData(), null, 'woopra.log');
308
- if ($coupon_rules->getData('is_active') == 1) {
309
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_active', 'active');
310
- //Mage::log($coupon_rules->getData('is_active').' | = active', null, 'woopra.log');
311
  } else {
312
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_active', 'inactive');
313
- //Mage::log($coupon_rules->getData('is_active').' | = inactive', null, 'woopra.log');
314
  }
315
  } else {
316
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_validity', 'invalid');
317
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_name', '-');
318
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_active', '-');
319
  }
320
- Mage::getSingleton('core/session')->setData('woopra_coupon_code', Mage::helper('core')->escapeHtml(addslashes($request['coupon_code'])));
321
- //Mage::log($observer, null, 'woopra.log');
322
  }
323
  }
324
 
325
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_create' && Mage::helper('woopra')->getCustomerCreateAccount() != NULL)
326
- {
327
  Mage::getSingleton('core/session')->setData('woopra_create_account_trigger', 1);
328
- //Mage::log('Create account started.', null, 'woopra.log');
329
  }
330
 
331
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_createpost' && Mage::helper('woopra')->getCustomerCreateAccount() != NULL)
332
- {
333
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
334
  Mage::getSingleton('core/session')->setData('woopra_create_account_success_trigger', 1);
335
  if ($request['is_subscribed'] == 1) {
336
  Mage::getSingleton('core/session')->setData('woopra_subscriber_changed', 1);
337
- Mage::getSingleton('core/session')->setData('woopra_subscriber_status', Mage::helper('woopra')->getNewsletterSubscribed());
338
- Mage::getSingleton('core/session')->setData('woopra_subscriber_email', Mage::helper('core')->escapeHtml(addslashes($request[email])));
 
 
339
  }
340
- //Mage::log($request, null, 'woopra.log');
341
  }
342
 
343
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_estimatePost' && Mage::helper('woopra')->getEstimatePost() != NULL)
344
- {
345
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
346
  if ($request) {
347
  $region = Mage::getModel('directory/region')->load($request['region_id']);
348
  Mage::getSingleton('core/session')->setData('woopra_estimate_post_trigger', 1);
349
  Mage::getSingleton('core/session')->setData('woopra_estimate_post_country', $request['country_id']);
350
  Mage::getSingleton('core/session')->setData('woopra_estimate_post_state', $region->getName());
351
- Mage::getSingleton('core/session')->setData('woopra_estimate_post_zip', Mage::helper('core')->escapeHtml($request['estimate_postcode']));
352
- //Mage::log($request['country_id']." | ".$region->getName()." | ".$request['estimate_postcode'], null, 'woopra.log');
353
  }
354
  }
355
 
356
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'cms_index_noRoute' && Mage::helper('woopra')->getCmsNoRoute() != NULL)
357
- {
358
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getOriginalPathInfo();
359
  Mage::getSingleton('core/session')->setData('woopra_cms_noroute_trigger', 1);
360
  if ($request) {
361
  Mage::getSingleton('core/session')->setData('woopra_cms_noroute_path', $request);
362
- //Mage::log($request, null, 'woopra.log');
363
  }
364
  }
365
 
366
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'poll_vote_add' && Mage::helper('woopra')->getPollVote() != NULL)
367
- {
368
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
369
  if ($request) {
370
- $poll_title = Mage::getModel('poll/poll')->load($request['poll_id'])->getData();
371
- $poll_answers = Mage::getResourceModel('poll/poll_answer_collection')->addPollFilter($request['poll_id'])->getData();
372
- foreach ($poll_answers as $key => $answer) {
 
373
  if ($answer['answer_id'] == $request['vote']) {
374
- $answer_title = $answer['answer_title'];
375
  }
376
  }
377
  Mage::getSingleton('core/session')->setData('woopra_poll_vote_trigger', 1);
378
- Mage::getSingleton('core/session')->setData('woopra_poll_vote_title', addslashes($poll_title['poll_title']));
379
- Mage::getSingleton('core/session')->setData('woopra_poll_vote_answer', addslashes($answer_title));
380
- //Mage::log($poll_title['poll_title']." | ".$answer_title, null, 'woopra.log');
381
  }
382
  }
383
 
384
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'sendfriend_product_sendmail' && Mage::helper('woopra')->getProductEmailToFriend() != NULL)
385
- {
386
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
387
  if ($request) {
388
  $product = Mage::getModel('catalog/product')->load($request['id'])->getData();
389
- Mage::getSingleton('core/session')->setData('woopra_sendfriend_product_name', addslashes($product['name']));
390
- Mage::getSingleton('core/session')->setData('woopra_sendfriend_product_sku', addslashes($product['sku']));
391
- Mage::getSingleton('core/session')->setData('woopra_sendfriend_product_price', round($product['price'], 2));
 
 
 
392
  Mage::getSingleton('core/session')->setData('woopra_sendfriend_product_trigger', 1);
393
- //Mage::log($request, null, 'woopra.log');
394
  }
395
  }
396
-
397
- /* Payment Status Coming Soon
398
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_onepage_saveOrder')
399
- {
400
- $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
401
- if ($request) {
402
- Mage::log($request, null, 'woopra.log');
403
- }
404
- }*/
405
-
406
- /* Send tracking events during checkout using HTTP Tracking API - Coming One Day(TM)
407
- if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_onepage_progress')
408
- {
409
- function sendTracking($event) {
410
- $customer = Mage::getSingleton('customer/session');
411
- $visitor = Mage::getSingleton('core/session')->getVisitorData();
412
- $url = 'host='.Mage::helper('woopra')->getHostname();
413
- $url .= '&cookie='.$visitor[session_id];
414
- $url .= '&ip='.$visitor[http_host];
415
- $url .= '&browser='.$visitor[http_user_agent];
416
- $url .= '&event='.$event;
417
- $url .= '&cv_name='.$customer->getName();
418
- $url .= '&cv_email='.$customer->getEmail();
419
- //Mage::log(urlencode($url), null, 'woopra.log');
420
- $curl = new Varien_Http_Adapter_Curl();
421
- $curl->setConfig(array('timeout' => 10));
422
- $curl->write(Zend_Http_Client::GET, 'http://www.woopra.com/track/ce/?'.urlencode($url));
423
- //Mage::log($curl->read(), null, 'woopra.log');
424
- }
425
-
426
- $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
427
- switch ($request[toStep]) {
428
- case 'checkout_onepage_index':
429
- Mage::log("BILLING", null, 'woopra.log');
430
- sendTracking("checkout_billing_address");
431
- break;
432
- case 'billing':
433
- Mage::log("BILLING", null, 'woopra.log');
434
- sendTracking("checkout_billing_address");
435
- break;
436
- case 'shipping':
437
- Mage::log("SHIPPING", null, 'woopra.log');
438
- sendTracking("checkout_shipping_address");
439
- break;
440
- case 'shipping_method':
441
- Mage::log("SHIPPING METHOD", null, 'woopra.log');
442
- sendTracking("checkout_shipping_method");
443
- break;
444
- case 'payment':
445
- Mage::log("PAYMENT", null, 'woopra.log');
446
- sendTracking("checkout_payment_method");
447
- break;
448
- case 'review':
449
- Mage::log("REVIEW", null, 'woopra.log');
450
- sendTracking("checkout_review");
451
- break;
452
- }
453
- }*/
454
  }
455
  }
456
- ?>
1
  <?php
2
+
3
  /**
4
  * Woopra Module for Magento
5
  *
6
  * @package Woopra_Analytics
7
  * @author K3Live for Woopra
8
+ * @copyright Copyright (c) 2015 Woopra (http://www.woopra.com/)
9
  * @license Open Software License (OSL 3.0)
10
  */
11
 
16
  if (Mage::helper('woopra')->getNewsletterSubscribed() != NULL) {
17
  $event = $observer->getEvent();
18
  $model = $event->getSubscriber();
19
+ $subscriberEmail = $model->getData('subscriber_email');
20
+ if ($model->getIsStatusChanged() == 1 && $model->getData('subscriber_status') == 1) {
21
  Mage::getSingleton('core/session')->setData('woopra_subscriber_changed', 1);
22
+ Mage::getSingleton('core/session')->setData('woopra_subscriber_status',
23
+ Mage::helper('woopra')->getNewsletterSubscribed());
24
+ Mage::getSingleton('core/session')->setData('woopra_subscriber_email',
25
+ Mage::helper('core')->escapeHtml(addslashes($subscriberEmail)));
26
+ } else if ($model->getIsStatusChanged() == 1 && $model->getData('subscriber_status') == 3) {
27
  Mage::getSingleton('core/session')->setData('woopra_subscriber_changed', 1);
28
+ Mage::getSingleton('core/session')->setData('woopra_subscriber_status',
29
+ Mage::helper('woopra')->getNewsletterUnsubscribed());
30
+ Mage::getSingleton('core/session')->setData('woopra_subscriber_email',
31
+ Mage::helper('core')->escapeHtml(addslashes($subscriberEmail)));
32
  } else {
33
+
34
  }
35
  }
36
  }
37
 
38
  public function controllerActionBefore(Varien_Event_Observer $observer)
39
  {
40
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_loginPost' &&
41
+ Mage::helper('woopra')->getCustomerLogin() != NULL) {
 
 
42
  Mage::getSingleton('core/session')->setData('woopra_login_logout_trigger', 1);
43
+ Mage::getSingleton('core/session')->setData('woopra_login_logout_status',
44
+ Mage::helper('woopra')->getCustomerLogin());
45
  }
46
 
47
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_logoutSuccess' &&
48
+ Mage::helper('woopra')->getCustomerLogout() != NULL) {
49
+ Mage::getSingleton('core/session')->setData('woopra_login_logout_trigger', 1);
50
+ Mage::getSingleton('core/session')->setData('woopra_login_logout_status',
51
+ Mage::helper('woopra')->getCustomerLogout());
52
+ }
53
 
54
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'contacts_index_post' &&
55
+ Mage::helper('woopra')->getContactFormSent() != NULL) {
56
+ $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
57
  if ($request) {
58
  Mage::getSingleton('core/session')->setData('woopra_contacts_index_post', 1);
59
+ Mage::getSingleton('core/session')->setData('woopra_contacts_name',
60
+ Mage::helper('core')->escapeHtml(addslashes($request['name'])));
61
+ Mage::getSingleton('core/session')->setData('woopra_contacts_email',
62
+ Mage::helper('core')->escapeHtml(addslashes($request['email'])));
63
+ Mage::getSingleton('core/session')->setData('woopra_contacts_telephone',
64
+ Mage::helper('core')->escapeHtml(addslashes($request['telephone'])));
65
+ Mage::getSingleton('core/session')->setData('woopra_contacts_comment',
66
+ Mage::helper('core')->escapeHtml(addslashes($request['comment'])));
67
  }
68
+ }
69
 
70
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_add' &&
71
+ Mage::helper('woopra')->getProductAddedToCart() != NULL) {
72
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
73
  if ($request) {
74
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
75
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
76
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status',
77
+ Mage::helper('woopra')->getProductAddedToCart());
78
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
79
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
80
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
 
81
  }
82
  }
83
 
84
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_delete' &&
85
+ Mage::helper('woopra')->getProductRemovedFromCart() != NULL) {
86
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
87
  if ($request) {
88
+ $productId = Mage::getModel('checkout/cart')
89
+ ->getQuote()->getItemById($request['id'])->getProduct()->getId();
90
+ $product = Mage::getModel('catalog/product')->load($productId)->getData();
91
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
92
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status',
93
+ Mage::helper('woopra')->getProductRemovedFromCart());
94
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
95
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
96
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
 
97
  }
98
  }
99
 
100
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'wishlist_index_add' &&
101
+ Mage::helper('woopra')->getProductAddedToWishlist() != NULL) {
102
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
103
  if ($request) {
104
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
105
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
106
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status',
107
+ Mage::helper('woopra')->getProductAddedToWishlist());
108
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
109
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
110
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
 
111
  }
112
  }
113
 
114
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'wishlist_index_remove' &&
115
+ Mage::helper('woopra')->getProductRemovedFromWishlist() != NULL) {
116
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
117
  if ($request) {
118
+ $productId = Mage::getModel('wishlist/item')->load($request['item'])->getProduct()->getId();
119
+ $product = Mage::getModel('catalog/product')->load($productId)->getData();
120
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
121
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status',
122
+ Mage::helper('woopra')->getProductRemovedFromWishlist());
123
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', $product['name']);
124
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', $product['sku']);
125
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
 
126
  }
127
  }
128
 
129
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'catalog_product_compare_add' &&
130
+ Mage::helper('woopra')->getProductAddedToCompare() != NULL) {
131
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
132
  if ($request) {
133
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
134
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
135
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status',
136
+ Mage::helper('woopra')->getProductAddedToCompare());
137
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
138
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
139
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
 
140
  }
141
  }
142
 
143
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'catalog_product_compare_remove' &&
144
+ Mage::helper('woopra')->getProductRemovedFromCompare() != NULL) {
145
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
146
  if ($request) {
147
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
148
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
149
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status',
150
+ Mage::helper('woopra')->getProductRemovedFromCompare());
151
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', $product['name']);
152
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', $product['sku']);
153
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
 
154
  }
155
  }
156
 
157
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_onepage_index' &&
158
+ Mage::helper('woopra')->getCheckoutBillingAddress() != NULL) {
159
  Mage::getSingleton('core/session')->setData('woopra_checkout_trigger', 1);
160
  }
161
 
162
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_onepage_savePayment' &&
163
+ Mage::helper('woopra')->getCheckoutPaymentMethod() != NULL) {
164
+ $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
165
  Mage::getSingleton('core/session')->setData('woopra_checkout_trigger', 1);
166
+ Mage::getSingleton('core/session')->setData('woopra_checkout_payment_method',
167
+ $request['payment']['method']);
168
+ if ($request['payment']['method'] == 'ccsave') {
169
+ Mage::getSingleton('core/session')->setData('woopra_checkout_payment_cc_type',
170
+ $request['payment']['cc_type']);
171
  }
 
172
  }
173
 
174
+ if (($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_onepage_success' ||
175
+ $observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_multishipping_success')
176
+ && Mage::helper('woopra')->getCheckoutSuccess() != NULL) {
177
  $lastOrderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
178
  if ($lastOrderId) {
179
  $order = Mage::getModel('sales/order')->loadByIncrementId($lastOrderId);
180
  $cost = 0;
181
  Mage::getSingleton('core/session')->setData('woopra_checkout_success_trigger', 1);
182
+ Mage::getSingleton('core/session')->setData('woopra_checkout_success_coupon_code',
183
+ addslashes($order->getCouponCode()));
184
+ Mage::getSingleton('core/session')->setData('woopra_checkout_success_discount_amount',
185
+ round($order->getDiscountAmount(), 2));
186
+ Mage::getSingleton('core/session')->setData('woopra_checkout_success_order_id',
187
+ addslashes($lastOrderId));
188
+ Mage::getSingleton('core/session')->setData('woopra_checkout_success_order_subtotal',
189
+ round($order->getSubtotal(), 2));
190
+ Mage::getSingleton('core/session')->setData('woopra_checkout_success_order_total',
191
+ round($order->getGrandTotal(), 2));
192
+ Mage::getSingleton('core/session')->setData('woopra_checkout_success_order_weight',
193
+ round($order->getWeight(), 2));
194
+ Mage::getSingleton('core/session')->setData('woopra_checkout_success_shipping_amount',
195
+ round($order->getShippingAmount(), 2));
196
+ Mage::getSingleton('core/session')->setData('woopra_checkout_success_shipping_description',
197
+ addslashes($order->getShippingDescription()));
198
+ Mage::getSingleton('core/session')->setData('woopra_checkout_success_total_items_ordered',
199
+ round($order->getTotalQtyOrdered(), 0));
200
  $items = $order->getAllVisibleItems();
201
+ //foreach ($items as $itemId => $item) {
202
+ foreach ($items as $item) {
203
  $cost = $cost + Mage::getModel('catalog/product')->load($item->getProductId())->getData('cost');
204
  }
205
  $profit = $order->getSubtotal() - $cost;
206
+ if ($cost != 0) {
 
207
  Mage::getSingleton('core/session')->setData('woopra_checkout_success_profit', round($profit, 2));
208
  }
 
209
  }
210
  }
211
 
212
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'catalogsearch_result_index' &&
213
+ Mage::helper('woopra')->getCatalogSearch() != NULL) {
214
+ $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
215
  if ($request) {
216
  Mage::getSingleton('core/session')->setData('woopra_search_trigger', 1);
217
+ Mage::getSingleton('core/session')->setData('woopra_search_keywords',
218
+ Mage::helper('core')->escapeHtml(addslashes($request['q'])));
219
  }
220
  }
221
 
222
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'catalogsearch_advanced_result' &&
223
+ Mage::helper('woopra')->getCatalogSearch() != NULL) {
224
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
225
+ $subtotal = '';
226
+ $searchKeywords = '';
227
  if ($request) {
228
  foreach ($request as $key => $answer) {
229
  if (is_array($answer) == true) {
231
  $subtotal = $subtotal." ".$subkey.":".$subanswer;
232
  $answer = $subtotal;
233
  }
234
+ $subtotal = '';
235
  }
236
+ $searchKeywords = $searchKeywords." | ".$key.": ".$answer;
237
  }
238
  Mage::getSingleton('core/session')->setData('woopra_search_trigger', 1);
239
+ Mage::getSingleton('core/session')->setData('woopra_search_keywords',
240
+ Mage::helper('core')->escapeHtml(addslashes($searchKeywords)));
241
  }
242
  }
243
 
244
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'review_product_list' &&
245
+ Mage::helper('woopra')->getProductReviewRead() != NULL) {
246
+ $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
247
  if ($request) {
248
  $product = Mage::getModel('catalog/product')->load($request['id'])->getData();
249
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
250
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status',
251
+ Mage::helper('woopra')->getProductReviewRead());
252
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
253
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
254
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
255
  }
256
  }
257
 
258
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'review_product_post' &&
259
+ Mage::helper('woopra')->getProductReviewPosted() != NULL) {
260
+ $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
261
  if ($request) {
262
  $product = Mage::getModel('catalog/product')->load($request['id'])->getData();
263
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
264
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status',
265
+ Mage::helper('woopra')->getProductReviewPosted());
266
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
267
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
268
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
269
  Mage::getSingleton('core/session')->setData('woopra_product_review_trigger', 1);
270
+ Mage::getSingleton('core/session')->setData('woopra_product_review_nickname',
271
+ Mage::helper('core')->escapeHtml(addslashes($request['nickname'])));
272
+ Mage::getSingleton('core/session')->setData('woopra_product_review_title',
273
+ Mage::helper('core')->escapeHtml(addslashes($request['title'])));
274
+ Mage::getSingleton('core/session')->setData('woopra_product_review_detail',
275
+ Mage::helper('core')->escapeHtml(addslashes($request['detail'])));
276
  }
277
  }
278
 
279
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() ==
280
+ 'customer_account_forgotpasswordpost' &&
281
+ Mage::helper('woopra')->getForgotPassword() != NULL) {
282
+ $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
283
+ Mage::getSingleton('core/session')->setData('woopra_forgot_password_trigger', 1);
284
  if ($request) {
285
+ Mage::getSingleton('core/session')->setData('woopra_forgot_password_email',
286
+ Mage::helper('core')->escapeHtml(addslashes($request['email'])));
287
  }
288
  }
289
 
290
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_editPost' &&
291
+ Mage::helper('woopra')->getChangedPassword() != NULL) {
292
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
293
  if ($request['change_password'] == 1 && $request['current_password'] != $request['password']) {
294
  Mage::getSingleton('core/session')->setData('woopra_password_changed_trigger', 1);
295
  }
 
296
  }
297
 
298
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'tag_index_save' &&
299
+ Mage::helper('woopra')->getProductTagAdded() != NULL) {
300
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
301
  if ($request) {
302
  $product = Mage::getModel('catalog/product')->load($request['product'])->getData();
303
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_trigger', 1);
304
+ Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_status',
305
+ Mage::helper('woopra')->getProductTagAdded());
306
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_name', addslashes($product['name']));
307
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_sku', addslashes($product['sku']));
308
  Mage::getSingleton('core/session')->setData('woopra_cart_wishlist_price', round($product['price'], 2));
309
  Mage::getSingleton('core/session')->setData('woopra_product_tag_added_trigger', 1);
310
+ Mage::getSingleton('core/session')->setData('woopra_product_tag_name',
311
+ Mage::helper('core')->escapeHtml(addslashes($request['productTagName'])));
312
  }
313
  }
314
 
315
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_couponPost' &&
316
+ Mage::helper('woopra')->getCouponCodeAdded() != NULL) {
317
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
318
  if ($request) {
319
+ $couponId = Mage::getModel('salesrule/coupon')->load($request['coupon_code'], 'code');
320
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_trigger', 1);
321
  if ($request['remove'] == 1) {
322
+ Mage::getSingleton('core/session')->setData('woopra_coupon_code_status',
323
+ Mage::helper('woopra')->getCouponCodeRemoved());
324
  } else {
325
+ Mage::getSingleton('core/session')->setData('woopra_coupon_code_status',
326
+ Mage::helper('woopra')->getCouponCodeAdded());
327
  }
328
+ if ($couponId['coupon_id'] != null) {
329
+ $couponRules = Mage::getModel('salesrule/rule')->load($couponId->getRuleId());
330
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_validity', 'valid');
331
+ Mage::getSingleton('core/session')->setData('woopra_coupon_code_name',
332
+ addslashes($couponRules->getData('name')));
333
+ if ($couponRules->getData('is_active') == 1) {
334
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_active', 'active');
 
335
  } else {
336
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_active', 'inactive');
 
337
  }
338
  } else {
339
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_validity', 'invalid');
340
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_name', '-');
341
  Mage::getSingleton('core/session')->setData('woopra_coupon_code_active', '-');
342
  }
343
+ Mage::getSingleton('core/session')->setData('woopra_coupon_code',
344
+ Mage::helper('core')->escapeHtml(addslashes($request['coupon_code'])));
345
  }
346
  }
347
 
348
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_create' &&
349
+ Mage::helper('woopra')->getCustomerCreateAccount() != NULL) {
350
  Mage::getSingleton('core/session')->setData('woopra_create_account_trigger', 1);
 
351
  }
352
 
353
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'customer_account_createpost' &&
354
+ Mage::helper('woopra')->getCustomerCreateAccount() != NULL) {
355
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
356
  Mage::getSingleton('core/session')->setData('woopra_create_account_success_trigger', 1);
357
  if ($request['is_subscribed'] == 1) {
358
  Mage::getSingleton('core/session')->setData('woopra_subscriber_changed', 1);
359
+ Mage::getSingleton('core/session')->setData('woopra_subscriber_status',
360
+ Mage::helper('woopra')->getNewsletterSubscribed());
361
+ Mage::getSingleton('core/session')->setData('woopra_subscriber_email',
362
+ Mage::helper('core')->escapeHtml(addslashes($request['email'])));
363
  }
 
364
  }
365
 
366
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_estimatePost' &&
367
+ Mage::helper('woopra')->getEstimatePost() != NULL) {
368
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
369
  if ($request) {
370
  $region = Mage::getModel('directory/region')->load($request['region_id']);
371
  Mage::getSingleton('core/session')->setData('woopra_estimate_post_trigger', 1);
372
  Mage::getSingleton('core/session')->setData('woopra_estimate_post_country', $request['country_id']);
373
  Mage::getSingleton('core/session')->setData('woopra_estimate_post_state', $region->getName());
374
+ Mage::getSingleton('core/session')->setData('woopra_estimate_post_zip',
375
+ Mage::helper('core')->escapeHtml($request['estimate_postcode']));
376
  }
377
  }
378
 
379
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'cms_index_noRoute' &&
380
+ Mage::helper('woopra')->getCmsNoRoute() != NULL) {
381
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getOriginalPathInfo();
382
  Mage::getSingleton('core/session')->setData('woopra_cms_noroute_trigger', 1);
383
  if ($request) {
384
  Mage::getSingleton('core/session')->setData('woopra_cms_noroute_path', $request);
 
385
  }
386
  }
387
 
388
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'poll_vote_add' &&
389
+ Mage::helper('woopra')->getPollVote() != NULL) {
390
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
391
  if ($request) {
392
+ $pollTitle = Mage::getModel('poll/poll')->load($request['poll_id'])->getData();
393
+ $pollAnswers = Mage::getResourceModel('poll/poll_answer_collection')
394
+ ->addPollFilter($request['poll_id'])->getData();
395
+ foreach ($pollAnswers as $key => $answer) {
396
  if ($answer['answer_id'] == $request['vote']) {
397
+ $answerTitle = $answer['answer_title'];
398
  }
399
  }
400
  Mage::getSingleton('core/session')->setData('woopra_poll_vote_trigger', 1);
401
+ Mage::getSingleton('core/session')->setData('woopra_poll_vote_title',
402
+ addslashes($pollTitle['poll_title']));
403
+ Mage::getSingleton('core/session')->setData('woopra_poll_vote_answer', addslashes($answerTitle));
404
  }
405
  }
406
 
407
+ if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'sendfriend_product_sendmail' &&
408
+ Mage::helper('woopra')->getProductEmailToFriend() != NULL) {
409
  $request = $observer->getEvent()->getControllerAction()->getRequest()->getParams();
410
  if ($request) {
411
  $product = Mage::getModel('catalog/product')->load($request['id'])->getData();
412
+ Mage::getSingleton('core/session')->setData('woopra_sendfriend_product_name',
413
+ addslashes($product['name']));
414
+ Mage::getSingleton('core/session')->setData('woopra_sendfriend_product_sku',
415
+ addslashes($product['sku']));
416
+ Mage::getSingleton('core/session')->setData('woopra_sendfriend_product_price',
417
+ round($product['price'], 2));
418
  Mage::getSingleton('core/session')->setData('woopra_sendfriend_product_trigger', 1);
 
419
  }
420
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  }
422
  }
 
app/code/community/Woopra/Analytics/etc/config.xml CHANGED
@@ -5,14 +5,14 @@
5
  *
6
  * @package Woopra_Analytics
7
  * @author K3Live for Woopra
8
- * @copyright Copyright (c) 2013 Woopra (http://www.woopra.com/)
9
  * @license Open Software License (OSL 3.0)
10
  */
11
  -->
12
  <config>
13
  <modules>
14
  <Woopra_Analytics>
15
- <version>1.3.0</version>
16
  </Woopra_Analytics>
17
  </modules>
18
  <global>
@@ -65,9 +65,6 @@
65
  <woopra>
66
  <enabled>1</enabled>
67
  <hostname></hostname>
68
- <app_id></app_id>
69
- <secret_key></secret_key>
70
- <!--<schema_update></schema_update>-->
71
  <test>0</test>
72
  </woopra>
73
  <woopra_advanced>
5
  *
6
  * @package Woopra_Analytics
7
  * @author K3Live for Woopra
8
+ * @copyright Copyright (c) 2015 Woopra (http://www.woopra.com/)
9
  * @license Open Software License (OSL 3.0)
10
  */
11
  -->
12
  <config>
13
  <modules>
14
  <Woopra_Analytics>
15
+ <version>1.6.0</version>
16
  </Woopra_Analytics>
17
  </modules>
18
  <global>
65
  <woopra>
66
  <enabled>1</enabled>
67
  <hostname></hostname>
 
 
 
68
  <test>0</test>
69
  </woopra>
70
  <woopra_advanced>
app/code/community/Woopra/Analytics/etc/system.xml CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Woopra_Analytics
7
  * @author K3Live for Woopra
8
- * @copyright Copyright (c) 2013 Woopra (http://www.woopra.com/)
9
  * @license Open Software License (OSL 3.0)
10
  */
11
  -->
@@ -34,7 +34,7 @@
34
  <show_in_store>1</show_in_store>
35
  <expanded>1</expanded>
36
  <fields>
37
- <enabled translate="label">
38
  <label>Enable Module:</label>
39
  <comment>Enable or disable the Woopra module.</comment>
40
  <frontend_type>select</frontend_type>
@@ -53,36 +53,6 @@
53
  <show_in_website>1</show_in_website>
54
  <show_in_store>1</show_in_store>
55
  </hostname>
56
- <!--<app_id translate="label">
57
- <label>Woopra App ID</label>
58
- <comment>Your App ID can be found on woopra.com under My Websites -> Setup -> Access Keys.</comment>
59
- <frontend_type>text</frontend_type>
60
- <validate>validate-alphanum</validate>
61
- <sort_order>30</sort_order>
62
- <show_in_default>1</show_in_default>
63
- <show_in_website>1</show_in_website>
64
- <show_in_store>1</show_in_store>
65
- </app_id>
66
- <secret_key translate="label">
67
- <label>Woopra Secret Key</label>
68
- <comment>Your Secret Key can be found on woopra.com under My Websites -> Setup -> Access Keys.</comment>
69
- <frontend_type>text</frontend_type>
70
- <validate>validate-alphanum</validate>
71
- <sort_order>40</sort_order>
72
- <show_in_default>1</show_in_default>
73
- <show_in_website>1</show_in_website>
74
- <show_in_store>1</show_in_store>
75
- </secret_key>
76
- <schema_update translate="label">
77
- <label>Schema Update</label>
78
- <comment>Run schema update one time after install. Note: Requires App ID and Secret Key.</comment>
79
- <frontend_type>button</frontend_type>
80
- <frontend_model>woopra/button</frontend_model>
81
- <sort_order>50</sort_order>
82
- <show_in_default>1</show_in_default>
83
- <show_in_website>1</show_in_website>
84
- <show_in_store>1</show_in_store>
85
- </schema_update>-->
86
  <test translate="label">
87
  <label>Show Test Alert</label>
88
  <frontend_type>select</frontend_type>
5
  *
6
  * @package Woopra_Analytics
7
  * @author K3Live for Woopra
8
+ * @copyright Copyright (c) 2015 Woopra (http://www.woopra.com/)
9
  * @license Open Software License (OSL 3.0)
10
  */
11
  -->
34
  <show_in_store>1</show_in_store>
35
  <expanded>1</expanded>
36
  <fields>
37
+ <enabled translate="label">
38
  <label>Enable Module:</label>
39
  <comment>Enable or disable the Woopra module.</comment>
40
  <frontend_type>select</frontend_type>
53
  <show_in_website>1</show_in_website>
54
  <show_in_store>1</show_in_store>
55
  </hostname>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  <test translate="label">
57
  <label>Show Test Alert</label>
58
  <frontend_type>select</frontend_type>
app/design/frontend/base/default/layout/woopra.xml CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Woopra_Analytics
7
  * @author K3Live for Woopra
8
- * @copyright Copyright (c) 2013 Woopra (http://www.woopra.com/)
9
  * @license Open Software License (OSL 3.0)
10
  */
11
  -->
5
  *
6
  * @package Woopra_Analytics
7
  * @author K3Live for Woopra
8
+ * @copyright Copyright (c) 2015 Woopra (http://www.woopra.com/)
9
  * @license Open Software License (OSL 3.0)
10
  */
11
  -->
app/design/frontend/base/default/template/woopra/checkout.phtml CHANGED
@@ -4,13 +4,13 @@
4
  *
5
  * @package Woopra_Analytics
6
  * @author K3Live for Woopra
7
- * @copyright Copyright (c) 2013 Woopra (http://www.woopra.com/)
8
  * @license Open Software License (OSL 3.0)
9
  */
10
  ?>
11
  <?php if($this->getSetting('enabled')) { ?>
12
- <!-- Start of Woopra Code -->
13
  <?php if ($this->getSetting('woopra_checkout_trigger') == 1) { ?>
 
14
  <script type="text/javascript">
15
  //<![CDATA[
16
  <?php if(version_compare(Mage::getVersion(), '1.9') > 0) { ?>
@@ -57,6 +57,6 @@ Checkout.prototype.gotoSection = function (section) {
57
  };
58
  //]]>
59
  </script>
60
- <?php } ?>
61
  <!-- End of Woopra Code -->
 
62
  <?php } ?>
4
  *
5
  * @package Woopra_Analytics
6
  * @author K3Live for Woopra
7
+ * @copyright Copyright (c) 2015 Woopra (http://www.woopra.com/)
8
  * @license Open Software License (OSL 3.0)
9
  */
10
  ?>
11
  <?php if($this->getSetting('enabled')) { ?>
 
12
  <?php if ($this->getSetting('woopra_checkout_trigger') == 1) { ?>
13
+ <!-- Start of Woopra Code -->
14
  <script type="text/javascript">
15
  //<![CDATA[
16
  <?php if(version_compare(Mage::getVersion(), '1.9') > 0) { ?>
57
  };
58
  //]]>
59
  </script>
 
60
  <!-- End of Woopra Code -->
61
+ <?php } ?>
62
  <?php } ?>
app/design/frontend/base/default/template/woopra/script.phtml CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @package Woopra_Analytics
6
  * @author K3Live for Woopra
7
- * @copyright Copyright (c) 2013 Woopra (http://www.woopra.com/)
8
  * @license Open Software License (OSL 3.0)
9
  */
10
  ?>
@@ -29,7 +29,7 @@
29
  <?php if ($this->getSetting('outgoing_ignore_subdomain') == 0) { ?> woopra.config('outgoing_ignore_subdomain', false);<?php echo "\n"; } ?>
30
  <?php if ($this->getSetting('hide_campaign') == 1) { ?> woopra.config('hide_campaign', true);<?php echo "\n"; } ?>
31
  <?php if ($this->getSetting('hostname') != NULL) { ?> woopra.config('domain', '<?php echo $this->getSetting('hostname'); ?>');<?php echo "\n"; ?>
32
- <?php } else { ?> woopra.config('domain', '<?php echo $this->getSetting('url'); ?>');<?php echo "\n"; } ?>
33
  <?php if ($this->getSetting('visitor_timeout') != NULL) { ?> woopra.config('idle_timeout', <?php echo $this->getSetting('visitor_timeout') * 60 * 1000; ?>);<?php echo "\n"; ?>
34
  <?php } else { ?> woopra.config('idle_timeout', 1800000);<?php echo "\n"; } ?>
35
  <?php if ($this->getSetting('subdomain') != NULL) { ?> woopra.identify('subdomain', '<?php echo $this->getSetting('subdomain'); ?>');<?php echo "\n"; } ?>
4
  *
5
  * @package Woopra_Analytics
6
  * @author K3Live for Woopra
7
+ * @copyright Copyright (c) 2015 Woopra (http://www.woopra.com/)
8
  * @license Open Software License (OSL 3.0)
9
  */
10
  ?>
29
  <?php if ($this->getSetting('outgoing_ignore_subdomain') == 0) { ?> woopra.config('outgoing_ignore_subdomain', false);<?php echo "\n"; } ?>
30
  <?php if ($this->getSetting('hide_campaign') == 1) { ?> woopra.config('hide_campaign', true);<?php echo "\n"; } ?>
31
  <?php if ($this->getSetting('hostname') != NULL) { ?> woopra.config('domain', '<?php echo $this->getSetting('hostname'); ?>');<?php echo "\n"; ?>
32
+ <?php } else { ?> woopra.config('domain', '');<?php echo "\n"; } ?>
33
  <?php if ($this->getSetting('visitor_timeout') != NULL) { ?> woopra.config('idle_timeout', <?php echo $this->getSetting('visitor_timeout') * 60 * 1000; ?>);<?php echo "\n"; ?>
34
  <?php } else { ?> woopra.config('idle_timeout', 1800000);<?php echo "\n"; } ?>
35
  <?php if ($this->getSetting('subdomain') != NULL) { ?> woopra.identify('subdomain', '<?php echo $this->getSetting('subdomain'); ?>');<?php echo "\n"; } ?>
app/etc/modules/Woopra_Analytics.xml CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Woopra_Analytics
7
  * @author K3Live for Woopra
8
- * @copyright Copyright (c) 2013 Woopra (http://www.woopra.com/)
9
  * @license Open Software License (OSL 3.0)
10
  */
11
  -->
5
  *
6
  * @package Woopra_Analytics
7
  * @author K3Live for Woopra
8
+ * @copyright Copyright (c) 2015 Woopra (http://www.woopra.com/)
9
  * @license Open Software License (OSL 3.0)
10
  */
11
  -->
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Woopra_Analytics_Event_And_Visitor_Tracking</name>
4
- <version>1.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -18,11 +18,11 @@ Access custom reports instantly. No more bugging IT. No old-school interfaces. N
18
  &lt;br /&gt;&#xD;
19
  &lt;a href="http://www.k3live.com/magento-extensions/magento-woopra-tracking"&gt;&lt;img src="http://www.magentocommerce.com/magento-connect/media/catalog/product/w/o/woopra_tracking_5_1_1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&#xD;
20
  Note: This module will not work without a subscription to the &lt;a href="http://www.woopra.com/?woo_campaign=affiliate&amp;woo_medium=referral&amp;woo_source=k3live"&gt;Woopra&lt;/a&gt; service.</description>
21
- <notes>Checkout fix for info blocks in Magento 1.9 and greater</notes>
22
  <authors><author><name>Woopra</name><user>Woopra</user><email>support@woopra.com</email></author><author><name>K3Live</name><user>K3Live</user><email>support@k3live.com</email></author></authors>
23
- <date>2014-12-09</date>
24
- <time>04:29:54</time>
25
- <contents><target name="magecommunity"><dir><dir name="Woopra"><dir name="Analytics"><dir name="Block"><file name="Script.php" hash="112352962ccd5bcf0e567f616888e580"/></dir><dir name="Helper"><file name="Data.php" hash="3b0ba17b1db831f88e6e58aa0c31143e"/></dir><dir name="Model"><file name="Observer.php" hash="717af31124d058b6b4dd00d56d2ce16f"/></dir><dir name="etc"><file name="config.xml" hash="27a46388dccfab8a95f7e8ab1337bc69"/><file name="system.xml" hash="7d3400279dab37ff34ccab127c5d049b"/></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="woopra.xml" hash="3f21344a558babd0d9ea0ed1edc6a87f"/></dir><dir name="template"><dir name="woopra"><file name="script.phtml" hash="e59b67401b4189d70697fa6d1f766288"/><file name="checkout.phtml" hash="f41270457786b0f786c7e164e9f9ed78"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Woopra_Analytics.xml" hash="a4715864833c0024017692871431cb91"/></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Woopra_Analytics_Event_And_Visitor_Tracking</name>
4
+ <version>1.6.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">Open Software License (OSL)</license>
7
  <channel>community</channel>
18
  &lt;br /&gt;&#xD;
19
  &lt;a href="http://www.k3live.com/magento-extensions/magento-woopra-tracking"&gt;&lt;img src="http://www.magentocommerce.com/magento-connect/media/catalog/product/w/o/woopra_tracking_5_1_1.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&#xD;
20
  Note: This module will not work without a subscription to the &lt;a href="http://www.woopra.com/?woo_campaign=affiliate&amp;woo_medium=referral&amp;woo_source=k3live"&gt;Woopra&lt;/a&gt; service.</description>
21
+ <notes>Undefined constant and variable fixes.</notes>
22
  <authors><author><name>Woopra</name><user>Woopra</user><email>support@woopra.com</email></author><author><name>K3Live</name><user>K3Live</user><email>support@k3live.com</email></author></authors>
23
+ <date>2015-04-22</date>
24
+ <time>06:53:00</time>
25
+ <contents><target name="magecommunity"><dir><dir name="Woopra"><dir name="Analytics"><dir name="Block"><file name="Script.php" hash="02c0d45470a447ae4f14e18f4abdc3d4"/></dir><dir name="Helper"><file name="Data.php" hash="de87ef2faeb806905627abb1644be4f6"/></dir><dir name="Model"><file name="Observer.php" hash="1712c8b9ae89c5d9722546c69ddf34f8"/></dir><dir name="etc"><file name="config.xml" hash="8117b57eba07e903586388c74136484e"/><file name="system.xml" hash="cb54ec73ff11b133cc864741f300896c"/></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="woopra.xml" hash="d9dc3de2af23a1991ab7785342086d40"/></dir><dir name="template"><dir name="woopra"><file name="script.phtml" hash="2686a404f8b8e967c200d57fa1dfb55c"/><file name="checkout.phtml" hash="b3d7d026c4cf86f834a2a9d5f1d33f36"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Woopra_Analytics.xml" hash="6f38d8633187db1ba9584af2341380a4"/></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
28
  </package>