Listrak_Remarketing - Version 1.1.7

Version Notes

Improved Shopping Cart Abandonment functionality.
Updated category export to respect display order of categories.
Fixed issue with brand and category on configurable products.

Download this release

Release Info

Developer Magento Core Team
Extension Listrak_Remarketing
Version 1.1.7
Comparing to
See all releases


Code changes from version 1.1.6 to 1.1.7

app/code/community/Listrak/Remarketing/Helper/Data.php CHANGED
@@ -54,6 +54,13 @@ class Listrak_Remarketing_Helper_Data
54
  mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
55
  );
56
  }
 
 
 
 
 
 
 
57
 
58
  public function checkSetupStatus()
59
  {
54
  mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
55
  );
56
  }
57
+
58
+ public function generateAndLogException($exceptionText, $sourceException)
59
+ {
60
+ $ex = new Exception("{UID: " . $this->genUuid() . "} " . $exceptionText, 0, $sourceException);
61
+ Mage::getModel("listrak/log")->addException($ex);
62
+ return $ex;
63
+ }
64
 
65
  public function checkSetupStatus()
66
  {
app/code/community/Listrak/Remarketing/Helper/Product.php CHANGED
@@ -17,7 +17,7 @@ class Listrak_Remarketing_Helper_Product
17
  {
18
  private $_parentsById = array();
19
  private $_attributeSets = null;
20
- private $_categoryNames = array();
21
  private $_baseDir = null;
22
  private $_baseMediaPath = null;
23
  private $_imageModel = null;
@@ -45,7 +45,7 @@ class Listrak_Remarketing_Helper_Product
45
  $result['url_path'] = $product->getUrlPath();
46
  }
47
 
48
- $thumbnailProduct = $smallImageProduct = $imageProduct = $product;
49
  $parentProduct = $this->_getParentProduct($product);
50
  if ($parentProduct != null) {
51
  $result['parent_id'] = $parentProduct->getEntityId();
@@ -81,6 +81,11 @@ class Listrak_Remarketing_Helper_Product
81
  ) {
82
  $thumbnailProduct = $parentProduct;
83
  }
 
 
 
 
 
84
 
85
  if ($includeConfigurableAttributes
86
  && Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE == $parentProduct->getTypeId()
@@ -104,39 +109,29 @@ class Listrak_Remarketing_Helper_Product
104
  $result['thumbnail'] = $this->_getProductImage($thumbnailProduct, 'thumbnail');
105
 
106
  if ($includeBrandAndCategory) {
107
- $setSettings = $this->_getProductAttributeSetSettings($product);
108
 
109
  if ($setSettings['brandAttribute'] != null) {
110
- $result['brand'] = $product->getAttributeText($setSettings['brandAttribute']);
111
  }
112
 
113
  if ($setSettings['catFromMagento']) {
114
  $categoryRootId = Mage::helper('remarketing')->getCategoryRootIdForStore($storeId);
115
- $categories = $this->_getCategoryIds($product, $categoryRootId);
116
  if (array_key_exists('category_id', $categories)) {
117
- $catId = $categories['category_id'];
118
- if (!array_key_exists($catId, $this->_categoryNames)) {
119
- $this->_categoryNames[$catId] = $this->_getCategoryName($catId);
120
- }
121
-
122
- $result['category'] = $this->_categoryNames[$catId];
123
  }
124
  if (array_key_exists('sub_category_id', $categories)) {
125
- $catId = $categories['sub_category_id'];
126
- if (!array_key_exists($catId, $this->_categoryNames)) {
127
- $this->_categoryNames[$catId] = $this->_getCategoryName($catId);
128
- }
129
-
130
- $result['sub_category'] = $this->_categoryNames[$catId];
131
  }
132
  } else {
133
  if ($setSettings['catFromAttributes']) {
134
  if ($setSettings['categoryAttribute'] != null) {
135
- $result['category'] = $product->getAttributeText($setSettings['categoryAttribute']);
136
  }
137
 
138
  if ($setSettings['subcategoryAttribute'] != null) {
139
- $result['sub_category'] = $product->getAttributeText($setSettings['subcategoryAttribute']);
140
  }
141
  }
142
  }
@@ -242,33 +237,108 @@ class Listrak_Remarketing_Helper_Product
242
  $categoryRootId = null)
243
  {
244
  $categories = $product->getCategoryCollection();
 
 
 
 
 
 
 
245
  $final = array();
 
 
 
 
246
 
247
- foreach ($categories as $category) {
 
 
 
 
 
 
 
 
 
248
  $pathIds = $category->getPathIds();
249
- if ($categoryRootId == null || $pathIds[1] == $categoryRootId) {
250
- if (count($pathIds) > 2) {
251
- $final['category_id'] = $pathIds[2];
252
- }
253
- if (count($pathIds) > 3) {
254
- $final['sub_category_id'] = $pathIds[3];
255
- }
256
 
257
- break;
 
 
 
 
 
 
 
 
 
 
 
 
258
  }
259
  }
260
 
261
- return $final;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  }
263
 
264
  private function _getCategoryName($categoryId)
265
  {
266
- $category = Mage::getModel('catalog/category')
267
- ->load($categoryId);
268
-
269
- if ($category != null) {
270
  return $category->getName();
271
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  return null;
273
  }
274
  }
17
  {
18
  private $_parentsById = array();
19
  private $_attributeSets = null;
20
+ private $_categories = array();
21
  private $_baseDir = null;
22
  private $_baseMediaPath = null;
23
  private $_imageModel = null;
45
  $result['url_path'] = $product->getUrlPath();
46
  }
47
 
48
+ $brandAndCategoryProduct = $thumbnailProduct = $smallImageProduct = $imageProduct = $product;
49
  $parentProduct = $this->_getParentProduct($product);
50
  if ($parentProduct != null) {
51
  $result['parent_id'] = $parentProduct->getEntityId();
81
  ) {
82
  $thumbnailProduct = $parentProduct;
83
  }
84
+
85
+ if ($includeBrandAndCategory && !$product->isVisibleInSiteVisibility())
86
+ {
87
+ $brandAndCategoryProduct = $parentProduct;
88
+ }
89
 
90
  if ($includeConfigurableAttributes
91
  && Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE == $parentProduct->getTypeId()
109
  $result['thumbnail'] = $this->_getProductImage($thumbnailProduct, 'thumbnail');
110
 
111
  if ($includeBrandAndCategory) {
112
+ $setSettings = $this->_getProductAttributeSetSettings($brandAndCategoryProduct);
113
 
114
  if ($setSettings['brandAttribute'] != null) {
115
+ $result['brand'] = $brandAndCategoryProduct->getAttributeText($setSettings['brandAttribute']);
116
  }
117
 
118
  if ($setSettings['catFromMagento']) {
119
  $categoryRootId = Mage::helper('remarketing')->getCategoryRootIdForStore($storeId);
120
+ $categories = $this->_getCategoryIds($brandAndCategoryProduct, $categoryRootId);
121
  if (array_key_exists('category_id', $categories)) {
122
+ $result['category'] = $this->_getCategoryName($categories['category_id']);
 
 
 
 
 
123
  }
124
  if (array_key_exists('sub_category_id', $categories)) {
125
+ $result['sub_category'] = $this->_getCategoryName($categories['sub_category_id']);
 
 
 
 
 
126
  }
127
  } else {
128
  if ($setSettings['catFromAttributes']) {
129
  if ($setSettings['categoryAttribute'] != null) {
130
+ $result['category'] = $brandAndCategoryProduct->getAttributeText($setSettings['categoryAttribute']);
131
  }
132
 
133
  if ($setSettings['subcategoryAttribute'] != null) {
134
+ $result['sub_category'] = $brandAndCategoryProduct->getAttributeText($setSettings['subcategoryAttribute']);
135
  }
136
  }
137
  }
237
  $categoryRootId = null)
238
  {
239
  $categories = $product->getCategoryCollection();
240
+
241
+ $lookUnder = array();
242
+ $lookUnder[] = 1;
243
+ if ($categoryRootId != null)
244
+ $lookUnder[] = $categoryRootId;
245
+ $path = $this->_getFirstPathByPosition($categories, 4, $lookUnder);
246
+
247
  $final = array();
248
+ if (sizeof($path) > 2)
249
+ $final['category_id'] = $path[2];
250
+ if (sizeof($path) > 3)
251
+ $final['sub_category_id'] = $path[3];
252
 
253
+ return $final;
254
+ }
255
+
256
+ private function _getFirstPathByPosition($categoryCollection, $maxLevel, $underPath)
257
+ {
258
+ if (sizeof($underPath) >= $maxLevel)
259
+ return $underPath;
260
+
261
+ $nextCategory = array();
262
+ foreach($categoryCollection as $category) {
263
  $pathIds = $category->getPathIds();
 
 
 
 
 
 
 
264
 
265
+ if (sizeof($pathIds) > sizeof($underPath) && !in_array($pathIds[sizeof($underPath)], $nextCategory)) {
266
+ $isUnderPath = true;
267
+ for($i = 0; $i < sizeof($underPath); $i++)
268
+ {
269
+ if ($pathIds[$i] != $underPath[$i])
270
+ {
271
+ $isUnderPath = false;
272
+ break;
273
+ }
274
+ }
275
+
276
+ if ($isUnderPath)
277
+ $nextCategory[] = $pathIds[sizeof($underPath)];
278
  }
279
  }
280
 
281
+ if (sizeof($nextCategory) == 0)
282
+ return $underPath;
283
+
284
+ $winnerPath = array();
285
+ $winnerPathPosition = 0;
286
+ foreach($nextCategory as $category)
287
+ {
288
+ $testPath = $underPath;
289
+ $testPath[] = $category;
290
+
291
+ $testPathPosition = $this->_getCategoryPosition($category);
292
+
293
+ if (sizeof($winnerPath) == 0 || $winnerPathPosition > $testPathPosition)
294
+ {
295
+ $winnerPath = $testPath;
296
+ $winnerPathPosition = $testPathPosition;
297
+ }
298
+ }
299
+
300
+ return $this->_getFirstPathByPosition($categoryCollection, $maxLevel, $winnerPath);
301
  }
302
 
303
  private function _getCategoryName($categoryId)
304
  {
305
+ $category = $this->_getCategory($categoryId);
306
+
307
+ if ($category != null)
308
+ {
309
  return $category->getName();
310
  }
311
+
312
+ return null;
313
+ }
314
+
315
+ private function _getCategoryPosition($categoryId)
316
+ {
317
+ $category = $this->_getCategory($categoryId);
318
+
319
+ if ($category != null)
320
+ {
321
+ return $category->getPosition();
322
+ }
323
+
324
+ return null;
325
+ }
326
+
327
+ private function _getCategory($categoryId)
328
+ {
329
+ if (array_key_exists($categoryId, $this->_categories))
330
+ return $this->_categories[$categoryId];
331
+ else {
332
+ $category = Mage::getModel('catalog/category')
333
+ ->load($categoryId);
334
+
335
+ if ($category != null)
336
+ {
337
+ $this->_categories[$categoryId] = $category;
338
+ return $category;
339
+ }
340
+ }
341
+
342
  return null;
343
  }
344
  }
app/code/community/Listrak/Remarketing/Model/Abandonedcart/Api.php CHANGED
@@ -23,52 +23,61 @@ class Listrak_Remarketing_Model_Abandonedcart_Api
23
  {
24
  Mage::helper('remarketing')->requireCoreEnabled();
25
 
26
- Mage::app()->setCurrentStore($storeId);
 
27
 
28
- if ($startDate === null || !strtotime($startDate)) {
29
- $this->_fault('incorrect_date');
30
- }
31
 
32
- if ($endDate === null || !strtotime($endDate)) {
33
- $this->_fault('incorrect_date');
34
- }
35
 
36
- $storeIdArray = explode(',', $storeId);
37
 
38
- $collection = Mage::getModel('listrak/abandonedcart')
39
- ->getCollection()
40
- ->addFieldToFilter('main_table.updated_at', array('from' => $startDate, 'to' => $endDate))
41
- ->setPageSize($perPage)->setCurPage($page)
42
- ->addStoreFilter($storeIdArray)
43
- ->setOrder('updated_at', 'ASC')
44
- ->distinct(true);
 
45
 
46
- $result = array();
47
 
48
- foreach ($collection as $item) {
49
- $result[] = $item;
50
- }
51
 
52
- return $result;
 
 
 
53
  }
54
 
55
  public function purge($storeId = 1, $endDate = null)
56
  {
57
- if ($endDate === null || !strtotime($endDate)) {
58
- $this->_fault('incorrect_date');
59
- }
 
60
 
61
- $sessions = Mage::getModel("listrak/session")
62
- ->getCollection()
63
- ->addFieldToFilter('updated_at', array('lt' => $endDate));
64
 
65
- $count = 0;
66
 
67
- foreach ($sessions as $session) {
68
- $session->delete();
69
- $count++;
70
- }
71
 
72
- return $count;
 
 
 
73
  }
74
  }
23
  {
24
  Mage::helper('remarketing')->requireCoreEnabled();
25
 
26
+ try {
27
+ Mage::app()->setCurrentStore($storeId);
28
 
29
+ if ($startDate === null || !strtotime($startDate)) {
30
+ $this->_fault('incorrect_date');
31
+ }
32
 
33
+ if ($endDate === null || !strtotime($endDate)) {
34
+ $this->_fault('incorrect_date');
35
+ }
36
 
37
+ $storeIdArray = explode(',', $storeId);
38
 
39
+ $collection = Mage::getModel('listrak/abandonedcart')
40
+ ->getCollection()
41
+ ->addFieldToFilter('main_table.updated_at', array('from' => $startDate, 'to' => $endDate))
42
+ ->addClearCartTrimFilter($startDate)
43
+ ->setPageSize($perPage)->setCurPage($page)
44
+ ->addStoreFilter($storeIdArray)
45
+ ->setOrder('updated_at', 'ASC')
46
+ ->distinct(true);
47
 
48
+ $result = array();
49
 
50
+ foreach ($collection as $item) {
51
+ $result[] = $item;
52
+ }
53
 
54
+ return $result;
55
+ } catch (Exception $e) {
56
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
57
+ }
58
  }
59
 
60
  public function purge($storeId = 1, $endDate = null)
61
  {
62
+ try {
63
+ if ($endDate === null || !strtotime($endDate)) {
64
+ $this->_fault('incorrect_date');
65
+ }
66
 
67
+ $sessions = Mage::getModel("listrak/session")
68
+ ->getCollection()
69
+ ->addFieldToFilter('updated_at', array('lt' => $endDate));
70
 
71
+ $count = 0;
72
 
73
+ foreach ($sessions as $session) {
74
+ $session->delete();
75
+ $count++;
76
+ }
77
 
78
+ return $count;
79
+ } catch (Exception $e) {
80
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
81
+ }
82
  }
83
  }
app/code/community/Listrak/Remarketing/Model/Apiextension/Api.php CHANGED
@@ -23,24 +23,28 @@ class Listrak_Remarketing_Model_Apiextension_Api
23
  {
24
  Mage::helper('remarketing')->requireCoreEnabled();
25
 
26
- Mage::app()->setCurrentStore($storeId);
 
27
 
28
- $collection = Mage::getModel('catalog/product')->getCollection()
29
- ->addStoreFilter($storeId)
30
- ->addAttributeToSelect('*')
31
- ->setPageSize($perPage)
32
- ->setCurPage($page)
33
- ->load();
34
 
35
- Mage::getModel('cataloginventory/stock')->addItemsToProducts($collection);
36
 
37
- $results = array();
38
 
39
- foreach ($collection as $product) {
40
- $results[] = Mage::helper('remarketing/product')->getProductEntity($product, $storeId);
41
- }
42
 
43
- return $results;
 
 
 
44
  }
45
 
46
  public function subscribers($storeId = 1, $startDate = null, $perPage = 50,
@@ -49,62 +53,74 @@ class Listrak_Remarketing_Model_Apiextension_Api
49
  {
50
  Mage::helper('remarketing')->requireCoreEnabled();
51
 
52
- if ($startDate === null || !strtotime($startDate)) {
53
- $this->_fault('incorrect_date');
54
- }
 
55
 
56
- $result = array();
57
 
58
- $collection = Mage::getModel("listrak/apiextension")
59
- ->getResource()
60
- ->subscribers($storeId, $startDate, $perPage, $page);
61
 
62
- foreach ($collection as $item) {
63
- $result[] = $item;
64
- }
65
 
66
- return $result;
 
 
 
67
  }
68
 
69
  public function subscribersPurge($endDate = null)
70
  {
71
- if ($endDate === null || !strtotime($endDate)) {
72
- $this->_fault('incorrect_date');
73
- }
 
74
 
75
- $subscriberupdates = Mage::getModel("listrak/subscriberupdate")
76
- ->getCollection()
77
- ->addFieldToFilter('updated_at', array('lt' => $endDate));
78
 
79
- $count = 0;
80
 
81
- foreach ($subscriberupdates as $subscriberupdate) {
82
- $subscriberupdate->delete();
83
- $count++;
84
- }
85
 
86
- return $count;
 
 
 
87
  }
88
 
89
  public function customers($storeId = 1, $websiteId = 1, $perPage = 50, $page = 1)
90
  {
91
  Mage::helper('remarketing')->requireCoreEnabled();
92
 
93
- Mage::app()->setCurrentStore($storeId);
 
94
 
95
- $collection = Mage::getModel('customer/customer')->getCollection()
96
- ->addFieldToFilter('store_id', $storeId)
97
- ->addAttributeToSelect('*')
98
- ->setPageSize($perPage)
99
- ->setCurPage($page);
100
 
101
- $results = array();
102
 
103
- foreach ($collection as $customer) {
104
- $results[] = $this->_getCustomerArray($customer);
105
- }
106
 
107
- return $results;
 
 
 
108
  }
109
 
110
  private function _getCustomerArray($customer)
@@ -122,37 +138,41 @@ class Listrak_Remarketing_Model_Apiextension_Api
122
  {
123
  Mage::helper('remarketing')->requireCoreEnabled();
124
 
125
- $collection = Mage::getModel("sales/order")->getCollection()
126
- ->addFieldToFilter('store_id', $storeId)
127
- ->addAttributeToSelect('increment_id')
128
- ->addAttributeToSelect('updated_at')
129
- ->addAttributeToSelect('status')
130
- ->addFieldToFilter('updated_at', array('from' => $startDate, 'to' => $endDate))
131
- ->addFieldToFilter('status', array('neq' => 'pending'))
132
- ->setPageSize($perPage)->setCurPage($page)
133
- ->setOrder('updated_at', 'ASC');
134
-
135
- if (is_array($filters)) {
136
- try {
137
- foreach ($filters as $field => $value) {
138
- if (isset($this->_attributesMap['order'][$field])) {
139
- $field = $this->_attributesMap['order'][$field];
 
 
 
 
140
  }
141
-
142
- $collection->addFieldToFilter($field, $value);
143
  }
144
- } catch (Mage_Core_Exception $e) {
145
- $this->_fault('filters_invalid', $e->getMessage());
146
  }
147
- }
148
 
149
- $results = array();
150
 
151
- foreach ($collection as $collectionItem) {
152
- $results[] = $collectionItem;
153
- }
154
 
155
- return $results;
 
 
 
156
  }
157
 
158
  public function orders($storeId = 1, $startDate = null, $endDate = null,
@@ -161,84 +181,88 @@ class Listrak_Remarketing_Model_Apiextension_Api
161
  {
162
  Mage::helper('remarketing')->requireCoreEnabled();
163
 
164
- Mage::app()->setCurrentStore($storeId);
 
165
 
166
- if ($startDate === null || !strtotime($startDate)) {
167
- $this->_fault('incorrect_date');
168
- }
169
-
170
- if ($endDate === null || !strtotime($endDate)) {
171
- $this->_fault('incorrect_date');
172
- }
173
-
174
- $orders = Mage::getModel('sales/order')->getCollection()
175
- ->addFieldToFilter('created_at', array('from' => $startDate, 'to' => $endDate))
176
- ->addFieldToFilter('store_id', $storeId)
177
- ->setPageSize($perPage)->setCurPage($page)
178
- ->setOrder('created_at', 'ASC');
179
-
180
- $results = array();
181
-
182
- foreach ($orders as $order) {
183
- $result = array();
184
- $result['info']['entity_id'] = $order->getEntityId();
185
- $result['info']['order_id'] = $order->getIncrementId();
186
- $result['info']['status'] = $order->getStatus();;
187
- $result['info']['customer_firstname'] = $order->getCustomerFirstname();
188
- $result['info']['customer_lastname'] = $order->getCustomerLastname();
189
- $result['info']['customer_email'] = $order->getCustomerEmail();
190
- $result['info']['subtotal'] = $order->getSubtotal();
191
- $result['info']['tax_amount'] = $order->getTaxAmount();
192
- $result['info']['shipping_amount'] = $order->getShippingAmount();
193
- $result['info']['grand_total'] = $order->getGrandTotal();
194
- $result['info']['billing_firstname'] = $order->getBillingFirstname();
195
- $result['info']['created_at'] = $order->getCreatedAt();
196
- $result['info']['updated_at'] = $order->getUpdatedAt();
197
-
198
- $shipping = $order->getShippingAddress();
199
- if ($shipping) {
200
- $result['shipping_address']['firstname'] = $shipping->getFirstname();
201
- $result['shipping_address']['lastname'] = $shipping->getLastname();
202
- $result['shipping_address']['company'] = $shipping->getCompany();
203
- $result['shipping_address']['street'] = implode(', ', $shipping->getStreet());
204
- $result['shipping_address']['city'] = $shipping->getCity();
205
- $result['shipping_address']['region'] = $shipping->getRegion();
206
- $result['shipping_address']['postcode'] = $shipping->getPostcode();
207
- $result['shipping_address']['country'] = $shipping->getCountry();
208
  }
209
 
210
- $billing = $order->getbillingAddress();
211
- if ($billing) {
212
- $result['billing_address']['firstname'] = $billing->getFirstname();
213
- $result['billing_address']['lastname'] = $billing->getLastname();
214
- $result['billing_address']['company'] = $billing->getCompany();
215
- $result['billing_address']['street'] = implode(', ', $billing->getStreet());
216
- $result['billing_address']['city'] = $billing->getCity();
217
- $result['billing_address']['region'] = $billing->getRegion();
218
- $result['billing_address']['postcode'] = $billing->getPostcode();
219
- $result['billing_address']['country'] = $billing->getCountry();
220
  }
221
 
222
- $result['session'] = Mage::getModel("listrak/session")->load($order->getQuoteId(), 'quote_id');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
 
224
- $result['product'] = array();
225
- foreach ($order->getAllItems() as $item) {
226
- if ($item->getParentItem()) {
227
- continue;
 
 
 
 
 
 
228
  }
229
- $result['product'][] = $this->_getOrderItemProductEntity($item, $storeId);
230
- }
231
- if ($order->getCustomerId()) {
232
- $customer = Mage::getModel("customer/customer")->load($order->getCustomerId());
233
- if ($customer) {
234
- $result['customer'] = $this->_getCustomerArray($customer);
 
 
 
 
 
 
 
 
 
235
  }
 
 
236
  }
237
 
238
- $results[] = $result;
 
 
239
  }
240
-
241
- return $results;
242
  }
243
 
244
  private function _getOrderItemProductEntity($item, $storeId)
@@ -273,52 +297,56 @@ class Listrak_Remarketing_Model_Apiextension_Api
273
 
274
  public function info()
275
  {
276
- $result = array();
277
- $result["magentoVersion"] = Mage::getVersion();
278
- $result["listrakSettings"] = array(
279
- "coreEnabled" => Mage::helper('remarketing')->coreEnabled() ? "true" : "false",
280
- "reviewsApiEnabled" => Mage::helper('remarketing')->reviewsEnabled() ? "true" : "false"
281
- );
282
- $result["ini"] = array();
283
-
284
- $subModel = Mage::getModel("newsletter/subscriber");
285
- $orderModel = Mage::getModel("sales/order");
286
- $productModel = Mage::getModel('catalog/product');
287
-
288
- $result["classes"] = get_class($subModel) . ',' . get_class($orderModel) .
289
- ',' . get_class($orderModel->getCollection()) . ',' .
290
- get_class($productModel) . ',' . get_class($productModel->getCollection());
291
-
292
- $ra = Mage::getSingleton('core/resource')->getConnection('core_read');
293
- $countQueryText = "select count(*) as c from " .
294
- Mage::getModel("listrak/session")->getResource()->getTable("listrak/session");
295
- $numSessions = $ra->fetchRow($countQueryText);
296
- $countQueryText = "select count(*) as c from " .
297
- Mage::getModel("listrak/subscriberupdate")->getResource()->getTable("listrak/subscriber_update");
298
- $numSubUpdates = $ra->fetchRow($countQueryText);
299
- $countQueryText = "select count(*) as c from " .
300
- Mage::getModel("listrak/click")->getResource()->getTable("listrak/click");
301
- $numClicks = $ra->fetchRow($countQueryText);
302
-
303
- $result["counts"] = $numSessions['c'] . ',' . $numSubUpdates['c'] . ',' . $numClicks['c'];
304
-
305
- $result["modules"] = array();
306
- $modules = (array)Mage::getConfig()->getNode('modules')->children();
307
-
308
- foreach ($modules as $key => $value) {
309
- $valueArray = $value->asCanonicalArray();
310
- $active = (isset($valueArray["version"])) ? $valueArray["version"] : '';
311
- $version = (isset($valueArray["active"])) ? $valueArray["active"] : '';
312
- $result["modules"][] = "name=$key, version=" . $version .", isActive=" . $active;
313
- }
 
314
 
315
- $ini = array("session.gc_maxlifetime", "session.cookie_lifetime",
316
- "session.gc_divisor", "session.gc_probability");
317
 
318
- foreach ($ini as $iniParam) {
319
- $result["ini"][] = "$iniParam=" . ini_get($iniParam);
320
- }
321
 
322
- return $result;
 
 
 
323
  }
324
  }
23
  {
24
  Mage::helper('remarketing')->requireCoreEnabled();
25
 
26
+ try {
27
+ Mage::app()->setCurrentStore($storeId);
28
 
29
+ $collection = Mage::getModel('catalog/product')->getCollection()
30
+ ->addStoreFilter($storeId)
31
+ ->addAttributeToSelect('*')
32
+ ->setPageSize($perPage)
33
+ ->setCurPage($page)
34
+ ->load();
35
 
36
+ Mage::getModel('cataloginventory/stock')->addItemsToProducts($collection);
37
 
38
+ $results = array();
39
 
40
+ foreach ($collection as $product) {
41
+ $results[] = Mage::helper('remarketing/product')->getProductEntity($product, $storeId);
42
+ }
43
 
44
+ return $results;
45
+ } catch (Exception $e) {
46
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
47
+ }
48
  }
49
 
50
  public function subscribers($storeId = 1, $startDate = null, $perPage = 50,
53
  {
54
  Mage::helper('remarketing')->requireCoreEnabled();
55
 
56
+ try {
57
+ if ($startDate === null || !strtotime($startDate)) {
58
+ $this->_fault('incorrect_date');
59
+ }
60
 
61
+ $result = array();
62
 
63
+ $collection = Mage::getModel("listrak/apiextension")
64
+ ->getResource()
65
+ ->subscribers($storeId, $startDate, $perPage, $page);
66
 
67
+ foreach ($collection as $item) {
68
+ $result[] = $item;
69
+ }
70
 
71
+ return $result;
72
+ } catch (Exception $e) {
73
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
74
+ }
75
  }
76
 
77
  public function subscribersPurge($endDate = null)
78
  {
79
+ try {
80
+ if ($endDate === null || !strtotime($endDate)) {
81
+ $this->_fault('incorrect_date');
82
+ }
83
 
84
+ $subscriberupdates = Mage::getModel("listrak/subscriberupdate")
85
+ ->getCollection()
86
+ ->addFieldToFilter('updated_at', array('lt' => $endDate));
87
 
88
+ $count = 0;
89
 
90
+ foreach ($subscriberupdates as $subscriberupdate) {
91
+ $subscriberupdate->delete();
92
+ $count++;
93
+ }
94
 
95
+ return $count;
96
+ } catch (Exception $e) {
97
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
98
+ }
99
  }
100
 
101
  public function customers($storeId = 1, $websiteId = 1, $perPage = 50, $page = 1)
102
  {
103
  Mage::helper('remarketing')->requireCoreEnabled();
104
 
105
+ try {
106
+ Mage::app()->setCurrentStore($storeId);
107
 
108
+ $collection = Mage::getModel('customer/customer')->getCollection()
109
+ ->addFieldToFilter('store_id', $storeId)
110
+ ->addAttributeToSelect('*')
111
+ ->setPageSize($perPage)
112
+ ->setCurPage($page);
113
 
114
+ $results = array();
115
 
116
+ foreach ($collection as $customer) {
117
+ $results[] = $this->_getCustomerArray($customer);
118
+ }
119
 
120
+ return $results;
121
+ } catch (Exception $e) {
122
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
123
+ }
124
  }
125
 
126
  private function _getCustomerArray($customer)
138
  {
139
  Mage::helper('remarketing')->requireCoreEnabled();
140
 
141
+ try {
142
+ $collection = Mage::getModel("sales/order")->getCollection()
143
+ ->addFieldToFilter('store_id', $storeId)
144
+ ->addAttributeToSelect('increment_id')
145
+ ->addAttributeToSelect('updated_at')
146
+ ->addAttributeToSelect('status')
147
+ ->addFieldToFilter('updated_at', array('from' => $startDate, 'to' => $endDate))
148
+ ->addFieldToFilter('status', array('neq' => 'pending'))
149
+ ->setPageSize($perPage)->setCurPage($page)
150
+ ->setOrder('updated_at', 'ASC');
151
+
152
+ if (is_array($filters)) {
153
+ try {
154
+ foreach ($filters as $field => $value) {
155
+ if (isset($this->_attributesMap['order'][$field])) {
156
+ $field = $this->_attributesMap['order'][$field];
157
+ }
158
+
159
+ $collection->addFieldToFilter($field, $value);
160
  }
161
+ } catch (Mage_Core_Exception $e) {
162
+ $this->_fault('filters_invalid', $e->getMessage());
163
  }
 
 
164
  }
 
165
 
166
+ $results = array();
167
 
168
+ foreach ($collection as $collectionItem) {
169
+ $results[] = $collectionItem;
170
+ }
171
 
172
+ return $results;
173
+ } catch (Exception $e) {
174
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
175
+ }
176
  }
177
 
178
  public function orders($storeId = 1, $startDate = null, $endDate = null,
181
  {
182
  Mage::helper('remarketing')->requireCoreEnabled();
183
 
184
+ try {
185
+ Mage::app()->setCurrentStore($storeId);
186
 
187
+ if ($startDate === null || !strtotime($startDate)) {
188
+ $this->_fault('incorrect_date');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  }
190
 
191
+ if ($endDate === null || !strtotime($endDate)) {
192
+ $this->_fault('incorrect_date');
 
 
 
 
 
 
 
 
193
  }
194
 
195
+ $orders = Mage::getModel('sales/order')->getCollection()
196
+ ->addFieldToFilter('created_at', array('from' => $startDate, 'to' => $endDate))
197
+ ->addFieldToFilter('store_id', $storeId)
198
+ ->setPageSize($perPage)->setCurPage($page)
199
+ ->setOrder('created_at', 'ASC');
200
+
201
+ $results = array();
202
+
203
+ foreach ($orders as $order) {
204
+ $result = array();
205
+ $result['info']['entity_id'] = $order->getEntityId();
206
+ $result['info']['order_id'] = $order->getIncrementId();
207
+ $result['info']['status'] = $order->getStatus();;
208
+ $result['info']['customer_firstname'] = $order->getCustomerFirstname();
209
+ $result['info']['customer_lastname'] = $order->getCustomerLastname();
210
+ $result['info']['customer_email'] = $order->getCustomerEmail();
211
+ $result['info']['subtotal'] = $order->getSubtotal();
212
+ $result['info']['tax_amount'] = $order->getTaxAmount();
213
+ $result['info']['shipping_amount'] = $order->getShippingAmount();
214
+ $result['info']['grand_total'] = $order->getGrandTotal();
215
+ $result['info']['billing_firstname'] = $order->getBillingFirstname();
216
+ $result['info']['created_at'] = $order->getCreatedAt();
217
+ $result['info']['updated_at'] = $order->getUpdatedAt();
218
+
219
+ $shipping = $order->getShippingAddress();
220
+ if ($shipping) {
221
+ $result['shipping_address']['firstname'] = $shipping->getFirstname();
222
+ $result['shipping_address']['lastname'] = $shipping->getLastname();
223
+ $result['shipping_address']['company'] = $shipping->getCompany();
224
+ $result['shipping_address']['street'] = implode(', ', $shipping->getStreet());
225
+ $result['shipping_address']['city'] = $shipping->getCity();
226
+ $result['shipping_address']['region'] = $shipping->getRegion();
227
+ $result['shipping_address']['postcode'] = $shipping->getPostcode();
228
+ $result['shipping_address']['country'] = $shipping->getCountry();
229
+ }
230
 
231
+ $billing = $order->getbillingAddress();
232
+ if ($billing) {
233
+ $result['billing_address']['firstname'] = $billing->getFirstname();
234
+ $result['billing_address']['lastname'] = $billing->getLastname();
235
+ $result['billing_address']['company'] = $billing->getCompany();
236
+ $result['billing_address']['street'] = implode(', ', $billing->getStreet());
237
+ $result['billing_address']['city'] = $billing->getCity();
238
+ $result['billing_address']['region'] = $billing->getRegion();
239
+ $result['billing_address']['postcode'] = $billing->getPostcode();
240
+ $result['billing_address']['country'] = $billing->getCountry();
241
  }
242
+
243
+ $result['session'] = Mage::getModel("listrak/session")->load($order->getQuoteId(), 'quote_id');
244
+
245
+ $result['product'] = array();
246
+ foreach ($order->getAllItems() as $item) {
247
+ if ($item->getParentItem()) {
248
+ continue;
249
+ }
250
+ $result['product'][] = $this->_getOrderItemProductEntity($item, $storeId);
251
+ }
252
+ if ($order->getCustomerId()) {
253
+ $customer = Mage::getModel("customer/customer")->load($order->getCustomerId());
254
+ if ($customer) {
255
+ $result['customer'] = $this->_getCustomerArray($customer);
256
+ }
257
  }
258
+
259
+ $results[] = $result;
260
  }
261
 
262
+ return $results;
263
+ } catch (Exception $e) {
264
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
265
  }
 
 
266
  }
267
 
268
  private function _getOrderItemProductEntity($item, $storeId)
297
 
298
  public function info()
299
  {
300
+ try {
301
+ $result = array();
302
+ $result["magentoVersion"] = Mage::getVersion();
303
+ $result["listrakSettings"] = array(
304
+ "coreEnabled" => Mage::helper('remarketing')->coreEnabled() ? "true" : "false",
305
+ "reviewsApiEnabled" => Mage::helper('remarketing')->reviewsEnabled() ? "true" : "false"
306
+ );
307
+ $result["ini"] = array();
308
+
309
+ $subModel = Mage::getModel("newsletter/subscriber");
310
+ $orderModel = Mage::getModel("sales/order");
311
+ $productModel = Mage::getModel('catalog/product');
312
+
313
+ $result["classes"] = get_class($subModel) . ',' . get_class($orderModel) .
314
+ ',' . get_class($orderModel->getCollection()) . ',' .
315
+ get_class($productModel) . ',' . get_class($productModel->getCollection());
316
+
317
+ $ra = Mage::getSingleton('core/resource')->getConnection('core_read');
318
+ $countQueryText = "select count(*) as c from " .
319
+ Mage::getModel("listrak/session")->getResource()->getTable("listrak/session");
320
+ $numSessions = $ra->fetchRow($countQueryText);
321
+ $countQueryText = "select count(*) as c from " .
322
+ Mage::getModel("listrak/subscriberupdate")->getResource()->getTable("listrak/subscriber_update");
323
+ $numSubUpdates = $ra->fetchRow($countQueryText);
324
+ $countQueryText = "select count(*) as c from " .
325
+ Mage::getModel("listrak/click")->getResource()->getTable("listrak/click");
326
+ $numClicks = $ra->fetchRow($countQueryText);
327
+
328
+ $result["counts"] = $numSessions['c'] . ',' . $numSubUpdates['c'] . ',' . $numClicks['c'];
329
+
330
+ $result["modules"] = array();
331
+ $modules = (array)Mage::getConfig()->getNode('modules')->children();
332
+
333
+ foreach ($modules as $key => $value) {
334
+ $valueArray = $value->asCanonicalArray();
335
+ $active = (isset($valueArray["version"])) ? $valueArray["version"] : '';
336
+ $version = (isset($valueArray["active"])) ? $valueArray["active"] : '';
337
+ $result["modules"][] = "name=$key, version=" . $version .", isActive=" . $active;
338
+ }
339
 
340
+ $ini = array("session.gc_maxlifetime", "session.cookie_lifetime",
341
+ "session.gc_divisor", "session.gc_probability");
342
 
343
+ foreach ($ini as $iniParam) {
344
+ $result["ini"][] = "$iniParam=" . ini_get($iniParam);
345
+ }
346
 
347
+ return $result;
348
+ } catch (Exception $e) {
349
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
350
+ }
351
  }
352
  }
app/code/community/Listrak/Remarketing/Model/Click/Api.php CHANGED
@@ -22,46 +22,54 @@ class Listrak_Remarketing_Model_Click_Api
22
  {
23
  Mage::helper('remarketing')->requireCoreEnabled();
24
 
25
- if ($startDate === null || !strtotime($startDate)) {
26
- $this->_fault('incorrect_date');
27
- }
 
28
 
29
- if ($endDate === null || !strtotime($endDate)) {
30
- $this->_fault('incorrect_date');
31
- }
32
 
33
- $clicks = Mage::getModel("listrak/click")->getCollection()
34
- ->addFieldToFilter('click_date', array('from' => $startDate, 'to' => $endDate))
35
- ->setPageSize($perPage)->setCurPage($page);
36
 
37
- $clicks->addStoreFilter($storeId);
38
 
39
- $result = array();
40
 
41
- foreach ($clicks as $item) {
42
- $result[] = $item;
43
- }
44
 
45
- return $result;
 
 
 
46
  }
47
 
48
  public function purge($storeId = 1, $endDate = null)
49
  {
50
- if ($endDate === null || !strtotime($endDate)) {
51
- $this->_fault('incorrect_date');
52
- }
 
53
 
54
- $clicks = Mage::getModel("listrak/click")
55
- ->getCollection()
56
- ->addFieldToFilter('click_date', array('lt' => $endDate));
57
 
58
- $count = 0;
59
 
60
- foreach ($clicks as $click) {
61
- $click->delete();
62
- $count++;
63
- }
64
 
65
- return $count;
 
 
 
66
  }
67
  }
22
  {
23
  Mage::helper('remarketing')->requireCoreEnabled();
24
 
25
+ try {
26
+ if ($startDate === null || !strtotime($startDate)) {
27
+ $this->_fault('incorrect_date');
28
+ }
29
 
30
+ if ($endDate === null || !strtotime($endDate)) {
31
+ $this->_fault('incorrect_date');
32
+ }
33
 
34
+ $clicks = Mage::getModel("listrak/click")->getCollection()
35
+ ->addFieldToFilter('click_date', array('from' => $startDate, 'to' => $endDate))
36
+ ->setPageSize($perPage)->setCurPage($page);
37
 
38
+ $clicks->addStoreFilter($storeId);
39
 
40
+ $result = array();
41
 
42
+ foreach ($clicks as $item) {
43
+ $result[] = $item;
44
+ }
45
 
46
+ return $result;
47
+ } catch (Exception $e) {
48
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
49
+ }
50
  }
51
 
52
  public function purge($storeId = 1, $endDate = null)
53
  {
54
+ try {
55
+ if ($endDate === null || !strtotime($endDate)) {
56
+ $this->_fault('incorrect_date');
57
+ }
58
 
59
+ $clicks = Mage::getModel("listrak/click")
60
+ ->getCollection()
61
+ ->addFieldToFilter('click_date', array('lt' => $endDate));
62
 
63
+ $count = 0;
64
 
65
+ foreach ($clicks as $click) {
66
+ $click->delete();
67
+ $count++;
68
+ }
69
 
70
+ return $count;
71
+ } catch (Exception $e) {
72
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
73
+ }
74
  }
75
  }
app/code/community/Listrak/Remarketing/Model/Log/Api.php CHANGED
@@ -20,46 +20,54 @@ class Listrak_Remarketing_Model_Log_Api
20
  $perPage = 50, $page = 1, $logTypeId = 0
21
  )
22
  {
23
- if ($startDate === null || !strtotime($startDate)) {
24
- $this->_fault('incorrect_date');
25
- }
 
26
 
27
- if ($endDate === null || !strtotime($endDate)) {
28
- $this->_fault('incorrect_date');
29
- }
30
 
31
- $logs = Mage::getModel("listrak/log")->getCollection()
32
- ->addFieldToFilter('date_entered', array('from' => $startDate, 'to' => $endDate))
33
- ->setPageSize($perPage)->setCurPage($page)
34
- ->addStoreFilter($storeId);
35
 
36
- $result = array();
37
 
38
- foreach ($logs as $item) {
39
- $result[] = $item;
40
- }
41
 
42
- return $result;
 
 
 
43
  }
44
 
45
  public function purge($storeId = 1, $endDate = null)
46
  {
47
- if ($endDate === null || !strtotime($endDate)) {
48
- $this->_fault('incorrect_date');
49
- }
 
50
 
51
- $logs = Mage::getModel("listrak/log")
52
- ->getCollection()
53
- ->addFieldToFilter('date_entered', array('lt' => $endDate));
54
 
55
- $count = 0;
56
 
57
- foreach ($logs as $log) {
58
- $log->delete();
59
- $count++;
60
- }
61
 
62
- return $count;
 
 
 
63
  }
64
 
65
  public function toggle($storeId = 1, $onOff = true)
20
  $perPage = 50, $page = 1, $logTypeId = 0
21
  )
22
  {
23
+ try {
24
+ if ($startDate === null || !strtotime($startDate)) {
25
+ $this->_fault('incorrect_date');
26
+ }
27
 
28
+ if ($endDate === null || !strtotime($endDate)) {
29
+ $this->_fault('incorrect_date');
30
+ }
31
 
32
+ $logs = Mage::getModel("listrak/log")->getCollection()
33
+ ->addFieldToFilter('date_entered', array('from' => $startDate, 'to' => $endDate))
34
+ ->setPageSize($perPage)->setCurPage($page)
35
+ ->addStoreFilter($storeId);
36
 
37
+ $result = array();
38
 
39
+ foreach ($logs as $item) {
40
+ $result[] = $item;
41
+ }
42
 
43
+ return $result;
44
+ } catch (Exception $e) {
45
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
46
+ }
47
  }
48
 
49
  public function purge($storeId = 1, $endDate = null)
50
  {
51
+ try {
52
+ if ($endDate === null || !strtotime($endDate)) {
53
+ $this->_fault('incorrect_date');
54
+ }
55
 
56
+ $logs = Mage::getModel("listrak/log")
57
+ ->getCollection()
58
+ ->addFieldToFilter('date_entered', array('lt' => $endDate));
59
 
60
+ $count = 0;
61
 
62
+ foreach ($logs as $log) {
63
+ $log->delete();
64
+ $count++;
65
+ }
66
 
67
+ return $count;
68
+ } catch (Exception $e) {
69
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
70
+ }
71
  }
72
 
73
  public function toggle($storeId = 1, $onOff = true)
app/code/community/Listrak/Remarketing/Model/Mysql4/Abandonedcart/Collection.php CHANGED
@@ -32,7 +32,7 @@ class Listrak_Remarketing_Model_Mysql4_Abandonedcart_Collection
32
  'main_table.quote_id = q.entity_id',
33
  array('items_qty', 'grand_total')
34
  )
35
- ->where('q.items_count > 0 AND q.is_active = 1');
36
  }
37
 
38
  public function addStoreFilter($storeIds)
@@ -40,6 +40,13 @@ class Listrak_Remarketing_Model_Mysql4_Abandonedcart_Collection
40
  $this->getSelect()->where('main_table.store_id IN (?)', $storeIds);
41
  return $this;
42
  }
 
 
 
 
 
 
 
43
 
44
  public function setPrepareForReport($prepareForReport)
45
  {
32
  'main_table.quote_id = q.entity_id',
33
  array('items_qty', 'grand_total')
34
  )
35
+ ->where('main_table.had_items = 1 AND q.is_active = 1'); // is_active is set to false when the order is submitted
36
  }
37
 
38
  public function addStoreFilter($storeIds)
40
  $this->getSelect()->where('main_table.store_id IN (?)', $storeIds);
41
  return $this;
42
  }
43
+
44
+ public function addClearCartTrimFilter($fromDate)
45
+ {
46
+ $this->getSelect()
47
+ ->where("q.items_qty > 0 OR main_table.created_at <= '{$fromDate}'");
48
+ return $this;
49
+ }
50
 
51
  public function setPrepareForReport($prepareForReport)
52
  {
app/code/community/Listrak/Remarketing/Model/Mysql4/Apiextension.php CHANGED
@@ -41,7 +41,7 @@ class Listrak_Remarketing_Model_Mysql4_Apiextension
41
  ->join(
42
  array('su' => $collection->getTable('listrak/subscriber_update')),
43
  'main_table.subscriber_id = su.subscriber_id',
44
- array()
45
  )
46
  ->where('su.updated_at > ?', $startDate)
47
  ->distinct();
41
  ->join(
42
  array('su' => $collection->getTable('listrak/subscriber_update')),
43
  'main_table.subscriber_id = su.subscriber_id',
44
+ array('updated_at')
45
  )
46
  ->where('su.updated_at > ?', $startDate)
47
  ->distinct();
app/code/community/Listrak/Remarketing/Model/Review/Update/Api.php CHANGED
@@ -45,38 +45,46 @@ class Listrak_Remarketing_Model_Review_Update_Api
45
  {
46
  Mage::helper('remarketing')->requireReviewsEnabled();
47
 
48
- $getStoreId = is_numeric($storeId) ? $storeId : 1;
49
- $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
50
- $fromReviewId = $startReviewId + 1;
51
-
52
- $collection = Mage::helper('remarketing/review_update')->getReviewListCollection($getStoreId);
53
- $collection
54
- ->getSelect()
55
- ->where("main_table.review_id >= ?", $fromReviewId)
56
- ->reset(Zend_Db_Select::ORDER)
57
- ->order('main_table.review_id ' . Varien_Db_Select::SQL_ASC)
58
- ->limit($getChunkSize);
59
-
60
- return $this->_reviewsFromCollection($getStoreId, $collection);
 
 
 
 
61
  }
62
 
63
  public function reviewUpdateList($storeId, $chunkSize, $startUpdateId)
64
  {
65
  Mage::helper('remarketing')->requireReviewsEnabled();
66
 
67
- $getStoreId = is_numeric($storeId) ? $storeId : 1;
68
- $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
69
- $fromUpdateId = $startUpdateId + 1;
70
-
71
- $collection = Mage::helper('remarketing/review_update')->getReviewListCollection($getStoreId);
72
- $collection
73
- ->getSelect()
74
- ->where("updatetime.update_id >= ?", $fromUpdateId)
75
- ->reset(Zend_Db_Select::ORDER)
76
- ->order('updatetime.update_id ' . Varien_Db_Select::SQL_ASC)
77
- ->limit($getChunkSize);
78
-
79
- return $this->_reviewsFromCollection($getStoreId, $collection);
 
 
 
 
80
  }
81
 
82
  private function _reviewsFromCollection($storeId, $reviewCollection)
@@ -146,36 +154,44 @@ class Listrak_Remarketing_Model_Review_Update_Api
146
  {
147
  Mage::helper('remarketing')->requireReviewsEnabled();
148
 
149
- $getStoreId = is_numeric($storeId) ? $storeId : 1;
150
- $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
151
- $fromRatingSummaryId = $startRatingSummaryId + 1;
152
-
153
- $collection = Mage::helper('remarketing/review_update')->getRatingSummaryListCollection($getStoreId);
154
- $collection->getSelect()
155
- ->where('review_entity_summary.entity_type = ?', 1)
156
- ->where("review_entity_summary.primary_id >= ?", $fromRatingSummaryId)
157
- ->order('review_entity_summary.primary_id ' . Varien_Db_Select::SQL_ASC)
158
- ->limit($getChunkSize);
159
-
160
- return $this->_ratingSummariesFromCollection($getStoreId, $collection);
 
 
 
 
161
  }
162
 
163
  public function ratingSummaryUpdateList($storeId, $chunkSize, $startUpdateId)
164
  {
165
  Mage::helper('remarketing')->requireReviewsEnabled();
166
 
167
- $getStoreId = is_numeric($storeId) ? $storeId : 1;
168
- $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
169
- $fromUpdateId = $startUpdateId + 1;
170
-
171
- $collection = Mage::helper('remarketing/review_update')->getRatingSummaryListCollection($getStoreId);
172
- $collection->getSelect()
173
- ->where('review_entity_summary.entity_type = ?', 1)
174
- ->where("updatetime.update_id >= ?", $fromUpdateId)
175
- ->order('updatetime.update_id ' . Varien_Db_Select::SQL_ASC)
176
- ->limit($getChunkSize);
177
-
178
- return $this->_ratingSummariesFromCollection($getStoreId, $collection);
 
 
 
 
179
  }
180
 
181
  private function _ratingSummariesFromCollection($storeId, $collection)
@@ -223,60 +239,68 @@ class Listrak_Remarketing_Model_Review_Update_Api
223
  {
224
  Mage::helper('remarketing')->requireReviewsEnabled();
225
 
226
- $mageResource = Mage::getSingleton('core/resource');
227
- $dbRead = $mageResource->getConnection('core_read');
 
228
 
229
- $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
230
- $fromDeleteId = $startDeleteId + 1;
231
 
232
- $collection = Mage::getModel('listrak/review_update')
233
- ->getCollection()
234
- ->productReviewsOnly()
235
- ->deletedRowsOnly();
236
 
237
- $allReviewIDs = $dbRead
238
- ->select()
239
- ->from(
240
- array('review' => Mage::getSingleton('core/resource')->getTableName('review/review')),
241
- 'review.review_id'
242
- );
243
 
244
- $collection->getSelect()
245
- ->where('NOT EXISTS (' . $allReviewIDs->where('main_table.review_id = review.review_id') . ')')
246
- ->where("update_id >= ?", $fromDeleteId)
247
- ->limit($getChunkSize);
248
 
249
- $deletedReviews = array();
250
- foreach ($collection as $deletedReview) {
251
- array_push(
252
- $deletedReviews, array(
253
- "delete_id" => $deletedReview->getUpdateId(),
254
- "review_id" => $deletedReview->getReviewId()
255
- )
256
- );
257
- }
258
 
259
- return $deletedReviews;
 
 
 
260
  }
261
 
262
  public function reviewUpdatePurge($purgeBeforeDays)
263
  {
264
- $mageResource = Mage::getSingleton('core/resource');
265
- $dbWrite = $mageResource->getConnection('core_write');
266
-
267
- $doPurgeBeforeDays = is_numeric($purgeBeforeDays) ? $purgeBeforeDays : 30;
268
- $purgeBefore = $doPurgeBeforeDays > 0
269
- ? gmdate('Y-m-d H:i:s', strtotime("-{$doPurgeBeforeDays} days")) : gmdate('Y-m-d H:i:s');
270
-
271
- $rowsDeleted = $dbWrite->delete(
272
- $mageResource->getTableName('listrak/review_update'),
273
- array('activity_time < ?' => $purgeBefore)
274
- );
275
-
276
- return array(
277
- "count" => $rowsDeleted,
278
- "before" => $purgeBefore
279
- );
 
 
 
 
280
  }
281
  }
282
 
45
  {
46
  Mage::helper('remarketing')->requireReviewsEnabled();
47
 
48
+ try {
49
+ $getStoreId = is_numeric($storeId) ? $storeId : 1;
50
+ $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
51
+ $fromReviewId = $startReviewId + 1;
52
+
53
+ $collection = Mage::helper('remarketing/review_update')->getReviewListCollection($getStoreId);
54
+ $collection
55
+ ->getSelect()
56
+ ->where("main_table.review_id >= ?", $fromReviewId)
57
+ ->reset(Zend_Db_Select::ORDER)
58
+ ->order('main_table.review_id ' . Varien_Db_Select::SQL_ASC)
59
+ ->limit($getChunkSize);
60
+
61
+ return $this->_reviewsFromCollection($getStoreId, $collection);
62
+ } catch (Exception $e) {
63
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
64
+ }
65
  }
66
 
67
  public function reviewUpdateList($storeId, $chunkSize, $startUpdateId)
68
  {
69
  Mage::helper('remarketing')->requireReviewsEnabled();
70
 
71
+ try {
72
+ $getStoreId = is_numeric($storeId) ? $storeId : 1;
73
+ $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
74
+ $fromUpdateId = $startUpdateId + 1;
75
+
76
+ $collection = Mage::helper('remarketing/review_update')->getReviewListCollection($getStoreId);
77
+ $collection
78
+ ->getSelect()
79
+ ->where("updatetime.update_id >= ?", $fromUpdateId)
80
+ ->reset(Zend_Db_Select::ORDER)
81
+ ->order('updatetime.update_id ' . Varien_Db_Select::SQL_ASC)
82
+ ->limit($getChunkSize);
83
+
84
+ return $this->_reviewsFromCollection($getStoreId, $collection);
85
+ } catch (Exception $e) {
86
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
87
+ }
88
  }
89
 
90
  private function _reviewsFromCollection($storeId, $reviewCollection)
154
  {
155
  Mage::helper('remarketing')->requireReviewsEnabled();
156
 
157
+ try {
158
+ $getStoreId = is_numeric($storeId) ? $storeId : 1;
159
+ $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
160
+ $fromRatingSummaryId = $startRatingSummaryId + 1;
161
+
162
+ $collection = Mage::helper('remarketing/review_update')->getRatingSummaryListCollection($getStoreId);
163
+ $collection->getSelect()
164
+ ->where('review_entity_summary.entity_type = ?', 1)
165
+ ->where("review_entity_summary.primary_id >= ?", $fromRatingSummaryId)
166
+ ->order('review_entity_summary.primary_id ' . Varien_Db_Select::SQL_ASC)
167
+ ->limit($getChunkSize);
168
+
169
+ return $this->_ratingSummariesFromCollection($getStoreId, $collection);
170
+ } catch (Exception $e) {
171
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
172
+ }
173
  }
174
 
175
  public function ratingSummaryUpdateList($storeId, $chunkSize, $startUpdateId)
176
  {
177
  Mage::helper('remarketing')->requireReviewsEnabled();
178
 
179
+ try {
180
+ $getStoreId = is_numeric($storeId) ? $storeId : 1;
181
+ $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
182
+ $fromUpdateId = $startUpdateId + 1;
183
+
184
+ $collection = Mage::helper('remarketing/review_update')->getRatingSummaryListCollection($getStoreId);
185
+ $collection->getSelect()
186
+ ->where('review_entity_summary.entity_type = ?', 1)
187
+ ->where("updatetime.update_id >= ?", $fromUpdateId)
188
+ ->order('updatetime.update_id ' . Varien_Db_Select::SQL_ASC)
189
+ ->limit($getChunkSize);
190
+
191
+ return $this->_ratingSummariesFromCollection($getStoreId, $collection);
192
+ } catch (Exception $e) {
193
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
194
+ }
195
  }
196
 
197
  private function _ratingSummariesFromCollection($storeId, $collection)
239
  {
240
  Mage::helper('remarketing')->requireReviewsEnabled();
241
 
242
+ try {
243
+ $mageResource = Mage::getSingleton('core/resource');
244
+ $dbRead = $mageResource->getConnection('core_read');
245
 
246
+ $getChunkSize = is_numeric($chunkSize) ? $chunkSize : 50;
247
+ $fromDeleteId = $startDeleteId + 1;
248
 
249
+ $collection = Mage::getModel('listrak/review_update')
250
+ ->getCollection()
251
+ ->productReviewsOnly()
252
+ ->deletedRowsOnly();
253
 
254
+ $allReviewIDs = $dbRead
255
+ ->select()
256
+ ->from(
257
+ array('review' => Mage::getSingleton('core/resource')->getTableName('review/review')),
258
+ 'review.review_id'
259
+ );
260
 
261
+ $collection->getSelect()
262
+ ->where('NOT EXISTS (' . $allReviewIDs->where('main_table.review_id = review.review_id') . ')')
263
+ ->where("update_id >= ?", $fromDeleteId)
264
+ ->limit($getChunkSize);
265
 
266
+ $deletedReviews = array();
267
+ foreach ($collection as $deletedReview) {
268
+ array_push(
269
+ $deletedReviews, array(
270
+ "delete_id" => $deletedReview->getUpdateId(),
271
+ "review_id" => $deletedReview->getReviewId()
272
+ )
273
+ );
274
+ }
275
 
276
+ return $deletedReviews;
277
+ } catch (Exception $e) {
278
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
279
+ }
280
  }
281
 
282
  public function reviewUpdatePurge($purgeBeforeDays)
283
  {
284
+ try {
285
+ $mageResource = Mage::getSingleton('core/resource');
286
+ $dbWrite = $mageResource->getConnection('core_write');
287
+
288
+ $doPurgeBeforeDays = is_numeric($purgeBeforeDays) ? $purgeBeforeDays : 30;
289
+ $purgeBefore = $doPurgeBeforeDays > 0
290
+ ? gmdate('Y-m-d H:i:s', strtotime("-{$doPurgeBeforeDays} days")) : gmdate('Y-m-d H:i:s');
291
+
292
+ $rowsDeleted = $dbWrite->delete(
293
+ $mageResource->getTableName('listrak/review_update'),
294
+ array('activity_time < ?' => $purgeBefore)
295
+ );
296
+
297
+ return array(
298
+ "count" => $rowsDeleted,
299
+ "before" => $purgeBefore
300
+ );
301
+ } catch (Exception $e) {
302
+ throw Mage::helper('remarketing')->generateAndLogException("Exception occurred in API call: " . $e->getMessage(), $e);
303
+ }
304
  }
305
  }
306
 
app/code/community/Listrak/Remarketing/Model/Session.php CHANGED
@@ -26,6 +26,8 @@ class Listrak_Remarketing_Model_Session extends Mage_Core_Model_Abstract
26
  $ltksid = Mage::getModel('core/cookie')->get('ltksid');
27
  $piid = Mage::getModel('core/cookie')->get('personalmerchant');
28
  $custSession = Mage::getSingleton("customer/session");
 
 
29
 
30
  if (!empty($ltksid) && strlen($ltksid) > 37) {
31
  $ltkpk = intval(substr($ltksid, 37), 10);
@@ -42,12 +44,15 @@ class Listrak_Remarketing_Model_Session extends Mage_Core_Model_Abstract
42
  }
43
 
44
  if (!$this->getId()) {
45
- if ($createOnlyIfCartHasItems && Mage::helper('checkout/cart')->getItemsCount() < 1) {
46
  return null;
47
  }
48
  $this->setSessionId(Mage::helper('remarketing')->genUuid());
49
  $this->setCreatedAt(gmdate('Y-m-d H:i:s'));
50
  $this->setIsNew(true);
 
 
 
51
  }
52
 
53
  if ($custSession->isLoggedIn()) {
26
  $ltksid = Mage::getModel('core/cookie')->get('ltksid');
27
  $piid = Mage::getModel('core/cookie')->get('personalmerchant');
28
  $custSession = Mage::getSingleton("customer/session");
29
+
30
+ $cartHasItems = Mage::helper('checkout/cart')->getItemsCount() > 0;
31
 
32
  if (!empty($ltksid) && strlen($ltksid) > 37) {
33
  $ltkpk = intval(substr($ltksid, 37), 10);
44
  }
45
 
46
  if (!$this->getId()) {
47
+ if ($createOnlyIfCartHasItems && !$cartHasItems) {
48
  return null;
49
  }
50
  $this->setSessionId(Mage::helper('remarketing')->genUuid());
51
  $this->setCreatedAt(gmdate('Y-m-d H:i:s'));
52
  $this->setIsNew(true);
53
+ $this->setHadItems($cartHasItems);
54
+ } else {
55
+ $this->setHadItems($this->getHadItems() || $cartHasItems);
56
  }
57
 
58
  if ($custSession->isLoggedIn()) {
app/code/community/Listrak/Remarketing/etc/config.xml CHANGED
@@ -1,13 +1,13 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
- /**
4
- * Listrak Remarketing Magento Extension Ver. 1.0.0 - Copyright (c) 2011 Listrak, Inc.
5
- */
6
  -->
7
  <config>
8
  <modules>
9
  <Listrak_Remarketing>
10
- <version>1.1.6</version>
11
  </Listrak_Remarketing>
12
  </modules>
13
  <frontend>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
+ /**
4
+ * Listrak Remarketing Magento Extension Ver. 1.0.0 - Copyright (c) 2011 Listrak, Inc.
5
+ */
6
  -->
7
  <config>
8
  <modules>
9
  <Listrak_Remarketing>
10
+ <version>1.1.7</version>
11
  </Listrak_Remarketing>
12
  </modules>
13
  <frontend>
app/code/community/Listrak/Remarketing/sql/listrak_remarketing_setup/mysql4-upgrade-1.1.5-1.1.6.php CHANGED
@@ -20,16 +20,5 @@ try {
20
  } catch (Exception $e) {
21
  }
22
 
23
- try {
24
- $client = new Varien_Http_Client("http://magento.listrakbi.com/Install.ashx");
25
- $client->setMethod(Varien_Http_Client::POST);
26
- $client->setParameterPost("Listrak Extension Version", "1.1.6");
27
- $client->setParameterPost("Magento Version", Mage::getVersion());
28
- $client->setParameterPost("Install URL", "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
29
- $client->setParameterPost("IP Address", "$_SERVER[SERVER_ADDR]");
30
- $client->request();
31
- } catch (Exception $e) {
32
- }
33
-
34
  $installer->endSetup();
35
 
20
  } catch (Exception $e) {
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
23
  $installer->endSetup();
24
 
app/code/community/Listrak/Remarketing/sql/listrak_remarketing_setup/mysql4-upgrade-1.1.6-1.1.7.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Listrak Remarketing Magento Extension Ver. 1.1.7
4
+ *
5
+ * PHP version 5
6
+ *
7
+ * @category Listrak
8
+ * @package Listrak_Remarketing
9
+ * @author Listrak Magento Team <magento@listrak.com>
10
+ * @copyright 2013 Listrak Inc
11
+ * @license http://s1.listrakbi.com/licenses/magento.txt License For Customer Use of Listrak Software
12
+ * @link http://www.listrak.com
13
+ */
14
+
15
+ $installer = $this;
16
+ $installer->startSetup();
17
+
18
+ try {
19
+ $installer->run("ALTER TABLE {$this->getTable('listrak/session')} DROP COLUMN `had_items`");
20
+ } catch(Exception $e) {
21
+ }
22
+
23
+ $installer->run("
24
+ ALTER TABLE {$this->getTable('listrak/session')}
25
+ ADD COLUMN `had_items` boolean NOT NULL DEFAULT 0;
26
+
27
+ UPDATE {$this->getTable('listrak/session')} s SET s.`had_items` = 1
28
+ WHERE EXISTS (SELECT * FROM {$this->getTable('sales/quote')} q WHERE s.quote_id = q.entity_id AND q.items_count > 0);
29
+ ");
30
+
31
+ try {
32
+ Mage::getModel("listrak/log")->addMessage("1.1.6-1.1.7 upgrade");
33
+ } catch (Exception $e) {
34
+ }
35
+
36
+ try {
37
+ $client = new Varien_Http_Client("http://magento.listrakbi.com/Install.ashx");
38
+ $client->setMethod(Varien_Http_Client::POST);
39
+ $client->setParameterPost("Listrak Extension Version", "1.1.7");
40
+ $client->setParameterPost("Magento Version", Mage::getVersion());
41
+ $client->setParameterPost("Install URL", "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
42
+ $client->setParameterPost("IP Address", "$_SERVER[SERVER_ADDR]");
43
+ $client->request();
44
+ } catch (Exception $e) {
45
+ }
46
+
47
+ $installer->endSetup();
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Listrak_Remarketing</name>
4
- <version>1.1.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://s1.listrakbi.com/licenses/magento.txt">Listrak EULA</license>
7
  <channel>community</channel>
@@ -46,12 +46,13 @@ To make sure your marketing list is always current, all newsletter subscribers a
46
  &#xD;
47
  &lt;p&gt;&lt;b&gt;About Listrak&lt;/b&gt;&lt;br /&gt;&#xD;
48
  Listrak works with online retailers to maximize marketing ROI by helping them reach optimal engagement with their customers. Our focus is on prompting dialog and interaction through email and mobile marketing to increase customer lifetime value.&lt;/p&gt;</description>
49
- <notes>Updated extension to prevent warnings from appearing in error logs. &#xD;
50
- Additional performance updates throughout the extension.</notes>
 
51
  <authors><author><name>Listrak</name><user>auto-converted</user><email>magento@listrak.com</email></author></authors>
52
- <date>2013-04-30</date>
53
- <time>18:01:57</time>
54
- <contents><target name="magecommunity"><dir name="Listrak"><dir name="Remarketing"><dir name="Block"><dir name="Adminhtml"><dir name="Abandonedcartreport"><file name="Grid.php" hash="40136886343be51aabb16004bae62c0f"/></dir><dir name="Emailcapture"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="03de7fb256e7b7acd1e149e46bc8a75a"/></dir><file name="Form.php" hash="ec3e084666f6625236b888f679ee05ae"/><file name="Tabs.php" hash="5d3f873074ebb7a29d109784c10dbfd3"/></dir><file name="Edit.php" hash="b60f716de292575504649b46224d6d09"/><file name="Grid.php" hash="b904f2c149c904244b34444cae38eb88"/></dir><dir name="Productattributes"><dir name="Edit"><dir name="Tab"><dir name="Form"><file name="Brand.php" hash="74c68b4b8ea1c1e785257aa4bbeaab09"/><file name="Categories.php" hash="529c82cc102872e4f57570c68e0adf87"/></dir></dir><file name="Form.php" hash="56f7c630820641cb8f12d82e91aea1bf"/><file name="Tabs.php" hash="a735bcf5bd86a67fae4efda97f0fa41a"/></dir><dir name="Init"><dir name="Brands"><file name="Form.php" hash="e83a9e79275f50b0cb3df8da597ad4e2"/></dir><file name="Brands.php" hash="8bf63ec8fdda9cf9bc1b3a9e493c62e8"/></dir><file name="Edit.php" hash="e774d47debad3a91ee06695fc4bd2c26"/><file name="Grid.php" hash="a464e4f72f82f61a80510e19c09b98a0"/></dir><file name="Abandonedcartreport.php" hash="ada17a818a8c0f543a4f6c62e817454b"/><file name="Emailcapture.php" hash="fa12181d06b55d08e7534129ecd4f371"/><file name="Notifications.php" hash="d1d5f8c95716290d60583c4c72ada6f4"/><file name="Productattributes.php" hash="3b27f937512e1d2c01e6786cbc8ceb8f"/></dir><file name="Ecjs.php" hash="1c791b6335b8f8874bc12117287a0b97"/><file name="Modal.php" hash="c8657e3cb06c30e932b9b2631e7e198e"/></dir><dir name="Helper"><dir name="Product"><dir name="Attribute"><dir name="Set"><file name="Map.php" hash="74587e809ea245eaab053cab5b4c8ac5"/></dir></dir></dir><dir name="Review"><file name="Update.php" hash="2b43132557868702c9b0826925da428c"/></dir><file name="Data.php" hash="fa290c45ad0700ee0e81647c02916f39"/><file name="Product.php" hash="5c4b99cc95cf26606a34fca4a78e0971"/></dir><dir name="Model"><dir name="Abandonedcart"><dir name="Api"><file name="V2.php" hash="00ffd794e4b681008b648b708cb92150"/></dir><file name="Api.php" hash="d1fad6aae2e7c8bf3c5d7c9d5909b2f4"/></dir><dir name="Apiextension"><dir name="Api"><file name="V2.php" hash="f4c04e0182f109bf142fcdc029314f3c"/></dir><file name="Api.php" hash="0b243df64f3b72b2dc29e33d06aec6c3"/></dir><dir name="Click"><dir name="Api"><file name="V2.php" hash="46247b357cbe65be78625c21f78af51f"/></dir><file name="Api.php" hash="611b5f472b2c4cab744100e3d3af94e1"/></dir><dir name="Log"><dir name="Api"><file name="V2.php" hash="b6c152d27d85b2db1e0ce24b56d38e9f"/></dir><file name="Api.php" hash="5cb2806cb4be6a0e7bd309166e0bd360"/></dir><dir name="Mysql4"><dir name="Abandonedcart"><file name="Collection.php" hash="6ece436112d7c1f03b38d35f0927e35b"/></dir><dir name="Click"><file name="Collection.php" hash="4e426d50bd9039ec6a54d3bcbe56fbb0"/></dir><dir name="Emailcapture"><file name="Collection.php" hash="02be573207405024553d363cd1f51aa0"/></dir><dir name="Log"><file name="Collection.php" hash="9f0597af33ffd65e09ba9fce51f5f0ff"/></dir><dir name="Product"><dir name="Attribute"><dir name="Set"><dir name="Map"><file name="Collection.php" hash="80b7748fec09b135cee605d07e4c62e5"/></dir><file name="Map.php" hash="2e146d91dc174dc9bd8ce96b5fc52483"/></dir></dir></dir><dir name="Review"><dir name="Update"><file name="Collection.php" hash="abbd1594c2ff6218998beaa9411d244f"/></dir><file name="Update.php" hash="19ede3bb0dd78a7f2cac10ae466c1bc0"/></dir><dir name="Session"><file name="Collection.php" hash="93fd53dbdc2a8c5ddb34ea1c0390865b"/></dir><dir name="Subscriberupdate"><file name="Collection.php" hash="a348915e86b7400bdb2f9fb9910f3b45"/></dir><file name="Abandonedcart.php" hash="4b6ee29a824b74fec6810c1aa1c9f62b"/><file name="Apiextension.php" hash="44fb3b8e2131c285362998c5a475e552"/><file name="Click.php" hash="1b4f106a299611574dbfa958dfc96c6c"/><file name="Emailcapture.php" hash="be122a427584d13e6469ddafc01e55bb"/><file name="Log.php" hash="4729dc9fdf2a812a9243c82cf3a0659a"/><file name="Session.php" hash="a7d1ea065a9042d9aab466a981a3554b"/><file name="Subscriberupdate.php" hash="6eb60180f5a84a05c8b1396f649dcd03"/></dir><dir name="Product"><dir name="Attribute"><dir name="Set"><file name="Map.php" hash="44794eb84ab1f1aa1b6b1fd6d2a45ced"/></dir></dir><dir name="Category"><file name="Source.php" hash="49bb519e75521ad4f5273f1a8306fc0a"/></dir><file name="Attributes.php" hash="1d10e1b56d7dfa4726e25888d36f8611"/></dir><dir name="Review"><dir name="Update"><dir name="Api"><file name="V2.php" hash="37a0b841ea0b575526ef04c2c63fc6fe"/></dir><file name="Api.php" hash="9ecd55209db6074a8b0d10ae33ec52a2"/></dir><file name="Update.php" hash="d2bb50a577d4dbd739936e6478e2603b"/></dir><file name="Abandonedcart.php" hash="d731df1be52538c4a08ee3486049430f"/><file name="Apiextension.php" hash="3967cefbb8bb4bffb1c9d6660107fe04"/><file name="Click.php" hash="047b2b5543071a37d8535e067b4a73ba"/><file name="Emailcapture.php" hash="0f733cbfd06586daef5c2f7bb17cb697"/><file name="Log.php" hash="554d1e99cc1c976bfed850c929b122ab"/><file name="Observer.php" hash="494e1f1b9c65a174ec755002faafc01a"/><file name="Session.php" hash="d3746f446275d3913d2b2bf6ad001af7"/><file name="Subscriber.php" hash="eb8b7f41801140579b7f58f63a66c854"/><file name="Subscriberupdate.php" hash="b5d8a6e7e0e2e803f72c8a28bff4b098"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AbandonedcartreportController.php" hash="30190c05d46c027a095fc5b88a4473ba"/><file name="EmailcaptureController.php" hash="8facd1046802dd5a95148c994dea008d"/><file name="ProductattributesController.php" hash="33df5581af7a1d6cb75b4b390d8e412c"/></dir><file name="CartController.php" hash="ce6f10e325a646bcbced8fafaa646418"/><file name="ConfigController.php" hash="e2a8e5c4fa4aec9c9da924fea681f36c"/><file name="EmailController.php" hash="981a5f70785b332cd5d0823fa34254d0"/><file name="TroubleshootingController.php" hash="cf13b1319d5eca6c86e0f0f6c863678f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="bfd29a447658ff83a1df77d305f6c125"/><file name="api.xml" hash="ba5fe70e1084bc7dbdc8ca15b25ed958"/><file name="config.xml" hash="31c59a891f05b6a7a5005a8d89332398"/><file name="system.xml" hash="69fd27ef41d804213e33f7e887e853d8"/><file name="wsdl.xml" hash="8e572ffb0e404da799380f0a096073f2"/><file name="wsi.xml" hash="4b550ffc19dbd05419871f5b9c01d423"/></dir><dir name="sql"><dir name="listrak_remarketing_setup"><file name="mysql4-install-1.0.0.php" hash="97ff43fccf948969c539b0d8618fe77f"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="adcb8ac59dcb86c44aeb4d79a5529e31"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="de98367400f3d5d77b3a4622cb87275d"/><file name="mysql4-upgrade-1.1.0-1.1.1.php" hash="1962c9ca9337a8ab6e97f0bdbc5df088"/><file name="mysql4-upgrade-1.1.3-1.1.4.php" hash="1a3d6deb0a4358f4b2593c54360e1cd8"/><file name="mysql4-upgrade-1.1.4-1.1.5.php" hash="f4f265d29d27d1486a80d1d5f820d441"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="c15c18d9a18cc84da3400a8c74a3c082"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="remarketing.xml" hash="54fa6221639f1c81476306484a842c38"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="remarketing.xml" hash="9c98437a6e02c083407fdf36c3e3d4a1"/></dir><dir name="template"><dir name="listrak"><dir name="remarketing"><dir name="productattributes"><dir name="form"><file name="categories.phtml" hash="b0bde2e0e93b3a0cf6eab3dc8dc5fb2e"/><file name="initbrands.phtml" hash="0350e9f1a41c60872ee070dc97083439"/></dir></dir><file name="productattributes.phtml" hash="01f12416a562f757457f19492e623a29"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Listrak_Remarketing.xml" hash="63082a312f4668561da45ccd445a862b"/></dir></target></contents>
55
  <compatible/>
56
  <dependencies/>
57
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Listrak_Remarketing</name>
4
+ <version>1.1.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://s1.listrakbi.com/licenses/magento.txt">Listrak EULA</license>
7
  <channel>community</channel>
46
  &#xD;
47
  &lt;p&gt;&lt;b&gt;About Listrak&lt;/b&gt;&lt;br /&gt;&#xD;
48
  Listrak works with online retailers to maximize marketing ROI by helping them reach optimal engagement with their customers. Our focus is on prompting dialog and interaction through email and mobile marketing to increase customer lifetime value.&lt;/p&gt;</description>
49
+ <notes>Improved Shopping Cart Abandonment functionality.&#xD;
50
+ Updated category export to respect display order of categories.&#xD;
51
+ Fixed issue with brand and category on configurable products.</notes>
52
  <authors><author><name>Listrak</name><user>auto-converted</user><email>magento@listrak.com</email></author></authors>
53
+ <date>2013-07-08</date>
54
+ <time>15:06:52</time>
55
+ <contents><target name="magecommunity"><dir name="Listrak"><dir name="Remarketing"><dir name="Block"><dir name="Adminhtml"><dir name="Abandonedcartreport"><file name="Grid.php" hash="40136886343be51aabb16004bae62c0f"/></dir><dir name="Emailcapture"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="03de7fb256e7b7acd1e149e46bc8a75a"/></dir><file name="Form.php" hash="ec3e084666f6625236b888f679ee05ae"/><file name="Tabs.php" hash="5d3f873074ebb7a29d109784c10dbfd3"/></dir><file name="Edit.php" hash="b60f716de292575504649b46224d6d09"/><file name="Grid.php" hash="b904f2c149c904244b34444cae38eb88"/></dir><dir name="Productattributes"><dir name="Edit"><dir name="Tab"><dir name="Form"><file name="Brand.php" hash="74c68b4b8ea1c1e785257aa4bbeaab09"/><file name="Categories.php" hash="529c82cc102872e4f57570c68e0adf87"/></dir></dir><file name="Form.php" hash="56f7c630820641cb8f12d82e91aea1bf"/><file name="Tabs.php" hash="a735bcf5bd86a67fae4efda97f0fa41a"/></dir><dir name="Init"><dir name="Brands"><file name="Form.php" hash="e83a9e79275f50b0cb3df8da597ad4e2"/></dir><file name="Brands.php" hash="8bf63ec8fdda9cf9bc1b3a9e493c62e8"/></dir><file name="Edit.php" hash="e774d47debad3a91ee06695fc4bd2c26"/><file name="Grid.php" hash="a464e4f72f82f61a80510e19c09b98a0"/></dir><file name="Abandonedcartreport.php" hash="ada17a818a8c0f543a4f6c62e817454b"/><file name="Emailcapture.php" hash="fa12181d06b55d08e7534129ecd4f371"/><file name="Notifications.php" hash="d1d5f8c95716290d60583c4c72ada6f4"/><file name="Productattributes.php" hash="3b27f937512e1d2c01e6786cbc8ceb8f"/></dir><file name="Ecjs.php" hash="1c791b6335b8f8874bc12117287a0b97"/><file name="Modal.php" hash="c8657e3cb06c30e932b9b2631e7e198e"/></dir><dir name="Helper"><dir name="Product"><dir name="Attribute"><dir name="Set"><file name="Map.php" hash="74587e809ea245eaab053cab5b4c8ac5"/></dir></dir></dir><dir name="Review"><file name="Update.php" hash="2b43132557868702c9b0826925da428c"/></dir><file name="Data.php" hash="d971ca9727576d81e6c177608e6917be"/><file name="Product.php" hash="aef5c144ad44d72282ec7877170e0776"/></dir><dir name="Model"><dir name="Abandonedcart"><dir name="Api"><file name="V2.php" hash="00ffd794e4b681008b648b708cb92150"/></dir><file name="Api.php" hash="2ec68fa06ea7c8f87ad2d32052105785"/></dir><dir name="Apiextension"><dir name="Api"><file name="V2.php" hash="f4c04e0182f109bf142fcdc029314f3c"/></dir><file name="Api.php" hash="9c2b166e417fe41b4689db6d3f03a667"/></dir><dir name="Click"><dir name="Api"><file name="V2.php" hash="46247b357cbe65be78625c21f78af51f"/></dir><file name="Api.php" hash="b05137dab038a4f7466ac60e8980a2c0"/></dir><dir name="Log"><dir name="Api"><file name="V2.php" hash="b6c152d27d85b2db1e0ce24b56d38e9f"/></dir><file name="Api.php" hash="8828beb6ef4a1217aa7c4d476819663c"/></dir><dir name="Mysql4"><dir name="Abandonedcart"><file name="Collection.php" hash="d54243b443d4569b666f26d4af4b6c21"/></dir><dir name="Click"><file name="Collection.php" hash="4e426d50bd9039ec6a54d3bcbe56fbb0"/></dir><dir name="Emailcapture"><file name="Collection.php" hash="02be573207405024553d363cd1f51aa0"/></dir><dir name="Log"><file name="Collection.php" hash="9f0597af33ffd65e09ba9fce51f5f0ff"/></dir><dir name="Product"><dir name="Attribute"><dir name="Set"><dir name="Map"><file name="Collection.php" hash="80b7748fec09b135cee605d07e4c62e5"/></dir><file name="Map.php" hash="2e146d91dc174dc9bd8ce96b5fc52483"/></dir></dir></dir><dir name="Review"><dir name="Update"><file name="Collection.php" hash="abbd1594c2ff6218998beaa9411d244f"/></dir><file name="Update.php" hash="19ede3bb0dd78a7f2cac10ae466c1bc0"/></dir><dir name="Session"><file name="Collection.php" hash="93fd53dbdc2a8c5ddb34ea1c0390865b"/></dir><dir name="Subscriberupdate"><file name="Collection.php" hash="a348915e86b7400bdb2f9fb9910f3b45"/></dir><file name="Abandonedcart.php" hash="4b6ee29a824b74fec6810c1aa1c9f62b"/><file name="Apiextension.php" hash="9f1ebf124573901dd15f6101f3a39074"/><file name="Click.php" hash="1b4f106a299611574dbfa958dfc96c6c"/><file name="Emailcapture.php" hash="be122a427584d13e6469ddafc01e55bb"/><file name="Log.php" hash="4729dc9fdf2a812a9243c82cf3a0659a"/><file name="Session.php" hash="a7d1ea065a9042d9aab466a981a3554b"/><file name="Subscriberupdate.php" hash="6eb60180f5a84a05c8b1396f649dcd03"/></dir><dir name="Product"><dir name="Attribute"><dir name="Set"><file name="Map.php" hash="44794eb84ab1f1aa1b6b1fd6d2a45ced"/></dir></dir><dir name="Category"><file name="Source.php" hash="49bb519e75521ad4f5273f1a8306fc0a"/></dir><file name="Attributes.php" hash="1d10e1b56d7dfa4726e25888d36f8611"/></dir><dir name="Review"><dir name="Update"><dir name="Api"><file name="V2.php" hash="37a0b841ea0b575526ef04c2c63fc6fe"/></dir><file name="Api.php" hash="bc4b6cee7769afe1a64ec29683f5b231"/></dir><file name="Update.php" hash="d2bb50a577d4dbd739936e6478e2603b"/></dir><file name="Abandonedcart.php" hash="d731df1be52538c4a08ee3486049430f"/><file name="Apiextension.php" hash="3967cefbb8bb4bffb1c9d6660107fe04"/><file name="Click.php" hash="047b2b5543071a37d8535e067b4a73ba"/><file name="Emailcapture.php" hash="0f733cbfd06586daef5c2f7bb17cb697"/><file name="Log.php" hash="554d1e99cc1c976bfed850c929b122ab"/><file name="Observer.php" hash="494e1f1b9c65a174ec755002faafc01a"/><file name="Session.php" hash="552a08a2e5291edf68723b98f224de16"/><file name="Subscriber.php" hash="eb8b7f41801140579b7f58f63a66c854"/><file name="Subscriberupdate.php" hash="b5d8a6e7e0e2e803f72c8a28bff4b098"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AbandonedcartreportController.php" hash="30190c05d46c027a095fc5b88a4473ba"/><file name="EmailcaptureController.php" hash="8facd1046802dd5a95148c994dea008d"/><file name="ProductattributesController.php" hash="33df5581af7a1d6cb75b4b390d8e412c"/></dir><file name="CartController.php" hash="ce6f10e325a646bcbced8fafaa646418"/><file name="ConfigController.php" hash="e2a8e5c4fa4aec9c9da924fea681f36c"/><file name="EmailController.php" hash="981a5f70785b332cd5d0823fa34254d0"/><file name="TroubleshootingController.php" hash="cf13b1319d5eca6c86e0f0f6c863678f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="bfd29a447658ff83a1df77d305f6c125"/><file name="api.xml" hash="ba5fe70e1084bc7dbdc8ca15b25ed958"/><file name="config.xml" hash="0e03f12b46f495a881ebd945680e9719"/><file name="system.xml" hash="69fd27ef41d804213e33f7e887e853d8"/><file name="wsdl.xml" hash="8e572ffb0e404da799380f0a096073f2"/><file name="wsi.xml" hash="4b550ffc19dbd05419871f5b9c01d423"/></dir><dir name="sql"><dir name="listrak_remarketing_setup"><file name="mysql4-install-1.0.0.php" hash="97ff43fccf948969c539b0d8618fe77f"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="adcb8ac59dcb86c44aeb4d79a5529e31"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="de98367400f3d5d77b3a4622cb87275d"/><file name="mysql4-upgrade-1.1.0-1.1.1.php" hash="1962c9ca9337a8ab6e97f0bdbc5df088"/><file name="mysql4-upgrade-1.1.3-1.1.4.php" hash="1a3d6deb0a4358f4b2593c54360e1cd8"/><file name="mysql4-upgrade-1.1.4-1.1.5.php" hash="f4f265d29d27d1486a80d1d5f820d441"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="eaa1104f5a74d3c55fdd01c8cef5374f"/><file name="mysql4-upgrade-1.1.6-1.1.7.php" hash="47459387087658a81165446a5119397d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="remarketing.xml" hash="54fa6221639f1c81476306484a842c38"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="remarketing.xml" hash="9c98437a6e02c083407fdf36c3e3d4a1"/></dir><dir name="template"><dir name="listrak"><dir name="remarketing"><dir name="productattributes"><dir name="form"><file name="categories.phtml" hash="b0bde2e0e93b3a0cf6eab3dc8dc5fb2e"/><file name="initbrands.phtml" hash="0350e9f1a41c60872ee070dc97083439"/></dir></dir><file name="productattributes.phtml" hash="01f12416a562f757457f19492e623a29"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Listrak_Remarketing.xml" hash="63082a312f4668561da45ccd445a862b"/></dir></target></contents>
56
  <compatible/>
57
  <dependencies/>
58
  </package>