EmailDirect_Integration - Version 2.0.14

Version Notes

Cron warning fix

Download this release

Release Info

Developer Magento Core Team
Extension EmailDirect_Integration
Version 2.0.14
Comparing to
See all releases


Code changes from version 2.0.13 to 2.0.14

Files changed (24) hide show
  1. app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned.php +14 -14
  2. app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned/Details/Abstract.php +0 -0
  3. app/code/community/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Troubleshooting.php +0 -129
  4. app/code/community/EmailDirect/Integration/Block/Checkout/Subscribe.php +3 -3
  5. app/code/community/EmailDirect/Integration/Helper/Data.php +2 -2
  6. app/code/community/EmailDirect/Integration/Helper/Order.php +142 -142
  7. app/code/community/EmailDirect/Integration/Model/Abandoned.php +5 -5
  8. app/code/community/EmailDirect/Integration/Model/Newsletter/Observer.php +1 -0
  9. app/code/community/EmailDirect/Integration/Model/Observer.php +7 -7
  10. app/code/community/EmailDirect/Integration/Model/Order/Observer.php +316 -316
  11. app/code/community/EmailDirect/Integration/Model/Resource/Setup.php +15 -15
  12. app/code/community/EmailDirect/Integration/Model/Wrapper/Orders.php +92 -74
  13. app/code/community/EmailDirect/Integration/Model/Wrapper/Subscribers.php +125 -115
  14. app/code/community/EmailDirect/Integration/etc/cache.xml +4 -0
  15. app/code/community/EmailDirect/Integration/etc/config.xml +1 -1
  16. app/code/community/EmailDirect/Integration/etc/system.xml +561 -561
  17. app/code/community/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-2.0.0-2.0.14.php +28 -0
  18. app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/trouble.phtml +0 -82
  19. app/design/adminhtml/default/default/template/emaildirect/troubleshooting/view/tab/help.phtml +2 -2
  20. app/design/adminhtml/default/default/template/emaildirect/troubleshooting/view/tab/settings.phtml +16 -16
  21. app/design/adminhtml/default/default/template/emaildirect/troubleshooting/view/tab/submit.phtml +1 -1
  22. app/design/frontend/base/default/layout/emaildirect.xml +9 -12
  23. app/design/frontend/base/default/template/emaildirect/customer/account/lists.phtml +2 -2
  24. package.xml +5 -7
app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned.php CHANGED
@@ -6,23 +6,23 @@ class EmailDirect_Integration_Block_Adminhtml_Abandoned extends Mage_Adminhtml_B
6
  {
7
  $this->_controller = 'adminhtml_abandoned';
8
  $this->_blockGroup = 'emaildirect';
9
-
10
  $status = Mage::helper('emaildirect')->getAbandonedStatus();
11
-
12
  if ($status['enabled'])
13
  {
14
  $this->_headerText = "Abandoned Carts - Cron Last Run: " . Mage::helper('emaildirect')->getCronLastRunHtml();
15
-
16
  $label = 'Run now on all stores';
17
-
18
  if (Mage::app()->isSingleStoreMode())
19
  $label = 'Run now';
20
-
21
  $this->addButton('refresh', array(
22
  'label' => Mage::helper('emaildirect')->__('Refresh'),
23
  'onclick' => 'abandonedGridJsObject.reload();return false;',
24
  ));
25
-
26
  $this->_addButton('run_now', array(
27
  'label' => Mage::helper('emaildirect')->__($label),
28
  'onclick' => 'setLocation(\'' . $this->getUrl('*/*/run') .'\')',
@@ -30,21 +30,21 @@ class EmailDirect_Integration_Block_Adminhtml_Abandoned extends Mage_Adminhtml_B
30
  }
31
  else
32
  $this->_headerText = "Abandoned Carts - <span class='ab_ng'>Disabled</span>";
33
-
34
- $data = Mage::helper('emaildirect')->getCronLastRun();
35
-
36
  if ($data['class'] == 'ab_ng')
37
  Mage::getSingleton('adminhtml/session')->addWarning("There appears to be a problem with your cron settings. Please make sure that cron is running so that Abandoned Carts can be processed.");
38
-
39
  parent::__construct();
40
  $this->_removeButton('add');
41
  }
42
-
43
  public function getStatusHtml()
44
  {
45
  return $this->getChildHtml('abandoned_status');
46
  }
47
-
48
  protected function _prepareLayout()
49
  {
50
  $this->setChild('store_switcher',
@@ -53,7 +53,7 @@ class EmailDirect_Integration_Block_Adminhtml_Abandoned extends Mage_Adminhtml_B
53
  ->setSwitchUrl($this->getUrl('*/*/*', array('store'=>null)))
54
  ->setTemplate('report/store/switcher.phtml')
55
  );
56
-
57
  $this->setChild('abandoned_status',
58
  $this->getLayout()->createBlock('emaildirect/adminhtml_abandoned_status')
59
  ->setTemplate('emaildirect/abandoned/status.phtml')
@@ -61,7 +61,7 @@ class EmailDirect_Integration_Block_Adminhtml_Abandoned extends Mage_Adminhtml_B
61
 
62
  return parent::_prepareLayout();
63
  }
64
-
65
  public function getGridHtml()
66
  {
67
  return $this->getStatusHtml() . parent::getGridHtml();
6
  {
7
  $this->_controller = 'adminhtml_abandoned';
8
  $this->_blockGroup = 'emaildirect';
9
+
10
  $status = Mage::helper('emaildirect')->getAbandonedStatus();
11
+
12
  if ($status['enabled'])
13
  {
14
  $this->_headerText = "Abandoned Carts - Cron Last Run: " . Mage::helper('emaildirect')->getCronLastRunHtml();
15
+
16
  $label = 'Run now on all stores';
17
+
18
  if (Mage::app()->isSingleStoreMode())
19
  $label = 'Run now';
20
+
21
  $this->addButton('refresh', array(
22
  'label' => Mage::helper('emaildirect')->__('Refresh'),
23
  'onclick' => 'abandonedGridJsObject.reload();return false;',
24
  ));
25
+
26
  $this->_addButton('run_now', array(
27
  'label' => Mage::helper('emaildirect')->__($label),
28
  'onclick' => 'setLocation(\'' . $this->getUrl('*/*/run') .'\')',
30
  }
31
  else
32
  $this->_headerText = "Abandoned Carts - <span class='ab_ng'>Disabled</span>";
33
+
34
+ $data = Mage::helper('emaildirect')->getCronLastRun(0,'cron_last_run');
35
+
36
  if ($data['class'] == 'ab_ng')
37
  Mage::getSingleton('adminhtml/session')->addWarning("There appears to be a problem with your cron settings. Please make sure that cron is running so that Abandoned Carts can be processed.");
38
+
39
  parent::__construct();
40
  $this->_removeButton('add');
41
  }
42
+
43
  public function getStatusHtml()
44
  {
45
  return $this->getChildHtml('abandoned_status');
46
  }
47
+
48
  protected function _prepareLayout()
49
  {
50
  $this->setChild('store_switcher',
53
  ->setSwitchUrl($this->getUrl('*/*/*', array('store'=>null)))
54
  ->setTemplate('report/store/switcher.phtml')
55
  );
56
+
57
  $this->setChild('abandoned_status',
58
  $this->getLayout()->createBlock('emaildirect/adminhtml_abandoned_status')
59
  ->setTemplate('emaildirect/abandoned/status.phtml')
61
 
62
  return parent::_prepareLayout();
63
  }
64
+
65
  public function getGridHtml()
66
  {
67
  return $this->getStatusHtml() . parent::getGridHtml();
app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned/Details/Abstract.php DELETED
File without changes
app/code/community/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Troubleshooting.php DELETED
@@ -1,129 +0,0 @@
1
- <?php
2
-
3
- class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Troubleshooting extends Mage_Adminhtml_Block_System_Config_Form_Field
4
- {
5
-
6
- private $_helper = null;
7
-
8
- public function __construct()
9
- {
10
- parent::__construct();
11
- $this->setTemplate('emaildirect/system/config/form/field/trouble.phtml');
12
- $this->_helper = Mage::helper('emaildirect');
13
- }
14
-
15
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
16
- {
17
- $this->setElement($element);
18
- $html = $this->_toHtml();
19
- return $html;
20
- }
21
-
22
- public function getLoggingStatus()
23
- {
24
- return Mage::helper('emaildirect/troubleshooting')->getLoggingStatus();
25
- }
26
-
27
- public function getStartDate()
28
- {
29
- try
30
- {
31
- $date = $this->_helper->troubleConfig('start_date');
32
-
33
- $date = Mage::helper('core')->formatTime($date, 'long', true);
34
-
35
- $minutes = "<br />(" . $this->_helper->timeElapsed2string(strtotime($date)) . " ago)";
36
-
37
- return "{$date} {$minutes}";
38
- }
39
- catch (Exception $e)
40
- {
41
- $this->logException($e);
42
- Mage::logException($e);
43
- return "Unknown/Error";
44
- }
45
- }
46
-
47
- public function getEDirectInfo()
48
- {
49
- $active = $this->_helper->config('active');
50
- $setup = $this->_helper->config('setup');
51
-
52
- $class= 'ab_ok';
53
- $msg = "Enabled";
54
-
55
- if (!$setup)
56
- {
57
- $class = 'ab_ng';
58
- $msg = "Invalid API Key";
59
- }
60
- else if (!$active)
61
- {
62
- $class = 'ab_ng';
63
- $msg = "Disabled";
64
- }
65
-
66
- return "<span class='{$class}'>{$msg}</span>";
67
- }
68
-
69
- public function getAbandonedInfo()
70
- {
71
- $active = $this->_helper->config('active');
72
- $setup = $this->_helper->config('setup');
73
- $sendit = $this->_helper->config('sendabandoned');
74
- $abandoned_setup = $this->_helper->config('abandonedsetup');
75
-
76
- $class= 'ab_ok';
77
- $msg = "Enabled";
78
-
79
- if (!$setup || !$active || !$sendit || !$abandoned_setup)
80
- {
81
- $class = 'ab_ng';
82
- $msg = "Disabled";
83
- }
84
-
85
- return "<span class='{$class}'>{$msg}</span>";
86
- }
87
-
88
- public function getLogInfo()
89
- {
90
- try
91
- {
92
- $helper = $this->_helper;
93
-
94
- $file_size = Mage::helper('emaildirect/troubleshooting')->getLogFileSize();
95
- $formatted_size = $helper->formatSize($file_size);
96
-
97
- $max_size = Mage::helper('emaildirect/troubleshooting')->getMaxLogFileSize();
98
-
99
- if ($file_size > $max_size || $file_size == 0)
100
- $formatted_size = "<span class='log_size_warning'>{$formatted_size}</span>";
101
-
102
- $file_date = Mage::helper('emaildirect/troubleshooting')->getLogFilelastUpdate();
103
-
104
- if ($file_date == "")
105
- $last_update = "";
106
- else
107
- $last_update = "<br />" . Mage::helper('core')->formatTime(date(EmailDirect_Integration_Helper_Data::DATE_FORMAT,$file_date), 'long', true);
108
-
109
- $ago = $helper->timeElapsed2string($file_date);
110
-
111
- if ($ago != "")
112
- $ago = "<br />({$ago} ago.)";
113
-
114
- return Mage::helper('emaildirect/troubleshooting')->getLogFileName() . " ({$formatted_size}){$last_update}{$ago}";
115
- }
116
- catch (Exception $e)
117
- {
118
- $this->logException($e);
119
- Mage::logException($e);
120
- return "Unknown/Error";
121
- }
122
- }
123
-
124
- public function isLoggingEnabled()
125
- {
126
- return Mage::helper('emaildirect/troubleshooting')->isLoggingEnabled();
127
- }
128
-
129
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/EmailDirect/Integration/Block/Checkout/Subscribe.php CHANGED
@@ -8,9 +8,9 @@ class EmailDirect_Integration_Block_Checkout_Subscribe extends Mage_Core_Block_T
8
  ->loadByEmail($this->getQuote()->getCustomerEmail())
9
  ->isSubscribed();
10
 
11
- if (!$this->helper('emaildirect')->canCheckoutSubscribe() || $alreadySubscribed)
12
  return "";
13
-
14
  return parent::_toHtml();
15
  }
16
 
@@ -24,4 +24,4 @@ class EmailDirect_Integration_Block_Checkout_Subscribe extends Mage_Core_Block_T
24
  {
25
  return (int)$this->helper('emaildirect')->config('checkout_subscribe');
26
  }
27
- }
8
  ->loadByEmail($this->getQuote()->getCustomerEmail())
9
  ->isSubscribed();
10
 
11
+ if (!$this->helper('emaildirect')->canCheckoutSubscribe() || $alreadySubscribed)
12
  return "";
13
+
14
  return parent::_toHtml();
15
  }
16
 
24
  {
25
  return (int)$this->helper('emaildirect')->config('checkout_subscribe');
26
  }
27
+ }
app/code/community/EmailDirect/Integration/Helper/Data.php CHANGED
@@ -266,7 +266,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
266
  }
267
  catch (Exception $e)
268
  {
269
- $this->logException($e);
270
  return "Unknown";
271
  }
272
  }
@@ -947,7 +947,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
947
  catch (Exception $e)
948
  {
949
  Mage::logException($e);
950
- $this->logException($e);
951
  $this->_logger->resetLogLevel();
952
  return $data;
953
  }
266
  }
267
  catch (Exception $e)
268
  {
269
+ $this->_logger->logException($e);
270
  return "Unknown";
271
  }
272
  }
947
  catch (Exception $e)
948
  {
949
  Mage::logException($e);
950
+ $this->_logger->logException($e);
951
  $this->_logger->resetLogLevel();
952
  return $data;
953
  }
app/code/community/EmailDirect/Integration/Helper/Order.php CHANGED
@@ -14,49 +14,49 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
14
  return $tracknum->getData();
15
  }
16
  }
17
-
18
  return null;
19
  }
20
-
21
  public function getTrackingMergeVars($track, $order)
22
  {
23
  $this->_logger->log('getTrackingMergeVars Start');
24
-
25
  $merge_vars = array();
26
  $maps = unserialize($this->config('shipping_fields', $order->getStoreId()));
27
-
28
  if (!$maps)
29
  return null;
30
-
31
  $this->_logger->log($maps, "Maps");
32
-
33
  $this->_logger->log($track->getData(), "Tracking Data");
34
-
35
  $this->processMap($merge_vars, $maps, $track);
36
-
37
  return $merge_vars;
38
  }
39
 
40
  protected function getShippingData($order)
41
  {
42
  $data = array();
43
-
44
  $data['shipping_code'] = $order->getData('shipping_method');
45
  $data['shipping_description'] = $order->getData('shipping_description');
46
-
47
  $track_data = $this->getTrackingData($order);
48
-
49
  if ($track_data != null)
50
  {
51
  $data['carrier_code'] = $track_data['carrier_code'];
52
  $data['title'] = $track_data['title'];
53
  $data['number'] = $track_data['number'];
54
  }
55
-
56
  $shipping_data = new Varien_Object();
57
-
58
  $shipping_data->setData($data);
59
-
60
  return $shipping_data;
61
  }
62
 
@@ -64,14 +64,14 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
64
  {
65
  $this->_logger->logAndDebug('getOrderMergeVars (Tracking Data)');
66
  $maps = unserialize( $this->config('shipping_fields', $order->getStoreId()) );
67
-
68
  if ($maps)
69
  {
70
  $this->_logger->log($maps, "Maps");
71
  $shipping_data = $this->getShippingData($order);
72
-
73
  $this->_logger->log($shipping_data,'Shipping Data');
74
-
75
  $this->processMap($merge_vars, $maps, $shipping_data);
76
  }
77
  else
@@ -79,22 +79,22 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
79
 
80
  return $merge_vars;
81
  }
82
-
83
  public function getOrderCustomer($order)
84
  {
85
  $customer = null;
86
-
87
  if ($order->getData('customer_is_guest'))
88
  {
89
  $this->_logger->log("Guest Customer");
90
-
91
  $customer = new Varien_Object;
92
-
93
  $customer->setData('email',$order->getCustomerEmail());
94
  $customer->setData('firstname',$order->getData('customer_firstname'));
95
  $customer->setData('lastname',$order->getData('customer_lastname'));
96
  $customer->setData('store_id',$order->getStoreId());
97
-
98
  $customer->setBillingAddress($order->getBillingAddress());
99
  }
100
  else
@@ -103,16 +103,16 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
103
  $address = Mage::getModel('customer/address')->load($customer->getDefaultBilling());
104
  $customer->setBillingAddress($address);
105
  }
106
-
107
  return $customer;
108
  }
109
-
110
  public function processOrderItems($order, &$merge_vars)
111
  {
112
  $this->debugHeader("processOrderItems Start",1);
113
-
114
  $merge_vars = $this->getOrderMergeVars($merge_vars,$order);
115
-
116
  $this->_logger->logAndDebug("Check Save Lastest");
117
  if ($this->config('save_latest_order'))
118
  {
@@ -120,39 +120,39 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
120
  $merge_vars['LastOrderNumber'] = $order->getIncrementId();
121
  $merge_vars['LastPurchaseDate'] = $order->getData('created_at');
122
  $merge_vars['LastPurchaseTotal'] = Mage::helper('core')->currency($order->getData('total_paid'), true, false);
123
-
124
  $merge_vars = $this->getMergeOrderItems($order, $merge_vars);
125
  $merge_vars = $this->getRelatedOrderItems($order, $merge_vars);
126
  $this->_logger->logAndDebug("Finish Save Latest");
127
  }
128
  else
129
  $this->_logger->logAndDebug("Not setup to send latest order info");
130
-
131
  return $merge_vars;
132
  }
133
-
134
  protected function getParentOptions($parent_product,$product_id)
135
  {
136
  $parent_options = $this->getConfigurableOptions($parent_product,$product_id);
137
-
138
  if (count($parent_options) == 0)
139
  return "";
140
-
141
  $options = "";
142
-
143
  foreach ($parent_options as $key => $value)
144
  {
145
  if ($options == "")
146
  $options .= "#";
147
  else
148
  $options .= "&";
149
-
150
  $options .= "{$key}={$value}";
151
  }
152
-
153
  return $options;
154
  }
155
-
156
  protected function getGroupedPrice($grouped_product)
157
  {
158
  $min = 0;
@@ -161,13 +161,13 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
161
  {
162
  if ($min == 0)
163
  $min = $product->getPrice();
164
-
165
  $min = min($min, $product->getPrice());
166
  }
167
-
168
  return $min;
169
  }
170
-
171
  protected function getProductImage($product, $parent_product = null)
172
  {
173
  try
@@ -186,10 +186,10 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
186
  Mage::logException($e);
187
  $this->_logger->logException($e);
188
  }
189
-
190
  return $image;
191
  }
192
-
193
  private function addMergeItem($item_data, $pos, $merge_vars, $prefix = "")
194
  {
195
  $name = "";
@@ -201,18 +201,18 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
201
  $description = "";
202
  $parent_item = null;
203
  $parent_product = null;
204
-
205
  $this->debug("--------------------------");
206
  $this->debug("ADDING MERGE ITEM");
207
-
208
  if ($item_data != null)
209
  {
210
  $product_id = 0;
211
-
212
  if (is_array($item_data))
213
  {
214
  $item = $item_data['item'];
215
-
216
  if (isset($item_data['parent']))
217
  {
218
  $parent_item = $item_data['parent'];
@@ -222,16 +222,16 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
222
  }
223
  else
224
  $item = $item_data;
225
-
226
  $this->debug("Item:");
227
  $this->debug($item);
228
-
229
  if (is_string($item))
230
  {
231
  $product_id = $item;
232
-
233
  $product = Mage::getModel('catalog/product')->load($product_id);
234
-
235
  if ($product == null || !$product->getId())
236
  return $merge_vars;
237
  }
@@ -241,33 +241,33 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
241
  if ($product == null)
242
  return $merge_vars; // Can't get product so abort
243
  }
244
-
245
  $this->debug("Product:");
246
  $this->debug($product);
247
-
248
  if ($parent_item != null)
249
  {
250
  $parent_product = $this->getProduct($parent_item);
251
  if ($parent_product == null)
252
  return $merge_vars; // Can't get product so abort
253
-
254
  $this->debug("Parent Product:");
255
  $this->debug($parent_product);
256
-
257
  $parent_name = $parent_product->getName();
258
  $url = $parent_product->getProductUrl();
259
-
260
  if ($parent_product->getTypeId() == 'configurable')
261
  $url .= $this->getParentOptions($parent_product,$product_id);
262
  }
263
  else
264
  $url = $product->getProductUrl();
265
-
266
  $name = $product->getName();
267
  $sku = $product->getSku();
268
-
269
  $image = $this->getProductImage($product, $parent_product);
270
-
271
  if (is_string($item))
272
  {
273
  $this->debug('String Item');
@@ -283,22 +283,22 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
283
  else
284
  $cost = $item->getPrice();
285
  }
286
-
287
  $cost = Mage::helper('core')->currency($cost,true,false);
288
  $description = $product->getShortDescription();
289
  }
290
-
291
  $merge_vars["{$prefix}ProductName{$pos}"] = $name;
292
  if ($prefix != 'Related')
293
  $merge_vars["{$prefix}ParentName{$pos}"] = $parent_name;
294
-
295
  $merge_vars["{$prefix}SKU{$pos}"] = $sku;
296
  $merge_vars["{$prefix}URL{$pos}"] = $url;
297
  $merge_vars["{$prefix}Image{$pos}"] = $image;
298
-
299
  $merge_vars["{$prefix}Cost{$pos}"] = $cost;
300
  $merge_vars["{$prefix}Description{$pos}"] = $description;
301
-
302
  return $merge_vars;
303
  }
304
 
@@ -310,23 +310,23 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
310
  ->getCollection()
311
  ->addFieldToFilter('product_id', array('in' => $id_list))
312
  ;
313
-
314
  $this->debug("Collection SQL");
315
  $this->debug($collection->getSelect()->__toString());
316
-
317
  // Filter out grouped products from the related list
318
  if ($grouped_id_list != null && count($grouped_id_list) > 0)
319
  {
320
  $this->debug("Merging Grouped ID's to filter");
321
  $id_list = array_merge($id_list,$grouped_id_list);
322
-
323
  }
324
-
325
  $this->debug("ID Filters");
326
  $this->debug($id_list);
327
-
328
  $product_ids = array();
329
-
330
  // If any of the related products are already in the order we filter them out
331
  foreach ($collection as $rp)
332
  {
@@ -343,21 +343,21 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
343
  else
344
  $this->debug("Related product already in order");
345
  }
346
-
347
  $this->debug("Product IDs");
348
  $this->debug($product_ids);
349
-
350
  $related = Mage::getResourceModel('catalog/product_collection')
351
  ->addFieldToFilter('entity_id', array('in' => $product_ids))
352
  ->setPageSize($max_count);
353
-
354
  Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($related);
355
-
356
  $this->debug("Related SQL");
357
  $this->debug($related->getSelect()->__toString());
358
-
359
  $related_list = array();
360
-
361
  if (count($related) > 0)
362
  {
363
  foreach ($related as $rp)
@@ -365,7 +365,7 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
365
  $related_list[] = $rp;
366
  }
367
  }
368
-
369
  return $related_list;
370
  }
371
 
@@ -374,8 +374,8 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
374
  $id_list = array();
375
  $grouped_id_list = array();
376
  $filter_id_list = array();
377
-
378
- foreach ($quote->getAllItems() as $item)
379
  {
380
  $this->debug("");
381
  $this->debug("----------------------------------------------------------");
@@ -383,18 +383,18 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
383
  $this->debug("Item ID: {$item->getId()}");
384
  $this->debug("Item Sku: {$item->getSku()}");
385
  $this->debug("Item Type: {$type}");
386
-
387
  // if it is a grouped product get the parent ID and add it to the list (if not already added)
388
  if ($type == 'grouped')
389
  {
390
  $grouped_product_id = $this->getGroupedProductId($item);
391
-
392
  $this->debug("Grouped Product ID: {$grouped_product_id}");
393
-
394
  if (!in_array($grouped_product_id, $grouped_id_list))
395
  $grouped_id_list[] = $grouped_product_id;
396
  }
397
-
398
  if ($product = $this->getProduct($item))
399
  {
400
  $product_id = $product->getId();
@@ -402,41 +402,41 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
402
  $id_list[] = $product_id;
403
  }
404
  }
405
-
406
  $this->debug("ID List");
407
  $this->debug($id_list);
408
  $this->debug("Grouped ID List");
409
  $this->debug($grouped_id_list);
410
-
411
  $max_count = $this->config('related_fields');
412
-
413
  $this->debug("Max Related: {$max_count}");
414
-
415
  $this->debug("");
416
  $this->debug("--------------------------------------------------------------------------");
417
  $this->debug("Get Related Collection (Non Grouped)");
418
  $this->debug("");
419
-
420
  $related = $this->getRelatedCollection($id_list, $max_count, $grouped_id_list);
421
-
422
  $this->debug("");
423
  $this->debug("# of Related Products Found: " . count($related));
424
-
425
  if (count($related) < $max_count && count($grouped_id_list) > 0)
426
  {
427
  $this->debug("");
428
  $this->debug("--------------------------------------------------------------------------");
429
  $this->debug("Get Related Collection (Grouped)");
430
  $this->debug("");
431
-
432
  // get grouped related
433
  $grouped_related = $this->getRelatedCollection($grouped_id_list, $max_count - count($related), $id_list);
434
-
435
  // Merge the collections
436
  if (count($grouped_related) > 0)
437
  return array_merge($related, $grouped_related);
438
  }
439
-
440
  return $related;
441
  }
442
 
@@ -444,41 +444,41 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
444
  {
445
  $prefix = "Related";
446
  $max_count = $this->config('related_fields');
447
-
448
  $this->debug('');
449
  $this->debug('Getting Related Products');
450
-
451
  $related_products = $this->getRelatedProducts($quote);
452
-
453
  $count = 0;
454
 
455
  foreach ($related_products as $rp)
456
  {
457
  $count++;
458
-
459
  if ($count > $max_count)
460
  break;
461
-
462
  $merge_vars = $this->addMergeItem($rp->getId(), $count, $merge_vars, $prefix);
463
  }
464
-
465
  while ($count < $max_count)
466
  {
467
  $count++;
468
  $merge_vars = $this->addMergeItem(null, $count, $merge_vars, $prefix);
469
  }
470
-
471
  return $merge_vars;
472
  }
473
-
474
  protected function getGroupedProductId($item)
475
  {
476
  $this->debug('Get Grouped Product Id');
477
  $options = $item->getProductOptions();
478
-
479
  $this->debug('Product Options');
480
  $this->debug($options);
481
-
482
  if (isset($options['super_product_config']))
483
  {
484
  $this->debug('Super config found');
@@ -486,7 +486,7 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
486
  {
487
  $this->debug('Product Id Found');
488
  $product_id = $options['super_product_config']['product_id'];
489
-
490
  return $product_id;
491
  }
492
  $this->debug('Product Id Not Found!');
@@ -502,57 +502,57 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
502
  return $option->getProductId();
503
  }
504
  }
505
-
506
  $this->debug('Unable to get Grouped Product ID');
507
-
508
  return false;
509
  }
510
-
511
  protected function getGroupedProduct($item)
512
  {
513
  $this->debug('Get Grouped Product');
514
  $product_id = $this->getGroupedProductId($item);
515
-
516
  if ($product_id !== false)
517
  {
518
  $this->debug('Loading Product');
519
  $product = Mage::getModel('catalog/product')->load($product_id);
520
-
521
  if ($product->getId())
522
  {
523
  $this->debug('Grouped Product Found!');
524
  return $product;
525
  }
526
  }
527
-
528
  $this->debug('Unable to get Grouped Product');
529
-
530
  return false;
531
  }
532
-
533
  protected function isItemVisible($item)
534
  {
535
  $vis_flag = Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE;
536
-
537
  if ($item == null)
538
  return true;
539
-
540
  $product = $this->getProduct($item);
541
-
542
  if ($product == null)
543
  return true;
544
-
545
  if ($product->getVisibility() != $vis_flag)
546
  return true;
547
-
548
  return false;
549
  }
550
-
551
  protected function processParentItems($quote)
552
  {
553
  $this->debug("Processing Parent Items");
554
  $parent_items = array();
555
-
556
  foreach ($quote->getAllItems() as $item)
557
  {
558
  $this->debug("");
@@ -567,11 +567,11 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
567
  $this->debug('*** Adding as Parent Item ***');
568
  $parent_items[$item->getId()] = $item;
569
  }
570
-
571
  if ($type == "grouped")
572
  {
573
  $grouped_product = $this->getGroupedProduct($item);
574
-
575
  if ($grouped_product)
576
  {
577
  $this->debug('*** Adding Grouped Product to Parent Items ***');
@@ -581,13 +581,13 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
581
  }
582
  }
583
  }
584
-
585
  $this->debug('Parent Items Found: ' . count($parent_items));
586
-
587
  if (count($parent_items) > 0)
588
  {
589
  $this->debug('Parent Items:');
590
-
591
  foreach($parent_items as $key => $item)
592
  {
593
  $this->debug('-------------------------');
@@ -604,58 +604,58 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
604
  }
605
  }
606
  }
607
-
608
  return $parent_items;
609
  }
610
-
611
  public function getMergeOrderItems($quote, $merge_vars, $prefix = "")
612
  {
613
  $max_count = $this->config('product_fields');
614
-
615
  $count = 0;
616
-
617
  $item_data = array();
618
-
619
  $parent_items = $this->processParentItems($quote);
620
-
621
  $this->debug('');
622
  $this->debug('Processing Order Items');
623
-
624
  foreach ($quote->getAllItems() as $item)
625
  {
626
  $type = $item->getProductType();
627
-
628
  $this->debug('');
629
  $this->debug("----------------------------------------------------------");
630
  $this->debug('Item Sku: ' . $item->getSku());
631
  $this->debug('Item Type: ' . $type);
632
-
633
  if ($type == "configurable" || $type == "bundle")
634
  {
635
  $this->debug('Skipping Configurable and Bundle Products (this is a parent product)');
636
  continue;
637
  }
638
-
639
  $item_id = $item->getId();
640
-
641
  if ($item->getProductType() == 'grouped')
642
  {
643
  $this->debug('Grouped Product');
644
-
645
  $parent_id = $item->getId();
646
  }
647
  else
648
  {
649
  $parent_id = $item->getParentItemId();
650
  }
651
-
652
  $this->debug("Parent Id: {$parent_id}");
653
-
654
  if ($parent_id != null && isset($parent_items[$parent_id]))
655
  {
656
  $this->debug('Item has a Parent');
657
  $parent_item = $parent_items[$parent_id];
658
-
659
  $this->debug('Checking Visibility of Item and Parent (only one needs to be visible)');
660
  if ($this->isItemVisible($item) || $this->isItemVisible($parent_item))
661
  {
@@ -677,24 +677,24 @@ class EmailDirect_Integration_Helper_Order extends EmailDirect_Integration_Helpe
677
  $this->debug('Visibility check failed');
678
  }
679
  }
680
-
681
- foreach ($item_data as $item)
682
  {
683
  $count++;
684
-
685
  if ($count > $max_count)
686
  break;
687
-
688
  $merge_vars = $this->addMergeItem($item, $count, $merge_vars, $prefix);
689
  }
690
-
691
  // Blank out other items
692
  while ($count < $max_count)
693
  {
694
  $count++;
695
  $merge_vars = $this->addMergeItem(null, $count, $merge_vars, $prefix);
696
  }
697
-
698
  return $merge_vars;
699
  }
700
  }
14
  return $tracknum->getData();
15
  }
16
  }
17
+
18
  return null;
19
  }
20
+
21
  public function getTrackingMergeVars($track, $order)
22
  {
23
  $this->_logger->log('getTrackingMergeVars Start');
24
+
25
  $merge_vars = array();
26
  $maps = unserialize($this->config('shipping_fields', $order->getStoreId()));
27
+
28
  if (!$maps)
29
  return null;
30
+
31
  $this->_logger->log($maps, "Maps");
32
+
33
  $this->_logger->log($track->getData(), "Tracking Data");
34
+
35
  $this->processMap($merge_vars, $maps, $track);
36
+
37
  return $merge_vars;
38
  }
39
 
40
  protected function getShippingData($order)
41
  {
42
  $data = array();
43
+
44
  $data['shipping_code'] = $order->getData('shipping_method');
45
  $data['shipping_description'] = $order->getData('shipping_description');
46
+
47
  $track_data = $this->getTrackingData($order);
48
+
49
  if ($track_data != null)
50
  {
51
  $data['carrier_code'] = $track_data['carrier_code'];
52
  $data['title'] = $track_data['title'];
53
  $data['number'] = $track_data['number'];
54
  }
55
+
56
  $shipping_data = new Varien_Object();
57
+
58
  $shipping_data->setData($data);
59
+
60
  return $shipping_data;
61
  }
62
 
64
  {
65
  $this->_logger->logAndDebug('getOrderMergeVars (Tracking Data)');
66
  $maps = unserialize( $this->config('shipping_fields', $order->getStoreId()) );
67
+
68
  if ($maps)
69
  {
70
  $this->_logger->log($maps, "Maps");
71
  $shipping_data = $this->getShippingData($order);
72
+
73
  $this->_logger->log($shipping_data,'Shipping Data');
74
+
75
  $this->processMap($merge_vars, $maps, $shipping_data);
76
  }
77
  else
79
 
80
  return $merge_vars;
81
  }
82
+
83
  public function getOrderCustomer($order)
84
  {
85
  $customer = null;
86
+
87
  if ($order->getData('customer_is_guest'))
88
  {
89
  $this->_logger->log("Guest Customer");
90
+
91
  $customer = new Varien_Object;
92
+
93
  $customer->setData('email',$order->getCustomerEmail());
94
  $customer->setData('firstname',$order->getData('customer_firstname'));
95
  $customer->setData('lastname',$order->getData('customer_lastname'));
96
  $customer->setData('store_id',$order->getStoreId());
97
+
98
  $customer->setBillingAddress($order->getBillingAddress());
99
  }
100
  else
103
  $address = Mage::getModel('customer/address')->load($customer->getDefaultBilling());
104
  $customer->setBillingAddress($address);
105
  }
106
+
107
  return $customer;
108
  }
109
+
110
  public function processOrderItems($order, &$merge_vars)
111
  {
112
  $this->debugHeader("processOrderItems Start",1);
113
+
114
  $merge_vars = $this->getOrderMergeVars($merge_vars,$order);
115
+
116
  $this->_logger->logAndDebug("Check Save Lastest");
117
  if ($this->config('save_latest_order'))
118
  {
120
  $merge_vars['LastOrderNumber'] = $order->getIncrementId();
121
  $merge_vars['LastPurchaseDate'] = $order->getData('created_at');
122
  $merge_vars['LastPurchaseTotal'] = Mage::helper('core')->currency($order->getData('total_paid'), true, false);
123
+
124
  $merge_vars = $this->getMergeOrderItems($order, $merge_vars);
125
  $merge_vars = $this->getRelatedOrderItems($order, $merge_vars);
126
  $this->_logger->logAndDebug("Finish Save Latest");
127
  }
128
  else
129
  $this->_logger->logAndDebug("Not setup to send latest order info");
130
+
131
  return $merge_vars;
132
  }
133
+
134
  protected function getParentOptions($parent_product,$product_id)
135
  {
136
  $parent_options = $this->getConfigurableOptions($parent_product,$product_id);
137
+
138
  if (count($parent_options) == 0)
139
  return "";
140
+
141
  $options = "";
142
+
143
  foreach ($parent_options as $key => $value)
144
  {
145
  if ($options == "")
146
  $options .= "#";
147
  else
148
  $options .= "&";
149
+
150
  $options .= "{$key}={$value}";
151
  }
152
+
153
  return $options;
154
  }
155
+
156
  protected function getGroupedPrice($grouped_product)
157
  {
158
  $min = 0;
161
  {
162
  if ($min == 0)
163
  $min = $product->getPrice();
164
+
165
  $min = min($min, $product->getPrice());
166
  }
167
+
168
  return $min;
169
  }
170
+
171
  protected function getProductImage($product, $parent_product = null)
172
  {
173
  try
186
  Mage::logException($e);
187
  $this->_logger->logException($e);
188
  }
189
+
190
  return $image;
191
  }
192
+
193
  private function addMergeItem($item_data, $pos, $merge_vars, $prefix = "")
194
  {
195
  $name = "";
201
  $description = "";
202
  $parent_item = null;
203
  $parent_product = null;
204
+
205
  $this->debug("--------------------------");
206
  $this->debug("ADDING MERGE ITEM");
207
+
208
  if ($item_data != null)
209
  {
210
  $product_id = 0;
211
+
212
  if (is_array($item_data))
213
  {
214
  $item = $item_data['item'];
215
+
216
  if (isset($item_data['parent']))
217
  {
218
  $parent_item = $item_data['parent'];
222
  }
223
  else
224
  $item = $item_data;
225
+
226
  $this->debug("Item:");
227
  $this->debug($item);
228
+
229
  if (is_string($item))
230
  {
231
  $product_id = $item;
232
+
233
  $product = Mage::getModel('catalog/product')->load($product_id);
234
+
235
  if ($product == null || !$product->getId())
236
  return $merge_vars;
237
  }
241
  if ($product == null)
242
  return $merge_vars; // Can't get product so abort
243
  }
244
+
245
  $this->debug("Product:");
246
  $this->debug($product);
247
+
248
  if ($parent_item != null)
249
  {
250
  $parent_product = $this->getProduct($parent_item);
251
  if ($parent_product == null)
252
  return $merge_vars; // Can't get product so abort
253
+
254
  $this->debug("Parent Product:");
255
  $this->debug($parent_product);
256
+
257
  $parent_name = $parent_product->getName();
258
  $url = $parent_product->getProductUrl();
259
+
260
  if ($parent_product->getTypeId() == 'configurable')
261
  $url .= $this->getParentOptions($parent_product,$product_id);
262
  }
263
  else
264
  $url = $product->getProductUrl();
265
+
266
  $name = $product->getName();
267
  $sku = $product->getSku();
268
+
269
  $image = $this->getProductImage($product, $parent_product);
270
+
271
  if (is_string($item))
272
  {
273
  $this->debug('String Item');
283
  else
284
  $cost = $item->getPrice();
285
  }
286
+
287
  $cost = Mage::helper('core')->currency($cost,true,false);
288
  $description = $product->getShortDescription();
289
  }
290
+
291
  $merge_vars["{$prefix}ProductName{$pos}"] = $name;
292
  if ($prefix != 'Related')
293
  $merge_vars["{$prefix}ParentName{$pos}"] = $parent_name;
294
+
295
  $merge_vars["{$prefix}SKU{$pos}"] = $sku;
296
  $merge_vars["{$prefix}URL{$pos}"] = $url;
297
  $merge_vars["{$prefix}Image{$pos}"] = $image;
298
+
299
  $merge_vars["{$prefix}Cost{$pos}"] = $cost;
300
  $merge_vars["{$prefix}Description{$pos}"] = $description;
301
+
302
  return $merge_vars;
303
  }
304
 
310
  ->getCollection()
311
  ->addFieldToFilter('product_id', array('in' => $id_list))
312
  ;
313
+
314
  $this->debug("Collection SQL");
315
  $this->debug($collection->getSelect()->__toString());
316
+
317
  // Filter out grouped products from the related list
318
  if ($grouped_id_list != null && count($grouped_id_list) > 0)
319
  {
320
  $this->debug("Merging Grouped ID's to filter");
321
  $id_list = array_merge($id_list,$grouped_id_list);
322
+
323
  }
324
+
325
  $this->debug("ID Filters");
326
  $this->debug($id_list);
327
+
328
  $product_ids = array();
329
+
330
  // If any of the related products are already in the order we filter them out
331
  foreach ($collection as $rp)
332
  {
343
  else
344
  $this->debug("Related product already in order");
345
  }
346
+
347
  $this->debug("Product IDs");
348
  $this->debug($product_ids);
349
+
350
  $related = Mage::getResourceModel('catalog/product_collection')
351
  ->addFieldToFilter('entity_id', array('in' => $product_ids))
352
  ->setPageSize($max_count);
353
+
354
  Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($related);
355
+
356
  $this->debug("Related SQL");
357
  $this->debug($related->getSelect()->__toString());
358
+
359
  $related_list = array();
360
+
361
  if (count($related) > 0)
362
  {
363
  foreach ($related as $rp)
365
  $related_list[] = $rp;
366
  }
367
  }
368
+
369
  return $related_list;
370
  }
371
 
374
  $id_list = array();
375
  $grouped_id_list = array();
376
  $filter_id_list = array();
377
+
378
+ foreach ($quote->getAllItems() as $item)
379
  {
380
  $this->debug("");
381
  $this->debug("----------------------------------------------------------");
383
  $this->debug("Item ID: {$item->getId()}");
384
  $this->debug("Item Sku: {$item->getSku()}");
385
  $this->debug("Item Type: {$type}");
386
+
387
  // if it is a grouped product get the parent ID and add it to the list (if not already added)
388
  if ($type == 'grouped')
389
  {
390
  $grouped_product_id = $this->getGroupedProductId($item);
391
+
392
  $this->debug("Grouped Product ID: {$grouped_product_id}");
393
+
394
  if (!in_array($grouped_product_id, $grouped_id_list))
395
  $grouped_id_list[] = $grouped_product_id;
396
  }
397
+
398
  if ($product = $this->getProduct($item))
399
  {
400
  $product_id = $product->getId();
402
  $id_list[] = $product_id;
403
  }
404
  }
405
+
406
  $this->debug("ID List");
407
  $this->debug($id_list);
408
  $this->debug("Grouped ID List");
409
  $this->debug($grouped_id_list);
410
+
411
  $max_count = $this->config('related_fields');
412
+
413
  $this->debug("Max Related: {$max_count}");
414
+
415
  $this->debug("");
416
  $this->debug("--------------------------------------------------------------------------");
417
  $this->debug("Get Related Collection (Non Grouped)");
418
  $this->debug("");
419
+
420
  $related = $this->getRelatedCollection($id_list, $max_count, $grouped_id_list);
421
+
422
  $this->debug("");
423
  $this->debug("# of Related Products Found: " . count($related));
424
+
425
  if (count($related) < $max_count && count($grouped_id_list) > 0)
426
  {
427
  $this->debug("");
428
  $this->debug("--------------------------------------------------------------------------");
429
  $this->debug("Get Related Collection (Grouped)");
430
  $this->debug("");
431
+
432
  // get grouped related
433
  $grouped_related = $this->getRelatedCollection($grouped_id_list, $max_count - count($related), $id_list);
434
+
435
  // Merge the collections
436
  if (count($grouped_related) > 0)
437
  return array_merge($related, $grouped_related);
438
  }
439
+
440
  return $related;
441
  }
442
 
444
  {
445
  $prefix = "Related";
446
  $max_count = $this->config('related_fields');
447
+
448
  $this->debug('');
449
  $this->debug('Getting Related Products');
450
+
451
  $related_products = $this->getRelatedProducts($quote);
452
+
453
  $count = 0;
454
 
455
  foreach ($related_products as $rp)
456
  {
457
  $count++;
458
+
459
  if ($count > $max_count)
460
  break;
461
+
462
  $merge_vars = $this->addMergeItem($rp->getId(), $count, $merge_vars, $prefix);
463
  }
464
+
465
  while ($count < $max_count)
466
  {
467
  $count++;
468
  $merge_vars = $this->addMergeItem(null, $count, $merge_vars, $prefix);
469
  }
470
+
471
  return $merge_vars;
472
  }
473
+
474
  protected function getGroupedProductId($item)
475
  {
476
  $this->debug('Get Grouped Product Id');
477
  $options = $item->getProductOptions();
478
+
479
  $this->debug('Product Options');
480
  $this->debug($options);
481
+
482
  if (isset($options['super_product_config']))
483
  {
484
  $this->debug('Super config found');
486
  {
487
  $this->debug('Product Id Found');
488
  $product_id = $options['super_product_config']['product_id'];
489
+
490
  return $product_id;
491
  }
492
  $this->debug('Product Id Not Found!');
502
  return $option->getProductId();
503
  }
504
  }
505
+
506
  $this->debug('Unable to get Grouped Product ID');
507
+
508
  return false;
509
  }
510
+
511
  protected function getGroupedProduct($item)
512
  {
513
  $this->debug('Get Grouped Product');
514
  $product_id = $this->getGroupedProductId($item);
515
+
516
  if ($product_id !== false)
517
  {
518
  $this->debug('Loading Product');
519
  $product = Mage::getModel('catalog/product')->load($product_id);
520
+
521
  if ($product->getId())
522
  {
523
  $this->debug('Grouped Product Found!');
524
  return $product;
525
  }
526
  }
527
+
528
  $this->debug('Unable to get Grouped Product');
529
+
530
  return false;
531
  }
532
+
533
  protected function isItemVisible($item)
534
  {
535
  $vis_flag = Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE;
536
+
537
  if ($item == null)
538
  return true;
539
+
540
  $product = $this->getProduct($item);
541
+
542
  if ($product == null)
543
  return true;
544
+
545
  if ($product->getVisibility() != $vis_flag)
546
  return true;
547
+
548
  return false;
549
  }
550
+
551
  protected function processParentItems($quote)
552
  {
553
  $this->debug("Processing Parent Items");
554
  $parent_items = array();
555
+
556
  foreach ($quote->getAllItems() as $item)
557
  {
558
  $this->debug("");
567
  $this->debug('*** Adding as Parent Item ***');
568
  $parent_items[$item->getId()] = $item;
569
  }
570
+
571
  if ($type == "grouped")
572
  {
573
  $grouped_product = $this->getGroupedProduct($item);
574
+
575
  if ($grouped_product)
576
  {
577
  $this->debug('*** Adding Grouped Product to Parent Items ***');
581
  }
582
  }
583
  }
584
+
585
  $this->debug('Parent Items Found: ' . count($parent_items));
586
+
587
  if (count($parent_items) > 0)
588
  {
589
  $this->debug('Parent Items:');
590
+
591
  foreach($parent_items as $key => $item)
592
  {
593
  $this->debug('-------------------------');
604
  }
605
  }
606
  }
607
+
608
  return $parent_items;
609
  }
610
+
611
  public function getMergeOrderItems($quote, $merge_vars, $prefix = "")
612
  {
613
  $max_count = $this->config('product_fields');
614
+
615
  $count = 0;
616
+
617
  $item_data = array();
618
+
619
  $parent_items = $this->processParentItems($quote);
620
+
621
  $this->debug('');
622
  $this->debug('Processing Order Items');
623
+
624
  foreach ($quote->getAllItems() as $item)
625
  {
626
  $type = $item->getProductType();
627
+
628
  $this->debug('');
629
  $this->debug("----------------------------------------------------------");
630
  $this->debug('Item Sku: ' . $item->getSku());
631
  $this->debug('Item Type: ' . $type);
632
+
633
  if ($type == "configurable" || $type == "bundle")
634
  {
635
  $this->debug('Skipping Configurable and Bundle Products (this is a parent product)');
636
  continue;
637
  }
638
+
639
  $item_id = $item->getId();
640
+
641
  if ($item->getProductType() == 'grouped')
642
  {
643
  $this->debug('Grouped Product');
644
+
645
  $parent_id = $item->getId();
646
  }
647
  else
648
  {
649
  $parent_id = $item->getParentItemId();
650
  }
651
+
652
  $this->debug("Parent Id: {$parent_id}");
653
+
654
  if ($parent_id != null && isset($parent_items[$parent_id]))
655
  {
656
  $this->debug('Item has a Parent');
657
  $parent_item = $parent_items[$parent_id];
658
+
659
  $this->debug('Checking Visibility of Item and Parent (only one needs to be visible)');
660
  if ($this->isItemVisible($item) || $this->isItemVisible($parent_item))
661
  {
677
  $this->debug('Visibility check failed');
678
  }
679
  }
680
+
681
+ foreach ($item_data as $item)
682
  {
683
  $count++;
684
+
685
  if ($count > $max_count)
686
  break;
687
+
688
  $merge_vars = $this->addMergeItem($item, $count, $merge_vars, $prefix);
689
  }
690
+
691
  // Blank out other items
692
  while ($count < $max_count)
693
  {
694
  $count++;
695
  $merge_vars = $this->addMergeItem(null, $count, $merge_vars, $prefix);
696
  }
697
+
698
  return $merge_vars;
699
  }
700
  }
app/code/community/EmailDirect/Integration/Model/Abandoned.php CHANGED
@@ -14,19 +14,19 @@ class EmailDirect_Integration_Model_Abandoned extends Mage_Core_Model_Abstract
14
  $this->addData($data);
15
  else
16
  return false;
17
-
18
  return $this;
19
  }
20
-
21
  public function init(EmailDirect_Integration_Model_Session $session)
22
  {
23
  try
24
  {
25
  $quote_id = Mage::helper('checkout/cart')->getQuote()->getId();
26
-
27
  if (!$quote_id)
28
  return;
29
-
30
  if (!$this->loadByQuoteId($quote_id))
31
  {
32
  $this->setQuoteId($quote_id);
@@ -36,7 +36,7 @@ class EmailDirect_Integration_Model_Abandoned extends Mage_Core_Model_Abstract
36
  }
37
  catch (Exception $e)
38
  {
39
- Mage::helper('emaildirect')->logException($e);
40
  Mage::logException($e);
41
  }
42
  return $this;
14
  $this->addData($data);
15
  else
16
  return false;
17
+
18
  return $this;
19
  }
20
+
21
  public function init(EmailDirect_Integration_Model_Session $session)
22
  {
23
  try
24
  {
25
  $quote_id = Mage::helper('checkout/cart')->getQuote()->getId();
26
+
27
  if (!$quote_id)
28
  return;
29
+
30
  if (!$this->loadByQuoteId($quote_id))
31
  {
32
  $this->setQuoteId($quote_id);
36
  }
37
  catch (Exception $e)
38
  {
39
+ Mage::helper('emaildirect/troubleshooting')->logException($e);
40
  Mage::logException($e);
41
  }
42
  return $this;
app/code/community/EmailDirect/Integration/Model/Newsletter/Observer.php CHANGED
@@ -19,6 +19,7 @@ class EmailDirect_Integration_Model_Newsletter_Observer extends EmailDirect_Inte
19
  }
20
 
21
  $subscriber = $observer->getEvent()->getSubscriber();
 
22
  $subscriber->setImportMode(false);
23
 
24
  $email = $subscriber->getSubscriberEmail();
19
  }
20
 
21
  $subscriber = $observer->getEvent()->getSubscriber();
22
+
23
  $subscriber->setImportMode(false);
24
 
25
  $email = $subscriber->getSubscriberEmail();
app/code/community/EmailDirect/Integration/Model/Observer.php CHANGED
@@ -4,7 +4,7 @@ class EmailDirect_Integration_Model_Observer extends EmailDirect_Integration_Mod
4
  {
5
  //--------------------------------------------------------------------------------------------------
6
  // WISHLIST
7
-
8
  public function onWishlistProductAddAfter(Varien_Event_Observer $observer)
9
  {
10
  try
@@ -12,22 +12,22 @@ class EmailDirect_Integration_Model_Observer extends EmailDirect_Integration_Mod
12
  $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::WISHLIST);
13
  //$this->_helper->setLogLevel(EmailDirect_Integration_Helper_Troubleshooting::LOG_LEVEL_LOW);
14
  $this->_log('onWishlistProductAddAfter Start');
15
-
16
  if (!$this->_helper->canSendWishlist())
17
  {
18
  $this->_logReason($this->_helper->getWishlistDisabledReason());
19
  return;
20
  }
21
-
22
  $customer = Mage::getSingleton('customer/session')->getCustomer();
23
-
24
  $merge_vars = array(
25
  'WishListUrl' => Mage::getUrl('wishlist'),
26
  'WishListDate' => Mage::getModel('core/date')->date($this->_date_format)
27
  );
28
-
29
  $rc = Mage::getSingleton('emaildirect/wrapper_wishlist')->sendWishlist($customer->getEmail(), $merge_vars);
30
-
31
  $this->_log('onWishlistProductAddAfter End');
32
  }
33
  catch (Exception $e)
@@ -36,7 +36,7 @@ class EmailDirect_Integration_Model_Observer extends EmailDirect_Integration_Mod
36
  $this->_logException($e);
37
  }
38
  }
39
-
40
  // WISHLIST END
41
  //--------------------------------------------------------------------------------------------------
42
  }
4
  {
5
  //--------------------------------------------------------------------------------------------------
6
  // WISHLIST
7
+
8
  public function onWishlistProductAddAfter(Varien_Event_Observer $observer)
9
  {
10
  try
12
  $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::WISHLIST);
13
  //$this->_helper->setLogLevel(EmailDirect_Integration_Helper_Troubleshooting::LOG_LEVEL_LOW);
14
  $this->_log('onWishlistProductAddAfter Start');
15
+
16
  if (!$this->_helper->canSendWishlist())
17
  {
18
  $this->_logReason($this->_helper->getWishlistDisabledReason());
19
  return;
20
  }
21
+
22
  $customer = Mage::getSingleton('customer/session')->getCustomer();
23
+
24
  $merge_vars = array(
25
  'WishListUrl' => Mage::getUrl('wishlist'),
26
  'WishListDate' => Mage::getModel('core/date')->date($this->_date_format)
27
  );
28
+
29
  $rc = Mage::getSingleton('emaildirect/wrapper_wishlist')->sendWishlist($customer->getEmail(), $merge_vars);
30
+
31
  $this->_log('onWishlistProductAddAfter End');
32
  }
33
  catch (Exception $e)
36
  $this->_logException($e);
37
  }
38
  }
39
+
40
  // WISHLIST END
41
  //--------------------------------------------------------------------------------------------------
42
  }
app/code/community/EmailDirect/Integration/Model/Order/Observer.php CHANGED
@@ -2,322 +2,322 @@
2
 
3
  class EmailDirect_Integration_Model_Order_Observer extends EmailDirect_Integration_Model_Observer_Abstract
4
  {
5
-
6
- public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer)
7
- {
8
- try
9
- {
10
- $order_helper = Mage::helper('emaildirect/order');
11
- $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
12
- $this->_log("Sales Order Shipment Track Save After Start");
13
- if(!$this->_helper->canEdirect())
14
- {
15
- $this->_logReason($this->_helper->getDisabledReason());
16
- return;
17
- }
18
- $track = $observer->getEvent()->getTrack();
19
-
20
- $order = $track->getShipment()->getOrder();
21
- $shippingMethod = $order->getShippingMethod(); // String in format of 'carrier_method'
22
- if (!$shippingMethod)
23
- {
24
- $this->_logReason("Shipping Method not found");
25
- return;
26
- }
27
-
28
- $email = $order->getCustomerEmail();
29
-
30
- $merge_vars = array();
31
-
32
- $merge_vars = $order_helper->getTrackingMergeVars($track, $order);
33
-
34
- if ($merge_vars == null)
35
- {
36
- $this->_logReason("No shipping fields setup");
37
- return;
38
- }
39
-
40
- $this->_log($merge_vars,"Merge Vars");
41
-
42
- $rc = Mage::getSingleton('emaildirect/wrapper_orders')->addSubscriberTracking($email, $merge_vars);
43
-
44
- $this->_log("Sales Order Shipment Track Save After Start");
45
- }
46
- catch (Exception $e)
47
- {
48
- Mage::logException($e);
49
- $this->_logException($e);
50
- }
51
- }
52
-
53
- private function canSendOrder($order, $batch = false)
54
- {
55
- $ed_order = Mage::getModel('emaildirect/order')->loadByOrderId($order->getId());
56
-
57
- if ($ed_order != null && $ed_order->getDateSent() != null)
58
- {
59
- $this->_logReason("Order has already been sent.");
60
- return false;
61
- }
62
-
63
- // Check the old data just in case
64
- if ($order->getData('sent_to_emaildirect') != false)
65
- {
66
- $this->_logReason("Order has already been sent. (Older Version)");
67
- $this->setOrderSentToEmailDirect($order, $order->getData('updated_at'));
68
- return false;
69
- }
70
-
71
- if ($batch)
72
- {
73
- $this->_log("Batch process. Skipping State/Status Check");
74
- return true;
75
- }
76
-
77
- $mode = $this->_helper->config('send_field');
78
-
79
- $this->_log("Send Field: {$mode}");
80
-
81
- if ($mode == "state")
82
- {
83
- $this->_log("Order State: " . $order->getState());
84
-
85
- $states = Mage::helper('emaildirect')->config('send_states');
86
- $state_list = explode(",",$states);
87
-
88
- $this->_log("Check States: " . $states);
89
- $this->_log($state_list, "State array");
90
-
91
- if (array_search($order->getState(),$state_list) === FALSE)
92
- {
93
- $this->_logReason("State not setup to send (" . $order->getState() . ")");
94
- return false;
95
- }
96
- }
97
- else
98
- {
99
- $this->_log("Order Status: " . $order->getStatus());
100
-
101
- $statuses = Mage::helper('emaildirect')->config('send_statuses');
102
- $status_list = explode(",",$statuses);
103
-
104
- $this->_log("Check Statuses: " . $statuses);
105
- $this->_log($status_list, "Status array");
106
-
107
- if (array_search($order->getStatus(),$status_list) === FALSE)
108
- {
109
- $this->_logReason("Status not setup to send (" . $order->getStatus() . ")");
110
- return false;
111
- }
112
- }
113
-
114
- return true;
115
- }
116
-
117
- private function processBatchStoreOrders($store)
118
- {
119
- try
120
- {
121
- $store_code = $store->getCode();
122
-
123
- $this->_log("Processing Store: {$store_code}");
124
-
125
- if (!$this->_helper->getBatchEnabled())
126
- {
127
- $this->_logReason($this->_helper->getBatchDisabledReason());
128
- return;
129
- }
130
-
131
- Mage::helper('emaildirect/fields')->checkFields();
132
-
133
- // Get order collection
134
- $collection = Mage::getResourceModel('emaildirect/order_collection');
135
-
136
- $limit = $this->_helper->config('batch_size');
137
-
138
- $this->_log("Batch Size: [{$limit}]");
139
-
140
- if ($limit != "")
141
- {
142
- if (!is_numeric($limit))
143
- $limit = 100;
144
- else
145
- $limit = (int)$limit;
146
- }
147
-
148
- $collection->getUnsentOrders($store->getId(), $limit);
149
-
150
- $this->_log("SQL: " . $collection->getSelect()->__toString());
151
-
152
- foreach ($collection as $order)
153
- {
154
- $this->processSavedOrder($order, true);
155
- }
156
-
157
- $this->_log("Finished Processing Store: {$store_code}");
158
- }
159
- catch (Exception $e)
160
- {
161
- Mage::logException($e);
162
- $this->_logException($e);
163
- }
164
- }
165
-
166
- public function processBatchOrders()
167
- {
168
- try
169
- {
170
- Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
171
- $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
172
- $this->_log("Process Batch Orders Start");
173
-
174
- $stores = Mage::app()->getStores();
175
-
176
- foreach ($stores as $store)
177
- {
178
- Mage::app()->setCurrentStore($store->getCode());
179
-
180
- $this->processBatchStoreOrders($store);
181
- }
182
-
183
- Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
184
-
185
- $this->_log("Process Batch Orders End");
186
- }
187
- catch (Exception $e)
188
- {
189
- Mage::logException($e);
190
- $this->_logException($e);
191
- }
192
- }
193
-
194
- public function processSavedOrder($order, $batch = false)
195
- {
196
- try
197
- {
198
- $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
199
- $this->_log("Process Saved Order Start");
200
-
201
- $this->_log("Order ID: " . $order->getIncrementId());
202
-
203
- $this->_log("Order Store: " . $order->getStoreId());
204
- $starting_store = Mage::app()->getStore()->getCode();
205
-
206
- Mage::app()->setCurrentStore($order->getStoreId());
207
-
208
- if (!$this->_helper->getOrdersEnabled())
209
- {
210
- $this->_logReason($this->_helper->getOrdersDisabledReason());
211
- Mage::app()->setCurrentStore($starting_store);
212
- return;
213
- }
214
-
215
- if (!$this->canSendOrder($order, $batch))
216
- {
217
- Mage::app()->setCurrentStore($starting_store);
218
- return;
219
- }
220
-
221
- $this->_log("Order is ready to send. Processing...");
222
-
223
- $customer = Mage::helper('emaildirect/order')->getOrderCustomer($order);
224
-
225
- $merge_vars = $this->_helper->getMergeVars($customer);
226
-
227
- $merge_vars = Mage::helper('emaildirect/order')->processOrderItems($order, $merge_vars);
228
-
229
- $this->_log($merge_vars, "Merge Vars");
230
-
231
- Mage::helper('emaildirect/fields')->checkFields();
232
-
233
- $rc = Mage::getSingleton('emaildirect/wrapper_orders')->addSubscriberOrder($order->getCustomerEmail(), $order, $merge_vars);
234
-
235
- if (!isset($rc->ErrorCode))
236
- $this->setOrderSentToEmailDirect($order);
237
-
238
- $this->_log("Process Saved Order End");
239
- }
240
- catch (Exception $e)
241
- {
242
- Mage::logException($e);
243
- $this->_logException($e);
244
- }
245
-
246
- Mage::app()->setCurrentStore($starting_store);
247
- }
248
-
249
- public function orderSaveAfter(Varien_Event_Observer $observer)
250
- {
251
- try
252
- {
253
- $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
254
- $this->_log("Order Save After Start");
255
-
256
- if ($this->_helper->getBatchOnly())
257
- {
258
- $this->_log("Skipping... Batch Processing Only");
259
- return;
260
- }
261
-
262
- $order = $observer->getEvent()->getOrder();
263
-
264
- $this->processSavedOrder($order);
265
-
266
- $this->_log("Order Save After End");
267
-
268
- return;
269
- }
270
- catch (Exception $e)
271
- {
272
- Mage::logException($e);
273
- $this->_logException($e);
274
- }
275
- }
276
-
277
- public function orderSaveAfterAdmin(Varien_Event_Observer $observer)
278
- {
279
- try
280
- {
281
- $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
282
- $this->_log("Order Save After (Admin) Start");
283
-
284
- if ($this->_helper->getBatchOnly())
285
- {
286
- $this->_log("Skipping... Batch Processing Only");
287
- return;
288
- }
289
-
290
- $order = $observer->getEvent()->getOrder();
291
-
292
- $this->processSavedOrder($order);
293
-
294
- $this->_log("Order Save After (Admin) End");
295
-
296
- return;
297
- }
298
- catch (Exception $e)
299
- {
300
- Mage::logException($e);
301
- $this->_logException($e);
302
- }
303
- }
304
-
305
- private function setOrderSentToEmailDirect($order, $date = null)
306
- {
307
- try
308
- {
309
- if ($date == null)
310
- {
311
- $date = date(Mage::getModel('core/date')->gmtTimestamp());
312
- $date = date($this->_date_format, $date);
313
- }
314
-
315
- $ed_order = Mage::getModel('emaildirect/order')->saveSent($order, $date);
316
  }
317
  catch (Exception $e)
318
- {
319
- Mage::logException($e);
320
- $this->_logException($e);
321
- }
322
- }
323
  }
2
 
3
  class EmailDirect_Integration_Model_Order_Observer extends EmailDirect_Integration_Model_Observer_Abstract
4
  {
5
+
6
+ public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer)
7
+ {
8
+ try
9
+ {
10
+ $order_helper = Mage::helper('emaildirect/order');
11
+ $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
12
+ $this->_log("Sales Order Shipment Track Save After Start");
13
+ if(!$this->_helper->canEdirect())
14
+ {
15
+ $this->_logReason($this->_helper->getDisabledReason());
16
+ return;
17
+ }
18
+ $track = $observer->getEvent()->getTrack();
19
+
20
+ $order = $track->getShipment()->getOrder();
21
+ $shippingMethod = $order->getShippingMethod(); // String in format of 'carrier_method'
22
+ if (!$shippingMethod)
23
+ {
24
+ $this->_logReason("Shipping Method not found");
25
+ return;
26
+ }
27
+
28
+ $email = $order->getCustomerEmail();
29
+
30
+ $merge_vars = array();
31
+
32
+ $merge_vars = $order_helper->getTrackingMergeVars($track, $order);
33
+
34
+ if ($merge_vars == null)
35
+ {
36
+ $this->_logReason("No shipping fields setup");
37
+ return;
38
+ }
39
+
40
+ $this->_log($merge_vars,"Merge Vars");
41
+
42
+ $rc = Mage::getSingleton('emaildirect/wrapper_orders')->addSubscriberTracking($email, $merge_vars);
43
+
44
+ $this->_log("Sales Order Shipment Track Save After Start");
45
+ }
46
+ catch (Exception $e)
47
+ {
48
+ Mage::logException($e);
49
+ $this->_logException($e);
50
+ }
51
+ }
52
+
53
+ private function canSendOrder($order, $batch = false)
54
+ {
55
+ $ed_order = Mage::getModel('emaildirect/order')->loadByOrderId($order->getId());
56
+
57
+ if ($ed_order != null && $ed_order->getDateSent() != null)
58
+ {
59
+ $this->_logReason("Order has already been sent.");
60
+ return false;
61
+ }
62
+
63
+ // Check the old data just in case
64
+ if ($order->getData('sent_to_emaildirect') != false)
65
+ {
66
+ $this->_logReason("Order has already been sent. (Older Version)");
67
+ $this->setOrderSentToEmailDirect($order, $order->getData('updated_at'));
68
+ return false;
69
+ }
70
+
71
+ if ($batch)
72
+ {
73
+ $this->_log("Batch process. Skipping State/Status Check");
74
+ return true;
75
+ }
76
+
77
+ $mode = $this->_helper->config('send_field');
78
+
79
+ $this->_log("Send Field: {$mode}");
80
+
81
+ if ($mode == "state")
82
+ {
83
+ $this->_log("Order State: " . $order->getState());
84
+
85
+ $states = Mage::helper('emaildirect')->config('send_states');
86
+ $state_list = explode(",",$states);
87
+
88
+ $this->_log("Check States: " . $states);
89
+ $this->_log($state_list, "State array");
90
+
91
+ if (array_search($order->getState(),$state_list) === FALSE)
92
+ {
93
+ $this->_logReason("State not setup to send (" . $order->getState() . ")");
94
+ return false;
95
+ }
96
+ }
97
+ else
98
+ {
99
+ $this->_log("Order Status: " . $order->getStatus());
100
+
101
+ $statuses = Mage::helper('emaildirect')->config('send_statuses');
102
+ $status_list = explode(",",$statuses);
103
+
104
+ $this->_log("Check Statuses: " . $statuses);
105
+ $this->_log($status_list, "Status array");
106
+
107
+ if (array_search($order->getStatus(),$status_list) === FALSE)
108
+ {
109
+ $this->_logReason("Status not setup to send (" . $order->getStatus() . ")");
110
+ return false;
111
+ }
112
+ }
113
+
114
+ return true;
115
+ }
116
+
117
+ private function processBatchStoreOrders($store)
118
+ {
119
+ try
120
+ {
121
+ $store_code = $store->getCode();
122
+
123
+ $this->_log("Processing Store: {$store_code}");
124
+
125
+ if (!$this->_helper->getBatchEnabled())
126
+ {
127
+ $this->_logReason($this->_helper->getBatchDisabledReason());
128
+ return;
129
+ }
130
+
131
+ Mage::helper('emaildirect/fields')->checkFields();
132
+
133
+ // Get order collection
134
+ $collection = Mage::getResourceModel('emaildirect/order_collection');
135
+
136
+ $limit = $this->_helper->config('batch_size');
137
+
138
+ $this->_log("Batch Size: [{$limit}]");
139
+
140
+ if ($limit != "")
141
+ {
142
+ if (!is_numeric($limit))
143
+ $limit = 100;
144
+ else
145
+ $limit = (int)$limit;
146
+ }
147
+
148
+ $collection->getUnsentOrders($store->getId(), $limit);
149
+
150
+ $this->_log("SQL: " . $collection->getSelect()->__toString());
151
+
152
+ foreach ($collection as $order)
153
+ {
154
+ $this->processSavedOrder($order, true);
155
+ }
156
+
157
+ $this->_log("Finished Processing Store: {$store_code}");
158
+ }
159
+ catch (Exception $e)
160
+ {
161
+ Mage::logException($e);
162
+ $this->_logException($e);
163
+ }
164
+ }
165
+
166
+ public function processBatchOrders()
167
+ {
168
+ try
169
+ {
170
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
171
+ $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
172
+ $this->_log("Process Batch Orders Start");
173
+
174
+ $stores = Mage::app()->getStores();
175
+
176
+ foreach ($stores as $store)
177
+ {
178
+ Mage::app()->setCurrentStore($store->getCode());
179
+
180
+ $this->processBatchStoreOrders($store);
181
+ }
182
+
183
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
184
+
185
+ $this->_log("Process Batch Orders End");
186
+ }
187
+ catch (Exception $e)
188
+ {
189
+ Mage::logException($e);
190
+ $this->_logException($e);
191
+ }
192
+ }
193
+
194
+ public function processSavedOrder($order, $batch = false)
195
+ {
196
+ try
197
+ {
198
+ $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
199
+ $this->_log("Process Saved Order Start");
200
+
201
+ $this->_log("Order ID: " . $order->getIncrementId());
202
+
203
+ $this->_log("Order Store: " . $order->getStoreId());
204
+ $starting_store = Mage::app()->getStore()->getCode();
205
+
206
+ Mage::app()->setCurrentStore($order->getStoreId());
207
+
208
+ if (!$this->_helper->getOrdersEnabled())
209
+ {
210
+ $this->_logReason($this->_helper->getOrdersDisabledReason());
211
+ Mage::app()->setCurrentStore($starting_store);
212
+ return;
213
+ }
214
+
215
+ if (!$this->canSendOrder($order, $batch))
216
+ {
217
+ Mage::app()->setCurrentStore($starting_store);
218
+ return;
219
+ }
220
+
221
+ $this->_log("Order is ready to send. Processing...");
222
+
223
+ $customer = Mage::helper('emaildirect/order')->getOrderCustomer($order);
224
+
225
+ $merge_vars = $this->_helper->getMergeVars($customer);
226
+
227
+ $merge_vars = Mage::helper('emaildirect/order')->processOrderItems($order, $merge_vars);
228
+
229
+ $this->_log($merge_vars, "Merge Vars");
230
+
231
+ Mage::helper('emaildirect/fields')->checkFields();
232
+
233
+ $rc = Mage::getSingleton('emaildirect/wrapper_orders')->addSubscriberOrder($order->getCustomerEmail(), $order, $merge_vars);
234
+
235
+ if (!isset($rc->ErrorCode))
236
+ $this->setOrderSentToEmailDirect($order);
237
+
238
+ $this->_log("Process Saved Order End");
239
+ }
240
+ catch (Exception $e)
241
+ {
242
+ Mage::logException($e);
243
+ $this->_logException($e);
244
+ }
245
+
246
+ Mage::app()->setCurrentStore($starting_store);
247
+ }
248
+
249
+ public function orderSaveAfter(Varien_Event_Observer $observer)
250
+ {
251
+ try
252
+ {
253
+ $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
254
+ $this->_log("Order Save After Start");
255
+
256
+ if ($this->_helper->getBatchOnly())
257
+ {
258
+ $this->_log("Skipping... Batch Processing Only");
259
+ return;
260
+ }
261
+
262
+ $order = $observer->getEvent()->getOrder();
263
+
264
+ $this->processSavedOrder($order);
265
+
266
+ $this->_log("Order Save After End");
267
+
268
+ return;
269
+ }
270
+ catch (Exception $e)
271
+ {
272
+ Mage::logException($e);
273
+ $this->_logException($e);
274
+ }
275
+ }
276
+
277
+ public function orderSaveAfterAdmin(Varien_Event_Observer $observer)
278
+ {
279
+ try
280
+ {
281
+ $this->_setLogArea(EmailDirect_Integration_Helper_Troubleshooting::ORDERS);
282
+ $this->_log("Order Save After (Admin) Start");
283
+
284
+ if ($this->_helper->getBatchOnly())
285
+ {
286
+ $this->_log("Skipping... Batch Processing Only");
287
+ return;
288
+ }
289
+
290
+ $order = $observer->getEvent()->getOrder();
291
+
292
+ $this->processSavedOrder($order);
293
+
294
+ $this->_log("Order Save After (Admin) End");
295
+
296
+ return;
297
+ }
298
+ catch (Exception $e)
299
+ {
300
+ Mage::logException($e);
301
+ $this->_logException($e);
302
+ }
303
+ }
304
+
305
+ private function setOrderSentToEmailDirect($order, $date = null)
306
+ {
307
+ try
308
+ {
309
+ if ($date == null)
310
+ {
311
+ $date = date(Mage::getModel('core/date')->gmtTimestamp());
312
+ $date = date($this->_date_format, $date);
313
+ }
314
+
315
+ $ed_order = Mage::getModel('emaildirect/order')->saveSent($order, $date);
316
  }
317
  catch (Exception $e)
318
+ {
319
+ Mage::logException($e);
320
+ $this->_logException($e);
321
+ }
322
+ }
323
  }
app/code/community/EmailDirect/Integration/Model/Resource/Setup.php CHANGED
@@ -3,7 +3,7 @@
3
  class EmailDirect_Integration_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
4
  {
5
  const INSTALL_LOG_FILE_NAME = 'emaildirect_install';
6
-
7
  public function addEmailDirectTables()
8
  {
9
  $this->run("
@@ -17,7 +17,7 @@ class EmailDirect_Integration_Model_Resource_Setup extends Mage_Core_Model_Resou
17
  PRIMARY KEY (`id`),
18
  KEY `idx_magento_session_id` (`magento_session_id`)
19
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
-
21
  DROP TABLE IF EXISTS {$this->getTable('emaildirect/abandoned')};
22
  CREATE TABLE {$this->getTable('emaildirect/abandoned')} (
23
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -27,7 +27,7 @@ class EmailDirect_Integration_Model_Resource_Setup extends Mage_Core_Model_Resou
27
  PRIMARY KEY (`id`),
28
  KEY `idx_quote_id` (`quote_id`)
29
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
30
-
31
  DROP TABLE IF EXISTS {$this->getTable('emaildirect/order')};
32
  CREATE TABLE {$this->getTable('emaildirect/order')} (
33
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -39,11 +39,11 @@ class EmailDirect_Integration_Model_Resource_Setup extends Mage_Core_Model_Resou
39
 
40
  ");
41
  }
42
-
43
  public function addNotification($title, $description, $url = "", $severity = Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE)
44
  {
45
  $admin_notification = Mage::getSingleton('adminnotification/inbox');
46
-
47
  // Older versions of Magento don't have this method
48
  if (method_exists($admin_notification,"add"))
49
  {
@@ -57,14 +57,14 @@ class EmailDirect_Integration_Model_Resource_Setup extends Mage_Core_Model_Resou
57
  else
58
  {
59
  $this->addLegacyNotification($title, $description, $url, $severity);
60
- }
61
  }
62
-
63
  private function addLegacyNotification($title, $description, $url = "", $severity = Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE)
64
  {
65
  if (is_array($description))
66
  $description = '<ul><li>' . implode('</li><li>', $description) . '</li></ul>';
67
-
68
  $date = date(EmailDirect_Integration_Helper_Troubleshooting::DATE_FORMAT);
69
  Mage::getSingleton('adminnotification/inbox')->parse(array(array(
70
  'severity' => $severity,
@@ -75,20 +75,20 @@ class EmailDirect_Integration_Model_Resource_Setup extends Mage_Core_Model_Resou
75
  'internal' => $isInternal
76
  )));
77
  }
78
-
79
  public function renameOld()
80
  {
81
  try
82
  {
83
  $local = Mage::getBaseDir('code') . DS . "local" . DS;
84
-
85
  $old = "{$local}EmailDirect";
86
  $new = "{$local}EmailDirect_Old";
87
-
88
  if (is_dir($old))
89
  {
90
  rename($old,$new);
91
-
92
  $this->addNotification(
93
  "The EmailDirect extension was updated. The older version has been moved.",
94
  "The EmailDirect extension is now located in the Community folder. The version in the Local folder has been moved to {$new} so that it does not interfere with the new code."
@@ -100,9 +100,9 @@ class EmailDirect_Integration_Model_Resource_Setup extends Mage_Core_Model_Resou
100
  Mage::helper('emaildirect')->logException($e);
101
  }
102
  }
103
-
104
  public function install_log($data)
105
  {
106
- Mage::log($data,null,self::INSTALL_LOG_FILE_NAME . EmailDirect_Integration_Helper_Data::LOG_FILE_EXT, true);
107
  }
108
- }
3
  class EmailDirect_Integration_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
4
  {
5
  const INSTALL_LOG_FILE_NAME = 'emaildirect_install';
6
+
7
  public function addEmailDirectTables()
8
  {
9
  $this->run("
17
  PRIMARY KEY (`id`),
18
  KEY `idx_magento_session_id` (`magento_session_id`)
19
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
+
21
  DROP TABLE IF EXISTS {$this->getTable('emaildirect/abandoned')};
22
  CREATE TABLE {$this->getTable('emaildirect/abandoned')} (
23
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
27
  PRIMARY KEY (`id`),
28
  KEY `idx_quote_id` (`quote_id`)
29
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
30
+
31
  DROP TABLE IF EXISTS {$this->getTable('emaildirect/order')};
32
  CREATE TABLE {$this->getTable('emaildirect/order')} (
33
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
39
 
40
  ");
41
  }
42
+
43
  public function addNotification($title, $description, $url = "", $severity = Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE)
44
  {
45
  $admin_notification = Mage::getSingleton('adminnotification/inbox');
46
+
47
  // Older versions of Magento don't have this method
48
  if (method_exists($admin_notification,"add"))
49
  {
57
  else
58
  {
59
  $this->addLegacyNotification($title, $description, $url, $severity);
60
+ }
61
  }
62
+
63
  private function addLegacyNotification($title, $description, $url = "", $severity = Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE)
64
  {
65
  if (is_array($description))
66
  $description = '<ul><li>' . implode('</li><li>', $description) . '</li></ul>';
67
+
68
  $date = date(EmailDirect_Integration_Helper_Troubleshooting::DATE_FORMAT);
69
  Mage::getSingleton('adminnotification/inbox')->parse(array(array(
70
  'severity' => $severity,
75
  'internal' => $isInternal
76
  )));
77
  }
78
+
79
  public function renameOld()
80
  {
81
  try
82
  {
83
  $local = Mage::getBaseDir('code') . DS . "local" . DS;
84
+
85
  $old = "{$local}EmailDirect";
86
  $new = "{$local}EmailDirect_Old";
87
+
88
  if (is_dir($old))
89
  {
90
  rename($old,$new);
91
+
92
  $this->addNotification(
93
  "The EmailDirect extension was updated. The older version has been moved.",
94
  "The EmailDirect extension is now located in the Community folder. The version in the Local folder has been moved to {$new} so that it does not interfere with the new code."
100
  Mage::helper('emaildirect')->logException($e);
101
  }
102
  }
103
+
104
  public function install_log($data)
105
  {
106
+ Mage::log($data,null,self::INSTALL_LOG_FILE_NAME . EmailDirect_Integration_Helper_Troubleshooting::LOG_FILE_EXT, true);
107
  }
108
+ }
app/code/community/EmailDirect/Integration/Model/Wrapper/Orders.php CHANGED
@@ -2,79 +2,97 @@
2
 
3
  class EmailDirect_Integration_Model_Wrapper_Orders extends EmailDirect_Integration_Model_Wrapper_Abstract
4
  {
5
- public function getOrderXml($order, $email = null)
6
- {
7
- $date = $order->getCreatedAt();
8
- $orderNum = $order->getIncrementId();
9
-
10
- $items = $order->getAllItems();
11
-
12
- $xml = "<Order>";
13
- if ($email != null)
14
- $xml .= "<EmailAddress><![CDATA[{$email}]]></EmailAddress>";
15
- $xml .= "<PurchaseDate><![CDATA[{$date}]]></PurchaseDate>";
16
- $xml .= "<OrderNumber><![CDATA[{$orderNum}]]></OrderNumber>";
17
-
18
-
19
- if (is_array($items))
20
- {
21
- $parent_items = array();
22
- foreach($items as $item)
23
- {
24
- $type = $item->getProductType();
25
- if ($type == "bundle")
26
- $parent_items[$item->getId()] = $item;
27
- }
28
-
29
- $xml .= "<Items>";
30
- foreach($items as $item)
31
- {
32
- $parent = null;
33
- if ($item->getParentItemId() != null)
34
- {
35
- if (isset($parent_items[$item->getParentItemId()]))
36
- $parent = $parent_items[$item->getParentItemId()];
37
- else
38
- continue;
39
- }
40
-
41
- $qty = (int)$item->getQtyOrdered();
42
- $xml .= "<OrderItem>";
43
- $name = $item->getName();
44
- $xml .= "<ProductName><![CDATA[$name]]></ProductName>";
45
- $sku = $item->getSku();
46
- $xml .= "<SKU><![CDATA[{$sku}]]></SKU>";
47
- $xml .= "<Quantity>{$qty}</Quantity>";
48
- $price = $item->getPrice();
49
- $xml .= "<UnitPrice>{$price}</UnitPrice>";
50
- $weight = $item->getWeight();
51
- if ($weight)
52
- $xml .= "<Weight>{$weight}</Weight>";
53
- $status = 'Completed';
54
- $xml .= "<Status><![CDATA[{$status}]]></Status>";
55
- $xml .= "</OrderItem>";
56
- }
57
- $xml .= "</Items>";
58
- }
59
- $xml .= "</Order>";
60
-
61
- return $xml;
62
- }
63
-
64
- public function addSubscriberOrder($email, $order, $merge_vars)
65
- {
66
- $order_data = "<Orders>" . $this->getOrderXml($order) . "</Orders>";
67
-
68
- $subscribe = Mage::helper('emaildirect')->forceSubscribe();
69
-
70
- // Same call just different adding the order info
71
- return Mage::getSingleton('emaildirect/wrapper_subscribers')->subscriberAdd($email, $merge_vars, $order_data, $subscribe);
72
- }
73
-
74
- public function addSubscriberTracking($email,$merge_vars)
75
- {
76
- // Same call just different Merge Vars
77
- return Mage::getSingleton('emaildirect/wrapper_subscribers')->subscriberAdd($email, $merge_vars, "", false);
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
  }
2
 
3
  class EmailDirect_Integration_Model_Wrapper_Orders extends EmailDirect_Integration_Model_Wrapper_Abstract
4
  {
5
+ public function getOrderXml($order, $email = null)
6
+ {
7
+ $date = $order->getCreatedAt();
8
+ $orderNum = $order->getIncrementId();
9
+
10
+ $items = $order->getAllItems();
11
+
12
+ $xml = "<Order>";
13
+ if ($email != null) {
14
+ $xml .= "<EmailAddress><![CDATA[{$email}]]></EmailAddress>";
15
+ }
16
+ $xml .= "<PurchaseDate><![CDATA[{$date}]]></PurchaseDate>";
17
+ $xml .= "<OrderNumber><![CDATA[{$orderNum}]]></OrderNumber>";
18
+
19
+
20
+ if (is_array($items))
21
+ {
22
+ $parent_items = array();
23
+ foreach($items as $item)
24
+ {
25
+ $type = $item->getProductType();
26
+ if ($type == "bundle") {
27
+ $parent_items[$item->getId()] = $item;
28
+ }
29
+ }
30
+
31
+ $xml .= "<Items>";
32
+
33
+ foreach ($items as $item)
34
+ {
35
+ $parent = null;
36
+ if ($item->getParentItemId() != null)
37
+ {
38
+ if (isset($parent_items[$item->getParentItemId()])) {
39
+ $parent = $parent_items[$item->getParentItemId()];
40
+ } else {
41
+ continue;
42
+ }
43
+ }
44
+
45
+ $qty = (int)$item->getQtyOrdered();
46
+ $name = $item->getName();
47
+ $sku = $item->getSku();
48
+ $price = $item->getPrice();
49
+ $weight = $item->getWeight();
50
+ $status = 'Completed';
51
+
52
+ if ($weight) {
53
+ $weight = "<Weight>{$weight}</Weight>";
54
+ }
55
+
56
+ $xml .= "<OrderItem>"
57
+ . "<ProductName><![CDATA[$name]]></ProductName>"
58
+ . "<SKU><![CDATA[{$sku}]]></SKU>"
59
+ . "<Quantity>{$qty}</Quantity>"
60
+ . "<UnitPrice>{$price}</UnitPrice>"
61
+ . $weight
62
+ . "<Status><![CDATA[{$status}]]></Status>"
63
+ . "</OrderItem>";
64
+ }
65
+
66
+ $xml .= "</Items>";
67
+ }
68
+ $xml .= "</Order>";
69
+
70
+ return $xml;
71
+ }
72
+
73
+ public function getSubscriberOrder($email, $order, $merge_vars)
74
+ {
75
+ $order_data = "<Orders>" . $this->getOrderXml($order) . "</Orders>";
76
+
77
+ $subscribe = Mage::helper('emaildirect')->forceSubscribe();
78
+
79
+ return Mage::getSingleton('emaildirect/wrapper_subscribers')->getAddXml($email, $merge_vars, $order_data, $subscribe);
80
+ }
81
+
82
+ public function addSubscriberOrder($email, $order, $merge_vars)
83
+ {
84
+ $order_data = "<Orders>" . $this->getOrderXml($order) . "</Orders>";
85
+
86
+ $subscribe = Mage::helper('emaildirect')->forceSubscribe();
87
+
88
+ // Same call just different adding the order info
89
+ return Mage::getSingleton('emaildirect/wrapper_subscribers')->subscriberAdd($email, $merge_vars, $order_data, $subscribe);
90
+ }
91
+
92
+ public function addSubscriberTracking($email,$merge_vars)
93
+ {
94
+ // Same call just different Merge Vars
95
+ return Mage::getSingleton('emaildirect/wrapper_subscribers')->subscriberAdd($email, $merge_vars, "", false);
96
+ }
97
 
98
  }
app/code/community/EmailDirect/Integration/Model/Wrapper/Subscribers.php CHANGED
@@ -2,122 +2,132 @@
2
 
3
  class EmailDirect_Integration_Model_Wrapper_subscribers extends EmailDirect_Integration_Model_Wrapper_Abstract
4
  {
5
- public function subscriberModify($email,$merge_vars)
6
- {
7
- $source_data = $this->getSource($email);
8
- $custom_fields = $this->getCustomFields($merge_vars);
9
- $list_data = $this->getLists();
10
- $publication_data = $this->getPublications();
11
-
12
- $xml = "<Subscriber><EmailAddress>{$email}</EmailAddress>{$custom_fields}{$source_data}{$publication_data}{$list_data}</Subscriber>";
13
-
14
- $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","",$email,$xml,"PUT");
15
- if(isset($rc->ErrorCode))
16
- return false;
17
-
18
- return true;
19
- }
20
-
21
- public function subscriberAdd($email,$merge_vars, $extra_data = "", $subscribe = true)
22
- {
23
- $publication_data = "";
24
- $list_data = "";
25
-
26
- $source_data = $this->getSource($email);
27
-
28
- if ($subscribe)
29
- {
30
- $publication_data = $this->getPublications();
31
- $list_data = $this->getLists();
32
- }
33
-
34
- $custom_fields = $this->getCustomFields($merge_vars);
35
-
36
- $xml = "<Subscriber><EmailAddress>{$email}</EmailAddress>{$custom_fields}{$source_data}{$extra_data}{$publication_data}{$list_data}<Force>true</Force></Subscriber>";
37
-
38
- $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","","",$xml);
39
-
40
- return $rc;
41
- }
42
-
43
- public function subscriberDelete($email)
44
- {
45
- $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers",null,$email,null,"DELETE");
46
- return $rc;
47
- }
48
-
49
- private function fixBouncedMail($old_mail,$new_mail)
50
- {
51
- $xml = "<Subscriber><EmailAddress>{$old_mail}</EmailAddress><Force>true</Force></Subscriber>";
52
-
53
- $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","","",$xml);
54
-
55
- if (isset($rc->ErrorCode))
56
- {
57
- Mage::getSingleton('customer/session')->addError((string)$rc->Message);
58
- Mage::throwException((string)$rc->Message);
59
- }
60
-
61
- $xml = "<Subscriber><EmailAddress>{$new_mail}</EmailAddress></Subscriber>";
62
-
63
- $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","ChangeEmail",$old_mail,$xml);
64
-
65
- if (isset($rc->ErrorCode))
66
- {
67
- Mage::getSingleton('customer/session')->addError((string)$rc->Message);
68
- Mage::throwException((string)$rc->Message);
69
- }
70
-
71
- return $rc;
72
- }
73
-
74
- public function mailModify($old_mail,$new_mail)
75
- {
76
- $xml = "<Subscriber><EmailAddress>{$new_mail}</EmailAddress></Subscriber>";
77
- $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","ChangeEmail",$old_mail,$xml);
78
-
79
- if (isset($rc->ErrorCode))
80
- {
81
- if ($rc->ErrorCode == 202)
82
- return $this->fixBouncedMail($old_mail, $new_mail);
83
- else if ($rc->ErrorCode == 200)
84
- return false;
85
- else
86
- {
87
  Mage::getSingleton('customer/session')->addError((string)$rc->Message);
88
  Mage::throwException((string)$rc->Message);
89
- }
90
- }
91
-
92
- return $rc;
93
- }
94
 
95
- public function getProperties($email)
96
- {
97
- $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","Properties",$email);
98
- return $rc;
99
- }
100
-
101
- public function subscriberExists($email)
102
- {
103
- $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","",$email);
104
-
105
- if (isset($rc->ErrorCode))
106
- return false;
107
-
108
- return true;
109
  }
110
-
111
- public function sendLastLogin($email, $date)
112
- {
113
- $merge_vars = array('LastLogin' => $date);
114
-
115
- $rc = $this->subscriberAdd($email, $merge_vars, "", false);
116
-
117
- if (isset($rc->ErrorCode))
118
- {
119
- Mage::getSingleton('customer/session')->addError((string)$rc->Message);
120
- Mage::throwException((string)$rc->Message);
121
- }
122
- }
123
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  class EmailDirect_Integration_Model_Wrapper_subscribers extends EmailDirect_Integration_Model_Wrapper_Abstract
4
  {
5
+ public function subscriberModify($email,$merge_vars)
6
+ {
7
+ $source_data = $this->getSource($email);
8
+ $custom_fields = $this->getCustomFields($merge_vars);
9
+ $list_data = $this->getLists();
10
+ $publication_data = $this->getPublications();
11
+
12
+ $xml = "<Subscriber><EmailAddress>{$email}</EmailAddress>{$custom_fields}{$source_data}{$publication_data}{$list_data}</Subscriber>";
13
+
14
+ $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","",$email,$xml,"PUT");
15
+
16
+ if (isset($rc->ErrorCode)) {
17
+ return false;
18
+ }
19
+
20
+ return true;
21
+ }
22
+
23
+ public function getAddXml($email,$merge_vars, $extra_data = "", $subscribe = true)
24
+ {
25
+ $publication_data = "";
26
+ $list_data = "";
27
+
28
+ $source_data = $this->getSource($email);
29
+
30
+ if ($subscribe)
31
+ {
32
+ $publication_data = $this->getPublications();
33
+ $list_data = $this->getLists();
34
+ }
35
+
36
+ $custom_fields = $this->getCustomFields($merge_vars);
37
+
38
+ return "<Subscriber><EmailAddress>{$email}</EmailAddress>{$custom_fields}{$source_data}{$extra_data}{$publication_data}{$list_data}<Force>true</Force></Subscriber>";
39
+ }
40
+
41
+ public function subscriberAdd($email,$merge_vars, $extra_data = "", $subscribe = true)
42
+ {
43
+ $xml = $this->getAddXml($email, $merge_vars, $extra_data, $subscribe);
44
+
45
+ $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","","",$xml);
46
+
47
+ return $rc;
48
+ }
49
+
50
+ public function subscriberDelete($email)
51
+ {
52
+ $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers",null,$email,null,"DELETE");
53
+ return $rc;
54
+ }
55
+
56
+ private function fixBouncedMail($old_mail,$new_mail)
57
+ {
58
+ $xml = "<Subscriber><EmailAddress>{$old_mail}</EmailAddress><Force>true</Force></Subscriber>";
59
+
60
+ $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","","",$xml);
61
+
62
+ if (isset($rc->ErrorCode))
63
+ {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  Mage::getSingleton('customer/session')->addError((string)$rc->Message);
65
  Mage::throwException((string)$rc->Message);
66
+ }
 
 
 
 
67
 
68
+ $xml = "<Subscriber><EmailAddress>{$new_mail}</EmailAddress></Subscriber>";
69
+
70
+ $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","ChangeEmail",$old_mail,$xml);
71
+
72
+ if (isset($rc->ErrorCode))
73
+ {
74
+ Mage::getSingleton('customer/session')->addError((string)$rc->Message);
75
+ Mage::throwException((string)$rc->Message);
76
+ }
77
+
78
+ return $rc;
 
 
 
79
  }
80
+
81
+ public function mailModify($old_mail,$new_mail)
82
+ {
83
+ $xml = "<Subscriber><EmailAddress>{$new_mail}</EmailAddress></Subscriber>";
84
+ $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","ChangeEmail",$old_mail,$xml);
85
+
86
+ if (isset($rc->ErrorCode))
87
+ {
88
+ if ($rc->ErrorCode == 202) {
89
+ return $this->fixBouncedMail($old_mail, $new_mail);
90
+ }
91
+ else if ($rc->ErrorCode == 200) {
92
+ return false;
93
+ }
94
+ else
95
+ {
96
+ Mage::getSingleton('customer/session')->addError((string)$rc->Message);
97
+ Mage::throwException((string)$rc->Message);
98
+ }
99
+ }
100
+
101
+ return $rc;
102
+ }
103
+
104
+ public function getProperties($email)
105
+ {
106
+ $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","Properties",$email);
107
+ return $rc;
108
+ }
109
+
110
+ public function subscriberExists($email)
111
+ {
112
+ $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","",$email);
113
+
114
+ if (isset($rc->ErrorCode)) {
115
+ return false;
116
+ }
117
+
118
+ return true;
119
+ }
120
+
121
+ public function sendLastLogin($email, $date)
122
+ {
123
+ $merge_vars = array('LastLogin' => $date);
124
+
125
+ $rc = $this->subscriberAdd($email, $merge_vars, "", false);
126
+
127
+ if (isset($rc->ErrorCode))
128
+ {
129
+ Mage::getSingleton('customer/session')->addError((string)$rc->Message);
130
+ Mage::throwException((string)$rc->Message);
131
+ }
132
+ }
133
+ }
app/code/community/EmailDirect/Integration/etc/cache.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+
4
+ </config>
app/code/community/EmailDirect/Integration/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <EmailDirect_Integration>
5
- <version>2.0.13</version>
6
  </EmailDirect_Integration>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <EmailDirect_Integration>
5
+ <version>2.0.14</version>
6
  </EmailDirect_Integration>
7
  </modules>
8
  <global>
app/code/community/EmailDirect/Integration/etc/system.xml CHANGED
@@ -1,138 +1,138 @@
1
  <?xml version="1.0"?>
2
  <config>
3
- <sections>
4
- <emaildirect translate="label" module="emaildirect">
5
- <class>emaildirect-section</class>
6
- <label>EmailDirect Configuration</label>
7
- <header_css>emaildirect-header</header_css>
8
- <tab>customer</tab>
9
- <sort_order>404</sort_order>
10
- <show_in_default>1</show_in_default>
11
- <show_in_website>1</show_in_website>
12
- <show_in_store>1</show_in_store>
13
- <groups>
14
- <hint>
15
- <frontend_model>emaildirect/adminhtml_system_config_fieldset_hint</frontend_model>
16
- <sort_order>0</sort_order>
17
- <show_in_default>1</show_in_default>
18
- <show_in_website>1</show_in_website>
19
- <show_in_store>1</show_in_store>
20
- </hint>
21
- <general translate="label comment">
22
- <label>General</label>
23
- <frontend_type>text</frontend_type>
24
- <sort_order>660</sort_order>
25
- <show_in_default>1</show_in_default>
26
- <show_in_website>1</show_in_website>
27
- <show_in_store>1</show_in_store>
28
- <expanded>1</expanded>
29
- <fields>
30
- <info translate="label">
31
- <label>Info</label>
32
- <frontend_model>emaildirect/adminhtml_system_config_form_field_info</frontend_model>
33
- <sort_order>1</sort_order>
34
- <show_in_default>1</show_in_default>
35
- <show_in_website>1</show_in_website>
36
- <show_in_store>1</show_in_store>
37
- </info>
38
- <heading_general translate="label">
39
- <label>General Configuration</label>
40
- <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
41
- <sort_order>5</sort_order>
42
- <show_in_default>1</show_in_default>
43
- <show_in_website>0</show_in_website>
44
- <show_in_store>1</show_in_store>
45
- </heading_general>
46
- <active translate="label">
47
- <label>Enabled</label>
48
- <frontend_type>select</frontend_type>
49
- <source_model>adminhtml/system_config_source_yesno</source_model>
50
- <sort_order>10</sort_order>
51
- <show_in_default>1</show_in_default>
52
- <show_in_website>0</show_in_website>
53
- <show_in_store>1</show_in_store>
54
- </active>
55
- <apikey translate="label comment">
56
- <label>API Key</label>
57
- <frontend_type>text</frontend_type>
58
- <sort_order>20</sort_order>
59
- <show_in_default>1</show_in_default>
60
- <show_in_website>0</show_in_website>
61
- <show_in_store>1</show_in_store>
62
- <comment>Enter your EmailDirect API Key here</comment>
63
- </apikey>
64
- <apikey_validation translate="label">
65
- <label>API Key Status</label>
66
- <frontend_model>emaildirect/adminhtml_system_config_form_field_api</frontend_model>
67
- <sort_order>22</sort_order>
68
- <show_in_default>1</show_in_default>
69
- <show_in_website>0</show_in_website>
70
- <show_in_store>1</show_in_store>
71
- <comment></comment>
72
- </apikey_validation>
73
- <apikey_instructions>
74
- <label>Get your API Key</label>
75
- <frontend_model>emaildirect/adminhtml_system_config_form_field_note</frontend_model>
76
- <sort_order>25</sort_order>
77
- <show_in_default>1</show_in_default>
78
- <show_in_website>0</show_in_website>
79
- <show_in_store>1</show_in_store>
80
- </apikey_instructions>
81
 
82
- <checkout_subscribe translate="label comment">
83
- <label>Subscribe On Checkout</label>
84
- <frontend_type>select</frontend_type>
85
- <source_model>emaildirect/system_config_source_checkoutsubscribe</source_model>
86
- <sort_order>50</sort_order>
87
- <show_in_default>1</show_in_default>
88
- <show_in_website>0</show_in_website>
89
- <show_in_store>1</show_in_store>
90
- <comment><![CDATA[Show Newsletter Subscribe checkbox in the last Checkout Step (Order Review). <span class='warning'>This may not work if your checkout has been customized!</span>]]></comment>
91
- </checkout_subscribe>
92
- <publication translate="label comment">
93
- <label>Publication</label>
94
- <frontend_type>select</frontend_type>
95
- <source_model>emaildirect/system_config_source_publication</source_model>
96
- <sort_order>60</sort_order>
97
- <show_in_default>1</show_in_default>
98
- <show_in_website>0</show_in_website>
99
- <show_in_store>1</show_in_store>
100
- <can_be_empty>1</can_be_empty>
101
- <comment>This is the Publication that emails will be subscribed to and is required</comment>
102
- </publication>
103
- <additional_lists translate="label comment">
104
- <label>Additional Lists</label>
105
- <frontend_type>multiselect</frontend_type>
106
- <source_model>emaildirect/system_config_source_additionallist</source_model>
107
- <sort_order>70</sort_order>
108
- <show_in_default>1</show_in_default>
109
- <show_in_website>0</show_in_website>
110
- <show_in_store>1</show_in_store>
111
- <can_be_empty>1</can_be_empty>
112
- <comment>Choose one or more Lists to allow your subscribers more options when subscribing. Not required</comment>
113
- </additional_lists>
114
- <source translate="label comment">
115
- <label>Source</label>
116
- <frontend_type>text</frontend_type>
117
- <sort_order>80</sort_order>
118
- <show_in_default>1</show_in_default>
119
- <show_in_website>0</show_in_website>
120
- <show_in_store>1</show_in_store>
121
- <can_be_empty>0</can_be_empty>
122
- <comment><![CDATA[This is the main source used with the Magento General Subscription.<br/> If you leave this field blank <strong>Magento</strong> is used]]></comment>
123
- </source>
124
- <override_source translate="label">
125
- <label>Override Source</label>
126
- <frontend_type>select</frontend_type>
127
- <source_model>adminhtml/system_config_source_yesno</source_model>
128
- <sort_order>90</sort_order>
129
- <show_in_default>1</show_in_default>
130
- <show_in_website>0</show_in_website>
131
- <show_in_store>1</show_in_store>
132
- <comment>If set to "Yes", the source will be updated when an existing customer is updated.</comment>
133
- </override_source>
134
 
135
- <heading_mappings translate="label">
136
  <label>Field Mappings</label>
137
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
138
  <sort_order>100</sort_order>
@@ -141,35 +141,35 @@
141
  <show_in_store>1</show_in_store>
142
  </heading_mappings>
143
 
144
- <address_fields translate="label comment">
145
- <label>Address Fields Mapping</label>
146
- <frontend_model>emaildirect/adminhtml_system_config_form_field_addressmapfields</frontend_model>
147
- <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
148
- <sort_order>110</sort_order>
149
- <show_in_default>1</show_in_default>
150
- <show_in_website>0</show_in_website>
151
- <show_in_store>1</show_in_store>
152
- </address_fields>
153
- <map_fields translate="label comment">
154
- <label>Customer Fields Mapping</label>
155
- <frontend_model>emaildirect/adminhtml_system_config_form_field_mapfields</frontend_model>
156
- <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
157
- <sort_order>120</sort_order>
158
- <show_in_default>1</show_in_default>
159
- <show_in_website>0</show_in_website>
160
- <show_in_store>1</show_in_store>
161
- </map_fields>
162
- <shipping_fields translate="label comment">
163
- <label>Shipping Fields Mapping</label>
164
- <frontend_model>emaildirect/adminhtml_system_config_form_field_shippingmapfields</frontend_model>
165
- <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
166
- <sort_order>130</sort_order>
167
- <show_in_default>1</show_in_default>
168
- <show_in_website>0</show_in_website>
169
- <show_in_store>1</show_in_store>
170
- </shipping_fields>
171
 
172
- <heading_orders translate="label">
173
  <label>Orders</label>
174
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
175
  <sort_order>200</sort_order>
@@ -177,94 +177,94 @@
177
  <show_in_website>0</show_in_website>
178
  <show_in_store>1</show_in_store>
179
  </heading_orders>
180
- <sendorder translate="label">
181
- <label>Send orders to EmailDirect</label>
182
- <frontend_type>select</frontend_type>
183
- <source_model>adminhtml/system_config_source_yesno</source_model>
184
- <sort_order>210</sort_order>
185
- <show_in_default>1</show_in_default>
186
- <show_in_website>0</show_in_website>
187
- <show_in_store>1</show_in_store>
188
- <comment>Sends all completed orders to EmailDirect Purchase Behavior for detailed reporting, filtering and targeting</comment>
189
- </sendorder>
190
- <send_field>
191
- <label>Send orders based on</label>
192
- <frontend_type>select</frontend_type>
193
- <source_model>emaildirect/system_config_source_send_field</source_model>
194
- <sort_order>212</sort_order>
195
- <show_in_default>1</show_in_default>
196
- <show_in_website>0</show_in_website>
197
- <show_in_store>1</show_in_store>
198
- <depends><sendorder>1</sendorder></depends>
199
- </send_field>
200
- <send_states translate="label comment">
201
- <label>State options</label>
202
- <frontend_type>multiselect</frontend_type>
203
- <source_model>emaildirect/system_config_source_states</source_model>
204
- <sort_order>220</sort_order>
205
- <show_in_default>1</show_in_default>
206
- <show_in_website>0</show_in_website>
207
- <show_in_store>1</show_in_store>
208
- <comment>Choose one or more States to determine when an order will be sent to EmailDirect. Orders will only be sent the first time one of these states are encountered.</comment>
209
- <depends><sendorder>1</sendorder><send_field>state</send_field></depends>
210
- </send_states>
211
- <send_statuses translate="label comment">
212
- <label>Status options</label>
213
- <frontend_type>multiselect</frontend_type>
214
- <source_model>emaildirect/system_config_source_statuses</source_model>
215
- <sort_order>225</sort_order>
216
- <show_in_default>1</show_in_default>
217
- <show_in_website>0</show_in_website>
218
- <show_in_store>1</show_in_store>
219
- <comment>Choose one or more Statuses to determine when an order will be sent to EmailDirect. Orders will only be sent the first time one of these statuses are encountered.</comment>
220
- <depends><sendorder>1</sendorder><send_field>status</send_field></depends>
221
- </send_statuses>
222
- <batch_enabled>
223
- <label>Send orders in the background?</label>
224
- <frontend_type>select</frontend_type>
225
- <source_model>adminhtml/system_config_source_yesno</source_model>
226
- <sort_order>230</sort_order>
227
- <show_in_default>1</show_in_default>
228
- <show_in_website>0</show_in_website>
229
- <show_in_store>1</show_in_store>
230
- <comment>If selected, orders will be sent in batches of up to 200 every hour through a cron process. Note that only orders up to a week old from the present date will be processed. To process older orders please use the order export function below.</comment>
231
- <depends><sendorder>1</sendorder></depends>
232
- </batch_enabled>
233
- <batch_size>
234
- <label>Number of orders to process each time the batch is run</label>
235
- <frontend_type>text</frontend_type>
236
- <sort_order>250</sort_order>
237
- <show_in_default>0</show_in_default>
238
- <show_in_website>0</show_in_website>
239
- <show_in_store>0</show_in_store>
240
- <comment>Leave blank to send all (not recommended).</comment>
241
- <depends><batch_enabled>1</batch_enabled></depends>
242
- </batch_size>
243
- <batch_only>
244
- <label>Send in background only?</label>
245
- <frontend_type>select</frontend_type>
246
- <source_model>adminhtml/system_config_source_yesno</source_model>
247
- <sort_order>240</sort_order>
248
- <show_in_default>1</show_in_default>
249
- <show_in_website>0</show_in_website>
250
- <show_in_store>1</show_in_store>
251
- <comment>Orders will only be sent in the background process.</comment>
252
- <depends><batch_enabled>1</batch_enabled></depends>
253
- </batch_only>
254
 
255
- <save_latest_order translate="label">
256
- <label>Save Latest Order Information</label>
257
- <frontend_type>select</frontend_type>
258
- <source_model>adminhtml/system_config_source_yesno</source_model>
259
- <sort_order>230</sort_order>
260
- <show_in_default>1</show_in_default>
261
- <show_in_website>0</show_in_website>
262
- <show_in_store>1</show_in_store>
263
- <comment>Save information from the latest order along with the first 3 products from that order</comment>
264
- <depends><sendorder>1</sendorder></depends>
265
- </save_latest_order>
266
 
267
- <heading_abandoned translate="label">
268
  <label>Abandoned Carts</label>
269
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
270
  <sort_order>300</sort_order>
@@ -273,65 +273,65 @@
273
  <show_in_store>1</show_in_store>
274
  </heading_abandoned>
275
 
276
- <sendabandoned translate="label">
277
- <label>Add Abandoned Carts To EmailDirect</label>
278
- <frontend_type>select</frontend_type>
279
- <source_model>adminhtml/system_config_source_yesno</source_model>
280
- <sort_order>310</sort_order>
281
- <show_in_default>1</show_in_default>
282
- <show_in_website>0</show_in_website>
283
- <show_in_store>1</show_in_store>
284
- <comment>This will add any abandoned shopping carts to the EmailDirect database with AbandonedDate and AbandonedURL database fields. These fields can be used with Workflows to time your own Abandoned Shopping Cart emails or send a series of emails. This allows for complete customization of the email.</comment>
285
- </sendabandoned>
286
- <abandonedtime translate="label comment">
287
- <label>Abandoned Time</label>
288
- <frontend_type>select</frontend_type>
289
- <source_model>emaildirect/system_config_source_time</source_model>
290
- <sort_order>320</sort_order>
291
- <show_in_default>1</show_in_default>
292
- <show_in_website>0</show_in_website>
293
- <show_in_store>1</show_in_store>
294
- <comment>How long before a cart is considered abandoned?</comment>
295
- <depends><sendabandoned>1</sendabandoned></depends>
296
- </abandonedtime>
297
- <abandonedpublication translate="label comment">
298
- <label>Abandoned Publication</label>
299
- <frontend_type>select</frontend_type>
300
- <source_model>emaildirect/system_config_source_publication</source_model>
301
- <sort_order>330</sort_order>
302
- <show_in_default>1</show_in_default>
303
- <show_in_website>0</show_in_website>
304
- <show_in_store>1</show_in_store>
305
- <can_be_empty>1</can_be_empty>
306
- <comment>This is the Publication that you will put abandoned shoppers into</comment>
307
- <depends><sendabandoned>1</sendabandoned></depends>
308
- </abandonedpublication>
309
- <abandonedlist translate="label comment">
310
- <label>Abandoned List</label>
311
- <frontend_type>select</frontend_type>
312
- <source_model>emaildirect/system_config_source_abandonedlist</source_model>
313
- <sort_order>340</sort_order>
314
- <show_in_default>1</show_in_default>
315
- <show_in_website>0</show_in_website>
316
- <show_in_store>1</show_in_store>
317
- <can_be_empty>1</can_be_empty>
318
- <comment>This is the List that you will put abandoned shoppers into. Not Required.</comment>
319
- <depends><sendabandoned>1</sendabandoned></depends>
320
- </abandonedlist>
321
- <capture_enabled translate="label">
322
- <label>Capture guest emails?</label>
323
- <frontend_type>select</frontend_type>
324
- <source_model>adminhtml/system_config_source_yesno</source_model>
325
- <sort_order>350</sort_order>
326
- <show_in_default>1</show_in_default>
327
- <show_in_website>0</show_in_website>
328
- <show_in_store>1</show_in_store>
329
- <comment>When enabled, this feature will capture guest emails from various forms within the site to be used with abandoned carts.</comment>
330
- <depends><sendabandoned>1</sendabandoned></depends>
331
- </capture_enabled>
332
 
333
- <!-- SEQUENCES -->
334
- <heading_sequence translate="label">
335
  <label>Abandoned Cart Sequences</label>
336
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
337
  <sort_order>360</sort_order>
@@ -339,175 +339,175 @@
339
  <show_in_website>0</show_in_website>
340
  <show_in_store>1</show_in_store>
341
  <depends><sendabandoned>1</sendabandoned></depends>
342
- </heading_sequence>
343
- <abandonedsequence_enabled>
344
- <label>Add a sequence value to each abandoned cart?</label>
345
- <frontend_type>select</frontend_type>
346
- <source_model>adminhtml/system_config_source_yesno</source_model>
347
- <sort_order>370</sort_order>
348
- <show_in_default>1</show_in_default>
349
- <show_in_website>0</show_in_website>
350
- <show_in_store>1</show_in_store>
351
- <comment>This will allow you to assign a sequence of values to your subscribers, one for each abandoned cart.</comment>
352
- <depends><sendabandoned>1</sendabandoned></depends>
353
- </abandonedsequence_enabled>
354
- <abandonedsequence_field translate="label comment">
355
- <label>Sequence Database Field</label>
356
- <frontend_type>select</frontend_type>
357
- <source_model>emaildirect/system_config_source_sequence</source_model>
358
- <sort_order>380</sort_order>
359
- <show_in_default>1</show_in_default>
360
- <show_in_website>0</show_in_website>
361
- <show_in_store>1</show_in_store>
362
- <can_be_empty>1</can_be_empty>
363
- <comment>This is the database field in EmailDirect that the sequence will be stored in.</comment>
364
- <depends><sendabandoned>1</sendabandoned><abandonedsequence_enabled>1</abandonedsequence_enabled></depends>
365
- </abandonedsequence_field>
366
- <abandonedsequence_options translate="label comment">
367
- <label>Sequence Options</label>
368
- <frontend_type>textarea</frontend_type>
369
- <sort_order>390</sort_order>
370
- <show_in_default>1</show_in_default>
371
- <show_in_website>0</show_in_website>
372
- <show_in_store>1</show_in_store>
373
- <can_be_empty>1</can_be_empty>
374
- <comment>Enter one sequence per line to be appended.</comment>
375
- <depends><sendabandoned>1</sendabandoned><abandonedsequence_enabled>1</abandonedsequence_enabled></depends>
376
- </abandonedsequence_options>
377
 
378
- <!-- signup -->
379
- <heading_signup translate="label">
380
  <label>EmailDirect Signup Form</label>
381
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
382
  <sort_order>400</sort_order>
383
  <show_in_default>1</show_in_default>
384
  <show_in_website>0</show_in_website>
385
  <show_in_store>1</show_in_store>
386
- </heading_signup>
387
- <signup_enabled>
388
- <label>Show EmailDirect Signup form?</label>
389
- <frontend_type>select</frontend_type>
390
- <source_model>adminhtml/system_config_source_yesno</source_model>
391
- <sort_order>410</sort_order>
392
- <show_in_default>1</show_in_default>
393
- <show_in_website>0</show_in_website>
394
- <show_in_store>1</show_in_store>
395
- <comment>This will allow you to show an EmailDirect signup form in a popup.</comment>
396
- </signup_enabled>
397
- <signup_url>
398
- <label>URL to Signup Form</label>
399
- <frontend_type>text</frontend_type>
400
- <sort_order>420</sort_order>
401
- <show_in_default>1</show_in_default>
402
- <show_in_website>0</show_in_website>
403
- <show_in_store>1</show_in_store>
404
- <comment>URL to the EmailDirect Signup Form.</comment>
405
- <depends><signup_enabled>1</signup_enabled></depends>
406
- </signup_url>
407
- <signup_delay>
408
- <label>Delay before showing</label>
409
- <frontend_type>text</frontend_type>
410
- <sort_order>430</sort_order>
411
- <show_in_default>1</show_in_default>
412
- <show_in_website>0</show_in_website>
413
- <show_in_store>1</show_in_store>
414
- <depends><signup_enabled>1</signup_enabled></depends>
415
- <comment>How many seconds before the signup form is shown</comment>
416
- </signup_delay>
417
- <signup_recurrence>
418
- <label>Recurrence</label>
419
- <frontend_type>select</frontend_type>
420
- <source_model>emaildirect/system_config_source_signup_recurrence</source_model>
421
- <sort_order>440</sort_order>
422
- <show_in_default>1</show_in_default>
423
- <show_in_website>0</show_in_website>
424
- <show_in_store>1</show_in_store>
425
- <comment>Time until Signup Form displays again, per visitor.</comment>
426
- <depends><signup_enabled>1</signup_enabled></depends>
427
- </signup_recurrence>
428
- <signup_width>
429
- <label>Width of Form</label>
430
- <frontend_type>text</frontend_type>
431
- <sort_order>450</sort_order>
432
- <show_in_default>1</show_in_default>
433
- <show_in_website>0</show_in_website>
434
- <show_in_store>1</show_in_store>
435
- <depends><signup_enabled>1</signup_enabled></depends>
436
- </signup_width>
437
- <signup_height>
438
- <label>Height of Form</label>
439
- <frontend_type>text</frontend_type>
440
- <sort_order>460</sort_order>
441
- <show_in_default>1</show_in_default>
442
- <show_in_website>0</show_in_website>
443
- <show_in_store>1</show_in_store>
444
- <depends><signup_enabled>1</signup_enabled></depends>
445
- </signup_height>
446
- <signup_opacity>
447
- <label>Opacity of background</label>
448
- <frontend_type>select</frontend_type>
449
- <source_model>emaildirect/system_config_source_signup_opacity</source_model>
450
- <sort_order>470</sort_order>
451
- <show_in_default>1</show_in_default>
452
- <show_in_website>0</show_in_website>
453
- <show_in_store>1</show_in_store>
454
- <depends><signup_enabled>1</signup_enabled></depends>
455
- </signup_opacity>
456
- <signup_test_button>
457
- <label>Test Signup Form</label>
458
- <frontend_model>emaildirect/adminhtml_system_config_form_field_signup_test</frontend_model>
459
- <sort_order>480</sort_order>
460
- <show_in_default>1</show_in_default>
461
- <show_in_website>0</show_in_website>
462
- <show_in_store>1</show_in_store>
463
- <can_be_empty>1</can_be_empty>
464
- <comment><![CDATA[Test the signup form popup (opens in new window).<br />Note: "Show EmailDirect Signup form" must be set to "Yes" and the configuration saved in order to perform a signup test.]]></comment>
465
- <depends><signup_enabled>1</signup_enabled></depends>
466
- </signup_test_button>
467
- <signup_activated>
468
- <label>Activate Signup Form?</label>
469
- <frontend_type>select</frontend_type>
470
- <source_model>adminhtml/system_config_source_yesno</source_model>
471
- <sort_order>490</sort_order>
472
- <show_in_default>1</show_in_default>
473
- <show_in_website>0</show_in_website>
474
- <show_in_store>1</show_in_store>
475
- <comment>Do not activate this form until it has been tested.</comment>
476
- <depends><signup_enabled>1</signup_enabled></depends>
477
- </signup_activated>
478
 
479
- <!-- Wishlist -->
480
- <heading_wishlist translate="label">
481
  <label>Wishlist</label>
482
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
483
  <sort_order>600</sort_order>
484
  <show_in_default>1</show_in_default>
485
  <show_in_website>0</show_in_website>
486
  <show_in_store>1</show_in_store>
487
- </heading_wishlist>
488
- <wishlist_enabled>
489
- <label>Activate Wish List Alerts?</label>
490
- <frontend_type>select</frontend_type>
491
- <source_model>adminhtml/system_config_source_yesno</source_model>
492
- <sort_order>610</sort_order>
493
- <show_in_default>1</show_in_default>
494
- <show_in_website>0</show_in_website>
495
- <show_in_store>1</show_in_store>
496
- <comment>Send subscriber Wishlist URL and their most recent Wishlist Date to your EmailDirect database.</comment>
497
- </wishlist_enabled>
498
 
499
- </fields>
500
- </general>
501
- <export translate="label comment">
502
- <label>Export Options</label>
503
- <frontend_type>text</frontend_type>
504
- <sort_order>670</sort_order>
505
- <show_in_default>1</show_in_default>
506
- <show_in_website>0</show_in_website>
507
- <show_in_store>1</show_in_store>
508
- <expanded>1</expanded>
509
- <fields>
510
- <heading_orders translate="label">
511
  <label>Order Exports</label>
512
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
513
  <sort_order>5</sort_order>
@@ -516,37 +516,37 @@
516
  <show_in_store>1</show_in_store>
517
  </heading_orders>
518
  <include_already_sent translate="label">
519
- <label>Include orders already sent?</label>
520
- <frontend_type>select</frontend_type>
521
- <source_model>adminhtml/system_config_source_yesno</source_model>
522
- <sort_order>5</sort_order>
523
- <show_in_default>1</show_in_default>
524
- <show_in_website>0</show_in_website>
525
- <show_in_store>1</show_in_store>
526
- <comment>This option allows you to include or exclude orders that have been sent directly to EmailDirect through the normal order creation process.</comment>
527
- </include_already_sent>
528
- <export_orders_range>
529
- <label>Order Date Range</label>
530
- <frontend_model>emaildirect/adminhtml_system_config_form_field_export_range</frontend_model>
531
- <sort_order>10</sort_order>
532
- <show_in_default>1</show_in_default>
533
- <show_in_website>0</show_in_website>
534
- <show_in_store>1</show_in_store>
535
- <can_be_empty>1</can_be_empty>
536
- <comment>Only orders within the past year can be exported</comment>
537
- </export_orders_range>
538
- <export_orders_button>
539
- <label>Export Orders</label>
540
- <frontend_model>emaildirect/adminhtml_system_config_form_field_export_orders</frontend_model>
541
- <sort_order>20</sort_order>
542
- <show_in_default>1</show_in_default>
543
- <show_in_website>0</show_in_website>
544
- <show_in_store>1</show_in_store>
545
- <can_be_empty>1</can_be_empty>
546
- <comment>Export Orders to CSV and send the CSV file to Emaildirect (opens in new window)</comment>
547
- </export_orders_button>
548
 
549
- <heading_products translate="label">
550
  <label>Category Exports</label>
551
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
552
  <sort_order>30</sort_order>
@@ -554,57 +554,57 @@
554
  <show_in_website>0</show_in_website>
555
  <show_in_store>1</show_in_store>
556
  </heading_products>
557
- <include_disabled translate="label">
558
- <label>Include disabled Products?</label>
559
- <frontend_type>select</frontend_type>
560
- <source_model>adminhtml/system_config_source_yesno</source_model>
561
- <sort_order>40</sort_order>
562
- <show_in_default>1</show_in_default>
563
- <show_in_website>0</show_in_website>
564
- <show_in_store>1</show_in_store>
565
- </include_disabled>
566
- <batch translate="label comment">
567
- <label>Batch Size</label>
568
- <frontend_type>select</frontend_type>
569
- <source_model>emaildirect/system_config_source_export_batch</source_model>
570
- <sort_order>50</sort_order>
571
- <show_in_default>0</show_in_default>
572
- <show_in_website>0</show_in_website>
573
- <show_in_store>0</show_in_store>
574
- <comment>Number of Products to Export at a time (SAVE CONFIG BEFORE EXPORTING)</comment>
575
- </batch>
576
- <export_button>
577
- <label>Export Products</label>
578
- <frontend_model>emaildirect/adminhtml_system_config_form_field_export_products</frontend_model>
579
- <sort_order>60</sort_order>
580
- <show_in_default>1</show_in_default>
581
- <show_in_website>0</show_in_website>
582
- <show_in_store>1</show_in_store>
583
- <can_be_empty>1</can_be_empty>
584
- <comment>Export Products to CSV and send the CSV file to Emaildirect (opens in new window)</comment>
585
- </export_button>
586
- <export_na>
587
- <label>Export Not Available</label>
588
- <frontend_type>label</frontend_type>
589
- <sort_order>1000</sort_order>
590
- <show_in_default>0</show_in_default>
591
- <show_in_website>0</show_in_website>
592
- <show_in_store>0</show_in_store>
593
- <comment>Please setup your API Key to perform an Export</comment>
594
- <!--<depends><setup>0</setup></depends>-->
595
- </export_na>
596
- </fields>
597
- </export>
598
- <troubleshooting translate="label comment">
599
- <label>Troubleshooting</label>
600
- <frontend_type>text</frontend_type>
601
- <sort_order>900</sort_order>
602
- <show_in_default>1</show_in_default>
603
- <show_in_website>0</show_in_website>
604
- <show_in_store>1</show_in_store>
605
- <expanded>1</expanded>
606
- <fields>
607
- <heading_logging translate="label">
608
  <label>Logging</label>
609
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
610
  <sort_order>10</sort_order>
@@ -612,16 +612,16 @@
612
  <show_in_website>0</show_in_website>
613
  <show_in_store>1</show_in_store>
614
  </heading_logging>
615
- <logging translate="label">
616
- <label>Status</label>
617
- <frontend_model>emaildirect/adminhtml_system_config_form_field_logging</frontend_model>
618
- <sort_order>20</sort_order>
619
- <show_in_default>1</show_in_default>
620
- <show_in_website>0</show_in_website>
621
- <show_in_store>1</show_in_store>
622
- <comment></comment>
623
- </logging>
624
- <heading_diagnostics translate="label">
625
  <label>Diagnostics</label>
626
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
627
  <sort_order>200</sort_order>
@@ -630,17 +630,17 @@
630
  <show_in_store>1</show_in_store>
631
  </heading_diagnostics>
632
  <diagnostics translate="label">
633
- <label>Status</label>
634
- <frontend_model>emaildirect/adminhtml_system_config_form_field_diagnostics</frontend_model>
635
- <sort_order>210</sort_order>
636
- <show_in_default>1</show_in_default>
637
- <show_in_website>0</show_in_website>
638
- <show_in_store>1</show_in_store>
639
- <comment></comment>
640
- </diagnostics>
641
- </fields>
642
- </troubleshooting>
643
- </groups>
644
- </emaildirect>
645
- </sections>
646
  </config>
1
  <?xml version="1.0"?>
2
  <config>
3
+ <sections>
4
+ <emaildirect translate="label" module="emaildirect">
5
+ <class>emaildirect-section</class>
6
+ <label>EmailDirect Configuration</label>
7
+ <header_css>emaildirect-header</header_css>
8
+ <tab>customer</tab>
9
+ <sort_order>404</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <groups>
14
+ <hint>
15
+ <frontend_model>emaildirect/adminhtml_system_config_fieldset_hint</frontend_model>
16
+ <sort_order>0</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ </hint>
21
+ <general translate="label comment">
22
+ <label>General</label>
23
+ <frontend_type>text</frontend_type>
24
+ <sort_order>660</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ <expanded>1</expanded>
29
+ <fields>
30
+ <info translate="label">
31
+ <label>Info</label>
32
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_info</frontend_model>
33
+ <sort_order>1</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ </info>
38
+ <heading_general translate="label">
39
+ <label>General Configuration</label>
40
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
41
+ <sort_order>5</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>0</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ </heading_general>
46
+ <active translate="label">
47
+ <label>Enabled</label>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>adminhtml/system_config_source_yesno</source_model>
50
+ <sort_order>10</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>0</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ </active>
55
+ <apikey translate="label comment">
56
+ <label>API Key</label>
57
+ <frontend_type>text</frontend_type>
58
+ <sort_order>20</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>0</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ <comment>Enter your EmailDirect API Key here</comment>
63
+ </apikey>
64
+ <apikey_validation translate="label">
65
+ <label>API Key Status</label>
66
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_api</frontend_model>
67
+ <sort_order>22</sort_order>
68
+ <show_in_default>1</show_in_default>
69
+ <show_in_website>0</show_in_website>
70
+ <show_in_store>1</show_in_store>
71
+ <comment></comment>
72
+ </apikey_validation>
73
+ <apikey_instructions>
74
+ <label>Get your API Key</label>
75
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_note</frontend_model>
76
+ <sort_order>25</sort_order>
77
+ <show_in_default>1</show_in_default>
78
+ <show_in_website>0</show_in_website>
79
+ <show_in_store>1</show_in_store>
80
+ </apikey_instructions>
81
 
82
+ <checkout_subscribe translate="label comment">
83
+ <label>Subscribe On Checkout</label>
84
+ <frontend_type>select</frontend_type>
85
+ <source_model>emaildirect/system_config_source_checkoutsubscribe</source_model>
86
+ <sort_order>50</sort_order>
87
+ <show_in_default>1</show_in_default>
88
+ <show_in_website>0</show_in_website>
89
+ <show_in_store>1</show_in_store>
90
+ <comment><![CDATA[Show Newsletter Subscribe checkbox in the last Checkout Step (Order Review). <span class='warning'>This may not work if your checkout has been customized!</span>]]></comment>
91
+ </checkout_subscribe>
92
+ <publication translate="label comment">
93
+ <label>Publication</label>
94
+ <frontend_type>select</frontend_type>
95
+ <source_model>emaildirect/system_config_source_publication</source_model>
96
+ <sort_order>60</sort_order>
97
+ <show_in_default>1</show_in_default>
98
+ <show_in_website>0</show_in_website>
99
+ <show_in_store>1</show_in_store>
100
+ <can_be_empty>1</can_be_empty>
101
+ <comment>This is the Publication that emails will be subscribed to and is required</comment>
102
+ </publication>
103
+ <additional_lists translate="label comment">
104
+ <label>Additional Lists</label>
105
+ <frontend_type>multiselect</frontend_type>
106
+ <source_model>emaildirect/system_config_source_additionallist</source_model>
107
+ <sort_order>70</sort_order>
108
+ <show_in_default>1</show_in_default>
109
+ <show_in_website>0</show_in_website>
110
+ <show_in_store>1</show_in_store>
111
+ <can_be_empty>1</can_be_empty>
112
+ <comment>Choose one or more Lists to allow your subscribers more options when subscribing. Not required</comment>
113
+ </additional_lists>
114
+ <source translate="label comment">
115
+ <label>Source</label>
116
+ <frontend_type>text</frontend_type>
117
+ <sort_order>80</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>0</show_in_website>
120
+ <show_in_store>1</show_in_store>
121
+ <can_be_empty>0</can_be_empty>
122
+ <comment><![CDATA[This is the main source used with the Magento General Subscription.<br/> If you leave this field blank <strong>Magento</strong> is used]]></comment>
123
+ </source>
124
+ <override_source translate="label">
125
+ <label>Override Source</label>
126
+ <frontend_type>select</frontend_type>
127
+ <source_model>adminhtml/system_config_source_yesno</source_model>
128
+ <sort_order>90</sort_order>
129
+ <show_in_default>1</show_in_default>
130
+ <show_in_website>0</show_in_website>
131
+ <show_in_store>1</show_in_store>
132
+ <comment>If set to "Yes", the source will be updated when an existing customer is updated.</comment>
133
+ </override_source>
134
 
135
+ <heading_mappings translate="label">
136
  <label>Field Mappings</label>
137
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
138
  <sort_order>100</sort_order>
141
  <show_in_store>1</show_in_store>
142
  </heading_mappings>
143
 
144
+ <address_fields translate="label comment">
145
+ <label>Address Fields Mapping</label>
146
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_addressmapfields</frontend_model>
147
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
148
+ <sort_order>110</sort_order>
149
+ <show_in_default>1</show_in_default>
150
+ <show_in_website>0</show_in_website>
151
+ <show_in_store>1</show_in_store>
152
+ </address_fields>
153
+ <map_fields translate="label comment">
154
+ <label>Customer Fields Mapping</label>
155
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_mapfields</frontend_model>
156
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
157
+ <sort_order>120</sort_order>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>0</show_in_website>
160
+ <show_in_store>1</show_in_store>
161
+ </map_fields>
162
+ <shipping_fields translate="label comment">
163
+ <label>Shipping Fields Mapping</label>
164
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_shippingmapfields</frontend_model>
165
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
166
+ <sort_order>130</sort_order>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>0</show_in_website>
169
+ <show_in_store>1</show_in_store>
170
+ </shipping_fields>
171
 
172
+ <heading_orders translate="label">
173
  <label>Orders</label>
174
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
175
  <sort_order>200</sort_order>
177
  <show_in_website>0</show_in_website>
178
  <show_in_store>1</show_in_store>
179
  </heading_orders>
180
+ <sendorder translate="label">
181
+ <label>Send orders to EmailDirect</label>
182
+ <frontend_type>select</frontend_type>
183
+ <source_model>adminhtml/system_config_source_yesno</source_model>
184
+ <sort_order>210</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>0</show_in_website>
187
+ <show_in_store>1</show_in_store>
188
+ <comment>Sends all completed orders to EmailDirect Purchase Behavior for detailed reporting, filtering and targeting</comment>
189
+ </sendorder>
190
+ <send_field>
191
+ <label>Send orders based on</label>
192
+ <frontend_type>select</frontend_type>
193
+ <source_model>emaildirect/system_config_source_send_field</source_model>
194
+ <sort_order>212</sort_order>
195
+ <show_in_default>1</show_in_default>
196
+ <show_in_website>0</show_in_website>
197
+ <show_in_store>1</show_in_store>
198
+ <depends><sendorder>1</sendorder></depends>
199
+ </send_field>
200
+ <send_states translate="label comment">
201
+ <label>State options</label>
202
+ <frontend_type>multiselect</frontend_type>
203
+ <source_model>emaildirect/system_config_source_states</source_model>
204
+ <sort_order>220</sort_order>
205
+ <show_in_default>1</show_in_default>
206
+ <show_in_website>0</show_in_website>
207
+ <show_in_store>1</show_in_store>
208
+ <comment>Choose one or more States to determine when an order will be sent to EmailDirect. Orders will only be sent the first time one of these states are encountered.</comment>
209
+ <depends><sendorder>1</sendorder><send_field>state</send_field></depends>
210
+ </send_states>
211
+ <send_statuses translate="label comment">
212
+ <label>Status options</label>
213
+ <frontend_type>multiselect</frontend_type>
214
+ <source_model>emaildirect/system_config_source_statuses</source_model>
215
+ <sort_order>225</sort_order>
216
+ <show_in_default>1</show_in_default>
217
+ <show_in_website>0</show_in_website>
218
+ <show_in_store>1</show_in_store>
219
+ <comment>Choose one or more Statuses to determine when an order will be sent to EmailDirect. Orders will only be sent the first time one of these statuses are encountered.</comment>
220
+ <depends><sendorder>1</sendorder><send_field>status</send_field></depends>
221
+ </send_statuses>
222
+ <batch_enabled>
223
+ <label>Send orders in the background?</label>
224
+ <frontend_type>select</frontend_type>
225
+ <source_model>adminhtml/system_config_source_yesno</source_model>
226
+ <sort_order>230</sort_order>
227
+ <show_in_default>1</show_in_default>
228
+ <show_in_website>0</show_in_website>
229
+ <show_in_store>1</show_in_store>
230
+ <comment>If selected, orders will be sent in batches of up to 200 every hour through a cron process. Note that only orders up to a week old from the present date will be processed. To process older orders please use the order export function below.</comment>
231
+ <depends><sendorder>1</sendorder></depends>
232
+ </batch_enabled>
233
+ <batch_size>
234
+ <label>Number of orders to process each time the batch is run</label>
235
+ <frontend_type>text</frontend_type>
236
+ <sort_order>250</sort_order>
237
+ <show_in_default>0</show_in_default>
238
+ <show_in_website>0</show_in_website>
239
+ <show_in_store>0</show_in_store>
240
+ <comment>Leave blank to send all (not recommended).</comment>
241
+ <depends><batch_enabled>1</batch_enabled></depends>
242
+ </batch_size>
243
+ <batch_only>
244
+ <label>Send in background only?</label>
245
+ <frontend_type>select</frontend_type>
246
+ <source_model>adminhtml/system_config_source_yesno</source_model>
247
+ <sort_order>240</sort_order>
248
+ <show_in_default>1</show_in_default>
249
+ <show_in_website>0</show_in_website>
250
+ <show_in_store>1</show_in_store>
251
+ <comment>Orders will only be sent in the background process.</comment>
252
+ <depends><batch_enabled>1</batch_enabled></depends>
253
+ </batch_only>
254
 
255
+ <save_latest_order translate="label">
256
+ <label>Save Latest Order Information</label>
257
+ <frontend_type>select</frontend_type>
258
+ <source_model>adminhtml/system_config_source_yesno</source_model>
259
+ <sort_order>230</sort_order>
260
+ <show_in_default>1</show_in_default>
261
+ <show_in_website>0</show_in_website>
262
+ <show_in_store>1</show_in_store>
263
+ <comment>Save information from the latest order along with the first 3 products from that order</comment>
264
+ <depends><sendorder>1</sendorder></depends>
265
+ </save_latest_order>
266
 
267
+ <heading_abandoned translate="label">
268
  <label>Abandoned Carts</label>
269
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
270
  <sort_order>300</sort_order>
273
  <show_in_store>1</show_in_store>
274
  </heading_abandoned>
275
 
276
+ <sendabandoned translate="label">
277
+ <label>Add Abandoned Carts To EmailDirect</label>
278
+ <frontend_type>select</frontend_type>
279
+ <source_model>adminhtml/system_config_source_yesno</source_model>
280
+ <sort_order>310</sort_order>
281
+ <show_in_default>1</show_in_default>
282
+ <show_in_website>0</show_in_website>
283
+ <show_in_store>1</show_in_store>
284
+ <comment>This will add any abandoned shopping carts to the EmailDirect database with AbandonedDate and AbandonedURL database fields. These fields can be used with Workflows to time your own Abandoned Shopping Cart emails or send a series of emails. This allows for complete customization of the email.</comment>
285
+ </sendabandoned>
286
+ <abandonedtime translate="label comment">
287
+ <label>Abandoned Time</label>
288
+ <frontend_type>select</frontend_type>
289
+ <source_model>emaildirect/system_config_source_time</source_model>
290
+ <sort_order>320</sort_order>
291
+ <show_in_default>1</show_in_default>
292
+ <show_in_website>0</show_in_website>
293
+ <show_in_store>1</show_in_store>
294
+ <comment>How long before a cart is considered abandoned?</comment>
295
+ <depends><sendabandoned>1</sendabandoned></depends>
296
+ </abandonedtime>
297
+ <abandonedpublication translate="label comment">
298
+ <label>Abandoned Publication</label>
299
+ <frontend_type>select</frontend_type>
300
+ <source_model>emaildirect/system_config_source_publication</source_model>
301
+ <sort_order>330</sort_order>
302
+ <show_in_default>1</show_in_default>
303
+ <show_in_website>0</show_in_website>
304
+ <show_in_store>1</show_in_store>
305
+ <can_be_empty>1</can_be_empty>
306
+ <comment>This is the Publication that you will put abandoned shoppers into</comment>
307
+ <depends><sendabandoned>1</sendabandoned></depends>
308
+ </abandonedpublication>
309
+ <abandonedlist translate="label comment">
310
+ <label>Abandoned List</label>
311
+ <frontend_type>select</frontend_type>
312
+ <source_model>emaildirect/system_config_source_abandonedlist</source_model>
313
+ <sort_order>340</sort_order>
314
+ <show_in_default>1</show_in_default>
315
+ <show_in_website>0</show_in_website>
316
+ <show_in_store>1</show_in_store>
317
+ <can_be_empty>1</can_be_empty>
318
+ <comment>This is the List that you will put abandoned shoppers into. Not Required.</comment>
319
+ <depends><sendabandoned>1</sendabandoned></depends>
320
+ </abandonedlist>
321
+ <capture_enabled translate="label">
322
+ <label>Capture guest emails?</label>
323
+ <frontend_type>select</frontend_type>
324
+ <source_model>adminhtml/system_config_source_yesno</source_model>
325
+ <sort_order>350</sort_order>
326
+ <show_in_default>1</show_in_default>
327
+ <show_in_website>0</show_in_website>
328
+ <show_in_store>1</show_in_store>
329
+ <comment>When enabled, this feature will capture guest emails from various forms within the site to be used with abandoned carts.</comment>
330
+ <depends><sendabandoned>1</sendabandoned></depends>
331
+ </capture_enabled>
332
 
333
+ <!-- SEQUENCES -->
334
+ <heading_sequence translate="label">
335
  <label>Abandoned Cart Sequences</label>
336
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
337
  <sort_order>360</sort_order>
339
  <show_in_website>0</show_in_website>
340
  <show_in_store>1</show_in_store>
341
  <depends><sendabandoned>1</sendabandoned></depends>
342
+ </heading_sequence>
343
+ <abandonedsequence_enabled>
344
+ <label>Add a sequence value to each abandoned cart?</label>
345
+ <frontend_type>select</frontend_type>
346
+ <source_model>adminhtml/system_config_source_yesno</source_model>
347
+ <sort_order>370</sort_order>
348
+ <show_in_default>1</show_in_default>
349
+ <show_in_website>0</show_in_website>
350
+ <show_in_store>1</show_in_store>
351
+ <comment>This will allow you to assign a sequence of values to your subscribers, one for each abandoned cart.</comment>
352
+ <depends><sendabandoned>1</sendabandoned></depends>
353
+ </abandonedsequence_enabled>
354
+ <abandonedsequence_field translate="label comment">
355
+ <label>Sequence Database Field</label>
356
+ <frontend_type>select</frontend_type>
357
+ <source_model>emaildirect/system_config_source_sequence</source_model>
358
+ <sort_order>380</sort_order>
359
+ <show_in_default>1</show_in_default>
360
+ <show_in_website>0</show_in_website>
361
+ <show_in_store>1</show_in_store>
362
+ <can_be_empty>1</can_be_empty>
363
+ <comment>This is the database field in EmailDirect that the sequence will be stored in.</comment>
364
+ <depends><sendabandoned>1</sendabandoned><abandonedsequence_enabled>1</abandonedsequence_enabled></depends>
365
+ </abandonedsequence_field>
366
+ <abandonedsequence_options translate="label comment">
367
+ <label>Sequence Options</label>
368
+ <frontend_type>textarea</frontend_type>
369
+ <sort_order>390</sort_order>
370
+ <show_in_default>1</show_in_default>
371
+ <show_in_website>0</show_in_website>
372
+ <show_in_store>1</show_in_store>
373
+ <can_be_empty>1</can_be_empty>
374
+ <comment>Enter one sequence per line to be appended.</comment>
375
+ <depends><sendabandoned>1</sendabandoned><abandonedsequence_enabled>1</abandonedsequence_enabled></depends>
376
+ </abandonedsequence_options>
377
 
378
+ <!-- signup -->
379
+ <heading_signup translate="label">
380
  <label>EmailDirect Signup Form</label>
381
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
382
  <sort_order>400</sort_order>
383
  <show_in_default>1</show_in_default>
384
  <show_in_website>0</show_in_website>
385
  <show_in_store>1</show_in_store>
386
+ </heading_signup>
387
+ <signup_enabled>
388
+ <label>Show EmailDirect Signup form?</label>
389
+ <frontend_type>select</frontend_type>
390
+ <source_model>adminhtml/system_config_source_yesno</source_model>
391
+ <sort_order>410</sort_order>
392
+ <show_in_default>1</show_in_default>
393
+ <show_in_website>0</show_in_website>
394
+ <show_in_store>1</show_in_store>
395
+ <comment>This will allow you to show an EmailDirect signup form in a popup.</comment>
396
+ </signup_enabled>
397
+ <signup_url>
398
+ <label>URL to Signup Form</label>
399
+ <frontend_type>text</frontend_type>
400
+ <sort_order>420</sort_order>
401
+ <show_in_default>1</show_in_default>
402
+ <show_in_website>0</show_in_website>
403
+ <show_in_store>1</show_in_store>
404
+ <comment>URL to the EmailDirect Signup Form.</comment>
405
+ <depends><signup_enabled>1</signup_enabled></depends>
406
+ </signup_url>
407
+ <signup_delay>
408
+ <label>Delay before showing</label>
409
+ <frontend_type>text</frontend_type>
410
+ <sort_order>430</sort_order>
411
+ <show_in_default>1</show_in_default>
412
+ <show_in_website>0</show_in_website>
413
+ <show_in_store>1</show_in_store>
414
+ <depends><signup_enabled>1</signup_enabled></depends>
415
+ <comment>How many seconds before the signup form is shown</comment>
416
+ </signup_delay>
417
+ <signup_recurrence>
418
+ <label>Recurrence</label>
419
+ <frontend_type>select</frontend_type>
420
+ <source_model>emaildirect/system_config_source_signup_recurrence</source_model>
421
+ <sort_order>440</sort_order>
422
+ <show_in_default>1</show_in_default>
423
+ <show_in_website>0</show_in_website>
424
+ <show_in_store>1</show_in_store>
425
+ <comment>Time until Signup Form displays again, per visitor.</comment>
426
+ <depends><signup_enabled>1</signup_enabled></depends>
427
+ </signup_recurrence>
428
+ <signup_width>
429
+ <label>Width of Form</label>
430
+ <frontend_type>text</frontend_type>
431
+ <sort_order>450</sort_order>
432
+ <show_in_default>1</show_in_default>
433
+ <show_in_website>0</show_in_website>
434
+ <show_in_store>1</show_in_store>
435
+ <depends><signup_enabled>1</signup_enabled></depends>
436
+ </signup_width>
437
+ <signup_height>
438
+ <label>Height of Form</label>
439
+ <frontend_type>text</frontend_type>
440
+ <sort_order>460</sort_order>
441
+ <show_in_default>1</show_in_default>
442
+ <show_in_website>0</show_in_website>
443
+ <show_in_store>1</show_in_store>
444
+ <depends><signup_enabled>1</signup_enabled></depends>
445
+ </signup_height>
446
+ <signup_opacity>
447
+ <label>Opacity of background</label>
448
+ <frontend_type>select</frontend_type>
449
+ <source_model>emaildirect/system_config_source_signup_opacity</source_model>
450
+ <sort_order>470</sort_order>
451
+ <show_in_default>1</show_in_default>
452
+ <show_in_website>0</show_in_website>
453
+ <show_in_store>1</show_in_store>
454
+ <depends><signup_enabled>1</signup_enabled></depends>
455
+ </signup_opacity>
456
+ <signup_test_button>
457
+ <label>Test Signup Form</label>
458
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_signup_test</frontend_model>
459
+ <sort_order>480</sort_order>
460
+ <show_in_default>1</show_in_default>
461
+ <show_in_website>0</show_in_website>
462
+ <show_in_store>1</show_in_store>
463
+ <can_be_empty>1</can_be_empty>
464
+ <comment><![CDATA[Test the signup form popup (opens in new window).<br />Note: "Show EmailDirect Signup form" must be set to "Yes" and the configuration saved in order to perform a signup test.]]></comment>
465
+ <depends><signup_enabled>1</signup_enabled></depends>
466
+ </signup_test_button>
467
+ <signup_activated>
468
+ <label>Activate Signup Form?</label>
469
+ <frontend_type>select</frontend_type>
470
+ <source_model>adminhtml/system_config_source_yesno</source_model>
471
+ <sort_order>490</sort_order>
472
+ <show_in_default>1</show_in_default>
473
+ <show_in_website>0</show_in_website>
474
+ <show_in_store>1</show_in_store>
475
+ <comment>Do not activate this form until it has been tested.</comment>
476
+ <depends><signup_enabled>1</signup_enabled></depends>
477
+ </signup_activated>
478
 
479
+ <!-- Wishlist -->
480
+ <heading_wishlist translate="label">
481
  <label>Wishlist</label>
482
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
483
  <sort_order>600</sort_order>
484
  <show_in_default>1</show_in_default>
485
  <show_in_website>0</show_in_website>
486
  <show_in_store>1</show_in_store>
487
+ </heading_wishlist>
488
+ <wishlist_enabled>
489
+ <label>Activate Wish List Alerts?</label>
490
+ <frontend_type>select</frontend_type>
491
+ <source_model>adminhtml/system_config_source_yesno</source_model>
492
+ <sort_order>610</sort_order>
493
+ <show_in_default>1</show_in_default>
494
+ <show_in_website>0</show_in_website>
495
+ <show_in_store>1</show_in_store>
496
+ <comment>Send subscriber Wishlist URL and their most recent Wishlist Date to your EmailDirect database.</comment>
497
+ </wishlist_enabled>
498
 
499
+ </fields>
500
+ </general>
501
+ <export translate="label comment">
502
+ <label>Export Options</label>
503
+ <frontend_type>text</frontend_type>
504
+ <sort_order>670</sort_order>
505
+ <show_in_default>1</show_in_default>
506
+ <show_in_website>0</show_in_website>
507
+ <show_in_store>1</show_in_store>
508
+ <expanded>1</expanded>
509
+ <fields>
510
+ <heading_orders translate="label">
511
  <label>Order Exports</label>
512
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
513
  <sort_order>5</sort_order>
516
  <show_in_store>1</show_in_store>
517
  </heading_orders>
518
  <include_already_sent translate="label">
519
+ <label>Include orders already sent?</label>
520
+ <frontend_type>select</frontend_type>
521
+ <source_model>adminhtml/system_config_source_yesno</source_model>
522
+ <sort_order>5</sort_order>
523
+ <show_in_default>1</show_in_default>
524
+ <show_in_website>0</show_in_website>
525
+ <show_in_store>1</show_in_store>
526
+ <comment>This option allows you to include or exclude orders that have been sent directly to EmailDirect through the normal order creation process.</comment>
527
+ </include_already_sent>
528
+ <export_orders_range>
529
+ <label>Order Date Range</label>
530
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_export_range</frontend_model>
531
+ <sort_order>10</sort_order>
532
+ <show_in_default>1</show_in_default>
533
+ <show_in_website>0</show_in_website>
534
+ <show_in_store>1</show_in_store>
535
+ <can_be_empty>1</can_be_empty>
536
+ <comment>Only orders within the past year can be exported</comment>
537
+ </export_orders_range>
538
+ <export_orders_button>
539
+ <label>Export Orders</label>
540
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_export_orders</frontend_model>
541
+ <sort_order>20</sort_order>
542
+ <show_in_default>1</show_in_default>
543
+ <show_in_website>0</show_in_website>
544
+ <show_in_store>1</show_in_store>
545
+ <can_be_empty>1</can_be_empty>
546
+ <comment>Export Orders to CSV and send the CSV file to Emaildirect (opens in new window)</comment>
547
+ </export_orders_button>
548
 
549
+ <heading_products translate="label">
550
  <label>Category Exports</label>
551
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
552
  <sort_order>30</sort_order>
554
  <show_in_website>0</show_in_website>
555
  <show_in_store>1</show_in_store>
556
  </heading_products>
557
+ <include_disabled translate="label">
558
+ <label>Include disabled Products?</label>
559
+ <frontend_type>select</frontend_type>
560
+ <source_model>adminhtml/system_config_source_yesno</source_model>
561
+ <sort_order>40</sort_order>
562
+ <show_in_default>1</show_in_default>
563
+ <show_in_website>0</show_in_website>
564
+ <show_in_store>1</show_in_store>
565
+ </include_disabled>
566
+ <batch translate="label comment">
567
+ <label>Batch Size</label>
568
+ <frontend_type>select</frontend_type>
569
+ <source_model>emaildirect/system_config_source_export_batch</source_model>
570
+ <sort_order>50</sort_order>
571
+ <show_in_default>0</show_in_default>
572
+ <show_in_website>0</show_in_website>
573
+ <show_in_store>0</show_in_store>
574
+ <comment>Number of Products to Export at a time (SAVE CONFIG BEFORE EXPORTING)</comment>
575
+ </batch>
576
+ <export_button>
577
+ <label>Export Products</label>
578
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_export_products</frontend_model>
579
+ <sort_order>60</sort_order>
580
+ <show_in_default>1</show_in_default>
581
+ <show_in_website>0</show_in_website>
582
+ <show_in_store>1</show_in_store>
583
+ <can_be_empty>1</can_be_empty>
584
+ <comment>Export Products to CSV and send the CSV file to Emaildirect (opens in new window)</comment>
585
+ </export_button>
586
+ <export_na>
587
+ <label>Export Not Available</label>
588
+ <frontend_type>label</frontend_type>
589
+ <sort_order>1000</sort_order>
590
+ <show_in_default>0</show_in_default>
591
+ <show_in_website>0</show_in_website>
592
+ <show_in_store>0</show_in_store>
593
+ <comment>Please setup your API Key to perform an Export</comment>
594
+ <!--<depends><setup>0</setup></depends>-->
595
+ </export_na>
596
+ </fields>
597
+ </export>
598
+ <troubleshooting translate="label comment">
599
+ <label>Troubleshooting</label>
600
+ <frontend_type>text</frontend_type>
601
+ <sort_order>900</sort_order>
602
+ <show_in_default>1</show_in_default>
603
+ <show_in_website>0</show_in_website>
604
+ <show_in_store>1</show_in_store>
605
+ <expanded>1</expanded>
606
+ <fields>
607
+ <heading_logging translate="label">
608
  <label>Logging</label>
609
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
610
  <sort_order>10</sort_order>
612
  <show_in_website>0</show_in_website>
613
  <show_in_store>1</show_in_store>
614
  </heading_logging>
615
+ <logging translate="label">
616
+ <label>Status</label>
617
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_logging</frontend_model>
618
+ <sort_order>20</sort_order>
619
+ <show_in_default>1</show_in_default>
620
+ <show_in_website>0</show_in_website>
621
+ <show_in_store>1</show_in_store>
622
+ <comment></comment>
623
+ </logging>
624
+ <heading_diagnostics translate="label">
625
  <label>Diagnostics</label>
626
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
627
  <sort_order>200</sort_order>
630
  <show_in_store>1</show_in_store>
631
  </heading_diagnostics>
632
  <diagnostics translate="label">
633
+ <label>Status</label>
634
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_diagnostics</frontend_model>
635
+ <sort_order>210</sort_order>
636
+ <show_in_default>1</show_in_default>
637
+ <show_in_website>0</show_in_website>
638
+ <show_in_store>1</show_in_store>
639
+ <comment></comment>
640
+ </diagnostics>
641
+ </fields>
642
+ </troubleshooting>
643
+ </groups>
644
+ </emaildirect>
645
+ </sections>
646
  </config>
app/code/community/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-2.0.0-2.0.14.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try
8
+ {
9
+ $this->run("
10
+
11
+ DROP TABLE IF EXISTS {$this->getTable('emaildirect/subscriber')};
12
+ CREATE TABLE {$this->getTable('emaildirect/subscriber')} (
13
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
14
+ `email` varchar(255) NULL,
15
+ `date_sent` TIMESTAMP NULL,
16
+ PRIMARY KEY (`id`),
17
+ KEY `idx_date_sent` (`date_sent`),
18
+ KEY `idx_email` (`email`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
+
21
+ ");
22
+ }
23
+ catch (Exception $e)
24
+ {
25
+ $this->install_log($e->getMessage());
26
+ }
27
+
28
+ $installer->endSetup();
app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/trouble.phtml DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
- $element = $this->getElement();
3
-
4
- $enabled = $this->isLoggingEnabled();
5
-
6
- $enabled = true;
7
- ?>
8
- <div id="<?php echo $this->getElement()->getHtmlId(); ?>" style='display:none'></div>
9
- <span class='trouble_status'>Status: <strong><?php if ($enabled) echo "Enabled"; else echo "Disabled" ?></strong></span>
10
-
11
- <div id='emaildirect_trouble_details'>
12
- <?php if ($enabled): ?>
13
- <table>
14
- <tr>
15
- <td>Start Date:</td>
16
- <td><?php echo $this->getStartDate() ?></td>
17
- </tr>
18
- <tr>
19
- <td>Log File:</td>
20
- <td><?php echo $this->getLogInfo() ?></td>
21
- </tr>
22
- <tr>
23
- <td>EmailDirect:</td>
24
- <td><?php echo $this->getEDirectInfo() ?></td>
25
- </tr>
26
- <tr>
27
- <td>Abandoned Carts:</td>
28
- <td><?php echo $this->getAbandonedInfo() ?></td>
29
- </tr>
30
- </table>
31
- <p>Now that Troubleshooting is enabled you need to perform the actions that are currently not sending data to EmailDirect.</p>
32
- <p>See the lists below to troubleshoot the areas you are having problems with.</p>
33
- <p>
34
- <strong>Abandoned Carts: </strong>
35
- <ul>
36
- <li>Make sure Abandoned Carts are enabled (see above).</li>
37
- <li>Abandon at least one cart in the front end of your store. You must have a logged in account (or captured email) for a cart to be abandoned.</li>
38
- <li>To test whether cron is working, wait at least one hour for the abandoned process to run before sending the report.</li>
39
- <li>Go to the <a href='<?php echo $this->getUrl('ed_integration/admin_abandoned/index'); ?>'>Abandoned Carts page</a> and click "Run Now" to see if it works without cron.</li>
40
- </ul>
41
- </p>
42
- <p>
43
- <strong>Orders: </strong>
44
- <ul>
45
- <li>Create at least one order and process it in the Admin until it is complete.</li>
46
- <li>To test Shipping Tracking, save a tracking number for a completed order.</li>
47
- </ul>
48
- </p>
49
- <p>
50
- <strong>Customers: </strong>
51
- <ul>
52
- <li>Add a new customer with any additional fields you have mapped.</li>
53
- <li>Update a customers information and subscription preferences.</li>
54
- </ul>
55
- </p>
56
- <?php endif; ?>
57
- <button id='emaildirect_send_trouble' onClick="view_details(); return false;">View information to Send to EmailDirect</button>
58
- </div>
59
-
60
- <script type='text/javascript'>
61
- function toggle_trouble()
62
- {
63
- var form = $('config_edit_form');
64
- var trouble = form['<?php echo $element->getName() ?>'];
65
- var val = $(trouble).getValue()
66
-
67
- val = 1 - val;
68
-
69
- $(trouble).setValue(val);
70
- }
71
- function view_details()
72
- {
73
- var form = $('config_edit_form');
74
- var url = '<?php echo Mage::helper('emaildirect')->getAdminUrl("ed_integration/admin_troubleshooting/"); ?>';
75
-
76
- window.location = url;
77
- }
78
-
79
- <?php if ($this->getElement()->getDisabled()):?>
80
- toggleValueElements({checked:true}, $('emaildirect_trouble').parentNode);
81
- <?php endif;?>
82
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/emaildirect/troubleshooting/view/tab/help.phtml CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
  $customer_fields = $this->getCustomerFields();
3
  $address_fields = $this->getAddressFields();
4
  $shipping_fields = $this->getShippingFields();
@@ -23,7 +23,7 @@ API Key tab.</p>
23
  <h4>Additional Lists</h4>
24
  <p>These are all of the Lists in your EmailDirect account. Selecting one or many list in this table will enable your customers to signup for sub segments, on top of the Publication. These can easily be used to get more information on specifi c topics/categories that your customers are interested in.</p>
25
  <h4>Source</h4>
26
- <p>This will allow you to defi ne the Source which will be associated with the emails added to your EmailDirect
27
  account.</p>
28
  <h4>Override Source</h4>
29
  <p>Selecting Yes will update the Source for any subscribers that may already be in your EmailDirect
1
+ <?php
2
  $customer_fields = $this->getCustomerFields();
3
  $address_fields = $this->getAddressFields();
4
  $shipping_fields = $this->getShippingFields();
23
  <h4>Additional Lists</h4>
24
  <p>These are all of the Lists in your EmailDirect account. Selecting one or many list in this table will enable your customers to signup for sub segments, on top of the Publication. These can easily be used to get more information on specifi c topics/categories that your customers are interested in.</p>
25
  <h4>Source</h4>
26
+ <p>This will allow you to define the Source which will be associated with the emails added to your EmailDirect
27
  account.</p>
28
  <h4>Override Source</h4>
29
  <p>Selecting Yes will update the Source for any subscribers that may already be in your EmailDirect
app/design/adminhtml/default/default/template/emaildirect/troubleshooting/view/tab/settings.phtml CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
  $status = $this->getLoggingStatus();
3
- $areas = Mage::helper('emaildirect/troubleshooting')->getAreas();
4
 
5
  $logging_enabled = $this->getSetting('logging_enabled') == 1;
6
  $advanced_enabled = $this->getSetting('logging_advanced_enabled') == 1;
@@ -14,12 +14,12 @@ $diagnostic_enabled = Mage::helper('emaildirect/troubleshooting')->isDiagnosticE
14
  <h4>Troubleshooting Settings</h4>
15
  </div>
16
  <div id="_accountbase_fieldset" class="fieldset ">
17
-
18
-
19
  <div class="hor-scroll">
20
  <form id='emaildirect_settings_form' action='<?php echo Mage::helper('emaildirect')->getAdminUrl("ed_integration/admin_troubleshooting/save"); ?>' method='post'>
21
- <input type="hidden" name="form_key" value="<? echo $this->getFormKey(); ?>" />
22
-
23
  <table cellspacing="0" class="form-list">
24
  <tbody>
25
  <tr class="system-fieldset-sub-head"><td colspan="2"><h4>Logging</h4></td></tr>
@@ -84,7 +84,7 @@ $diagnostic_enabled = Mage::helper('emaildirect/troubleshooting')->isDiagnosticE
84
  <option value='all'>All</option>
85
  <option value='selected' <?php if ($this->getSetting('logging_areas') == "selected") echo "selected='selected'" ?>>Selected</option>
86
  </select>
87
-
88
  <table cellspacing="0" class='troubleshooting_details' id='troubleshooting_areas' <?php if ($this->getSetting('logging_areas') == "all") echo "style='display:none'" ?>>
89
  <tbody>
90
  <?php foreach ($status['areas'] as $key => $area): ?>
@@ -115,7 +115,7 @@ $diagnostic_enabled = Mage::helper('emaildirect/troubleshooting')->isDiagnosticE
115
  <td class="label"><label for="duration">Duration</label></td>
116
  <td class="value">
117
  <?php $duration_options = $this->getDurationOptions();
118
- $duration = $this->getSetting('logging_duration');
119
  ?>
120
  <select name='logging_duration' id='logging_duration'>
121
  <?php foreach ($duration_options as $value => $label): ?>
@@ -156,22 +156,22 @@ function addIP()
156
  var current = $('ip_address').value;
157
  if (current != "")
158
  current += ",";
159
-
160
  current += '<?php echo $this->getCurrentIP(); ?>';
161
-
162
-
163
-
164
  console.log(current);
165
-
166
  $('ip_address').value = current;
167
-
168
  return false;
169
  }
170
 
171
  function toggle(evt, target, value)
172
  {
173
  var elem = Event.element(evt);
174
-
175
  if (elem)
176
  {
177
  if (elem.value == value)
@@ -199,7 +199,7 @@ function toggleAdvanced(evt)
199
  function toggleAdvancedRow(evt)
200
  {
201
  toggle(evt,'logging_advanced_row','no');
202
-
203
  //console.log($('logging_advanced_enabled').value);
204
  if ($('logging_advanced_enabled').value == 'enabled')
205
  $('advanced_settings').show();
1
+ <?php
2
  $status = $this->getLoggingStatus();
3
+ $areas = Mage::helper('emaildirect/troubleshooting')->getAreas();
4
 
5
  $logging_enabled = $this->getSetting('logging_enabled') == 1;
6
  $advanced_enabled = $this->getSetting('logging_advanced_enabled') == 1;
14
  <h4>Troubleshooting Settings</h4>
15
  </div>
16
  <div id="_accountbase_fieldset" class="fieldset ">
17
+
18
+
19
  <div class="hor-scroll">
20
  <form id='emaildirect_settings_form' action='<?php echo Mage::helper('emaildirect')->getAdminUrl("ed_integration/admin_troubleshooting/save"); ?>' method='post'>
21
+ <input type="hidden" name="form_key" value="<?php echo $this->getFormKey(); ?>" />
22
+
23
  <table cellspacing="0" class="form-list">
24
  <tbody>
25
  <tr class="system-fieldset-sub-head"><td colspan="2"><h4>Logging</h4></td></tr>
84
  <option value='all'>All</option>
85
  <option value='selected' <?php if ($this->getSetting('logging_areas') == "selected") echo "selected='selected'" ?>>Selected</option>
86
  </select>
87
+
88
  <table cellspacing="0" class='troubleshooting_details' id='troubleshooting_areas' <?php if ($this->getSetting('logging_areas') == "all") echo "style='display:none'" ?>>
89
  <tbody>
90
  <?php foreach ($status['areas'] as $key => $area): ?>
115
  <td class="label"><label for="duration">Duration</label></td>
116
  <td class="value">
117
  <?php $duration_options = $this->getDurationOptions();
118
+ $duration = $this->getSetting('logging_duration');
119
  ?>
120
  <select name='logging_duration' id='logging_duration'>
121
  <?php foreach ($duration_options as $value => $label): ?>
156
  var current = $('ip_address').value;
157
  if (current != "")
158
  current += ",";
159
+
160
  current += '<?php echo $this->getCurrentIP(); ?>';
161
+
162
+
163
+
164
  console.log(current);
165
+
166
  $('ip_address').value = current;
167
+
168
  return false;
169
  }
170
 
171
  function toggle(evt, target, value)
172
  {
173
  var elem = Event.element(evt);
174
+
175
  if (elem)
176
  {
177
  if (elem.value == value)
199
  function toggleAdvancedRow(evt)
200
  {
201
  toggle(evt,'logging_advanced_row','no');
202
+
203
  //console.log($('logging_advanced_enabled').value);
204
  if ($('logging_advanced_enabled').value == 'enabled')
205
  $('advanced_settings').show();
app/design/adminhtml/default/default/template/emaildirect/troubleshooting/view/tab/submit.phtml CHANGED
@@ -13,7 +13,7 @@
13
  <div id="_accountbase_fieldset" class="fieldset ">
14
  <div class="hor-scroll">
15
  <form id='emaildirect_submit_form' action='<?php echo $this->getUrl("ed_integration/admin_troubleshooting/send"); ?>' method='post'>
16
- <input type="hidden" name="form_key" value="<? echo $this->getFormKey(); ?>" />
17
  <table cellspacing="0" class="form-list">
18
  <tbody>
19
  <tr>
13
  <div id="_accountbase_fieldset" class="fieldset ">
14
  <div class="hor-scroll">
15
  <form id='emaildirect_submit_form' action='<?php echo $this->getUrl("ed_integration/admin_troubleshooting/send"); ?>' method='post'>
16
+ <input type="hidden" name="form_key" value="<?php echo $this->getFormKey(); ?>" />
17
  <table cellspacing="0" class="form-list">
18
  <tbody>
19
  <tr>
app/design/frontend/base/default/layout/emaildirect.xml CHANGED
@@ -31,25 +31,22 @@
31
  </action>
32
  </reference>
33
  </customer_account>
 
34
  <customer_account_index>
35
- <reference name="my.account.wrapper">
36
- <reference name="customer_account_dashboard">
37
- <block type="emaildirect/customer_account_dashboard_info" name="emaildirect.customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml">
38
- <action method="setTemplate" ifconfig="emaildirect/general/active">
39
- <template>emaildirect/customer/account/dashboard/info.phtml</template>
40
- </action>
41
- </block>
42
- </reference>
43
  </reference>
44
  </customer_account_index>
45
 
46
  <emaildirect_customer_account_index>
47
- <label>Customer My Account Emaildirect</label>
48
- <update handle="customer_account"/>
49
- <reference name="my.account.wrapper">
50
  <block type="emaildirect/customer_account_lists" name="emaildirect_additionallists" template="emaildirect/customer/account/lists.phtml" />
51
  <block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
52
- </reference>
53
  </emaildirect_customer_account_index>
54
  <!-- Customer -->
55
  </layout>
31
  </action>
32
  </reference>
33
  </customer_account>
34
+
35
  <customer_account_index>
36
+ <reference name="customer_account_dashboard_info">
37
+ <action method="setTemplate" ifconfig="emaildirect/general/active">
38
+ <template>emaildirect/customer/account/dashboard/info.phtml</template>
39
+ </action>
 
 
 
 
40
  </reference>
41
  </customer_account_index>
42
 
43
  <emaildirect_customer_account_index>
44
+ <label>Customer My Account Emaildirect</label>
45
+ <update handle="customer_account"/>
46
+ <reference name="my.account.wrapper">
47
  <block type="emaildirect/customer_account_lists" name="emaildirect_additionallists" template="emaildirect/customer/account/lists.phtml" />
48
  <block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
49
+ </reference>
50
  </emaildirect_customer_account_index>
51
  <!-- Customer -->
52
  </layout>
app/design/frontend/base/default/template/emaildirect/customer/account/lists.phtml CHANGED
@@ -13,7 +13,7 @@ $list_data = $subscriptions['lists'];
13
  <div class="fieldset">
14
  <?php echo $this->getBlockHtml('formkey'); ?>
15
  <ul class="emaildirect-additional-lists">
16
- <li class="listdata">General Subscription: <?php echo $this->showCheckbox($publication_data, 'publication'); ?>
17
  </ul>
18
  <br />
19
  <?php if (count($list_data) > 0): ?>
@@ -39,7 +39,7 @@ $list_data = $subscriptions['lists'];
39
  $$('.emaildirect-publication-subscriber').first().observe('change', function()
40
  {
41
  var groupings = $$('.emaildirect-list-subscriber');
42
-
43
  if(groupings)
44
  {
45
  if(this.checked)
13
  <div class="fieldset">
14
  <?php echo $this->getBlockHtml('formkey'); ?>
15
  <ul class="emaildirect-additional-lists">
16
+ <li class="listdata">General Subscription: <?php echo $this->showCheckbox($publication_data, 'publication'); ?></li>
17
  </ul>
18
  <br />
19
  <?php if (count($list_data) > 0): ?>
39
  $$('.emaildirect-publication-subscriber').first().observe('change', function()
40
  {
41
  var groupings = $$('.emaildirect-list-subscriber');
42
+
43
  if(groupings)
44
  {
45
  if(this.checked)
package.xml CHANGED
@@ -1,20 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>EmailDirect_Integration</name>
4
- <version>2.0.13</version>
5
  <stability>stable</stability>
6
  <license/>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>EmailDirect integration for magento</summary>
10
  <description>EmailDirect integration for magento</description>
11
- <notes>Abandoned Cart process improvements.&#xD;
12
- &#xD;
13
- Improved HTTPS support.</notes>
14
  <authors><author><name>Kevin Linden</name><user>auto-converted</user><email>Kevin@EmailDirect.com</email></author></authors>
15
- <date>2015-03-06</date>
16
- <time>21:03:27</time>
17
- <contents><target name="magecommunity"><dir name="EmailDirect"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Abandoned"><dir name="Details"><dir name="Tab"><dir name="Diagnostics"><file name="Status.php" hash="8706487c8f465a5ce762cd923258bb35"/></dir><file name="Cart.php" hash="09e9331f6c72157f581ad7135b7f147c"/><file name="Diagnostics.php" hash="eba18ce04ccb125ce4aa6ed5e473734a"/></dir><file name="Abstract.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="Form.php" hash="dffc6e49eb95db2f83050706eee1fd55"/></dir><file name="Details.php" hash="9f98f4dd9ea741f9f7dd2eb018af0d7d"/><file name="Grid.php" hash="e0a15673636acb7e113fdf6e3bcd8879"/><file name="Status.php" hash="9a740fd8c63148532bbcf07d19f462df"/><file name="Tabs.php" hash="19e184e72777dfc5b0c35b7027a3e1cf"/></dir><dir name="Diagnostics"><dir name="Status"><file name="Abstract.php" hash="4a54d82d748f880fc5bb8263935ddc98"/></dir></dir><dir name="Order"><dir name="View"><dir name="Tab"><dir name="Diagnostics"><file name="Status.php" hash="b4dd8410aa9ce649e603762d5d14f314"/></dir><file name="Diagnostics.php" hash="91bb6af0c9a0e6f41d2575651e8a59ef"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="25796ead15053f86d7adcd551b8b49e7"/></dir><dir name="Form"><dir name="Field"><dir name="Export"><file name="Orders.php" hash="5b101fadb6a64044b276eb07b21cf0a5"/><file name="Products.php" hash="32e13d4b7250890bf84aba87f25de03c"/><file name="Range.php" hash="4adac96fa53fa8e1449bae943a8cca80"/></dir><dir name="Signup"><file name="Test.php" hash="3b773dda25c62bc8cb28031931d67f9f"/></dir><file name="Addressmapfields.php" hash="97b75c8340d561e863a3985ad73ce228"/><file name="Api.php" hash="77dabda85973dc72227937397392c411"/><file name="Common.php" hash="6a86cce53f6df6857ea79241fa281939"/><file name="Diagnostics.php" hash="7efe5c8b90db90e9c512842388d3263d"/><file name="Info.php" hash="246de52ea5d2349ecd7f103cbba8cb8f"/><file name="Logging.php" hash="53b0b7d28d2680e479bfa89b6884802d"/><file name="Mapfields.php" hash="16894c5d76df1293e63128e349700e05"/><file name="Note.php" hash="ef99a474bbc3a828c7a618132a80fe66"/><file name="Shippingmapfields.php" hash="589a74260f394a5eae1b57ca89a74a8b"/><file name="Troubleshooting.php" hash="ff22589730034e7742978e884766d139"/></dir></dir></dir><dir name="Convert"><dir name="Profile"><dir name="Export"><file name="Orders.php" hash="947af2b0d8e3f7bc47c47b32cd434f18"/><file name="Products.php" hash="3f93e4789dbeb6710cd2742587d61726"/></dir><file name="Export.php" hash="ba879607ac0693e9db6251bbbc1676a1"/></dir></dir></dir><dir name="Troubleshooting"><dir name="View"><dir name="Tab"><file name="Download.php" hash="619916677df7c833e559aae74dae2aa0"/><file name="Help.php" hash="ad4007af59687653f4d6692f2b42b31d"/><file name="Info.php" hash="be5c15da32ef0e042c53d8ac007f8bd6"/><file name="Log.php" hash="a61e66923a287beee5910511b7282a0a"/><file name="Settings.php" hash="f15e57cdc6539c4da84042c98f0ab25c"/><file name="Submit.php" hash="81ae0e0636b66a329cf8f39939788d1d"/></dir><file name="Form.php" hash="e527a3a2335b109c48a69f06c1b0d01f"/></dir><file name="Status.php" hash="d140afcad424ff531bebb412539d6f1c"/><file name="Tabs.php" hash="5d4168cec60212beb87997e6391282e9"/><file name="View.php" hash="47efa0685db07fb73544ad477a0e2c85"/></dir><file name="Abandoned.php" hash="1ee964e54b38a6c24c09f7b3aa6ce411"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="12f6e5c467fb632e11c9ced35c82ebe6"/></dir><dir name="Customer"><dir name="Account"><file name="Lists.php" hash="e1b911c77a78995d3b3390363926ae5a"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><dir name="Abandoned"><file name="Minutes.php" hash="e311f6de480fd4b63aee7f46ea412372"/></dir><file name="Action.php" hash="bf2243f50c9c6dafca26a5bcb889f372"/></dir></dir></dir></dir><file name="Capture.php" hash="e44034ad875957a566d3ac89abb408ed"/><file name="Signup.php" hash="c51c2e5cb93978170a65dc4b69d197bf"/></dir><dir name="Controller"><dir name="Front"><file name="Abstract.php" hash="48d93179d5f8a6b416fd82dd8763daf9"/></dir></dir><dir name="Helper"><file name="Abandoned.php" hash="7910bd8db8a030ae22adae9469d91fe7"/><file name="Data.php" hash="0feafdc257fb6666c35d91e10d6f6350"/><file name="Diagnostic.php" hash="68867fd906405a6be98e14c1568437b6"/><file name="Fields.php" hash="5fa737c45be172f55fe965975aa6db52"/><file name="Order.php" hash="11404d27039db36e1b71bd5c4b97b6fa"/><file name="Troubleshooting.php" hash="cf422b72b445a86326e73cbc6f506e18"/></dir><dir name="Model"><dir name="Abandoned"><file name="Observer.php" hash="00f8e4f8186a6c800df932b74b147844"/></dir><dir name="Configuration"><file name="Observer.php" hash="9a188656d5f7d73c91bf4221cc6e4aac"/></dir><dir name="Customer"><file name="Observer.php" hash="cef8d32ba304c51b448343555ea6a066"/></dir><dir name="Mysql4"><dir name="Abandoned"><file name="Collection.php" hash="1a9129267942a98ac3830ceaf714c2ab"/></dir><dir name="Order"><file name="Collection.php" hash="43d343562cf7e54f1b36315aa5d1d4a7"/></dir><dir name="Session"><file name="Collection.php" hash="7d6a8283fdbc1207d709e2bbbc78906d"/></dir><file name="Abandoned.php" hash="485b3771906783d383de75ae9761e55c"/><file name="Order.php" hash="8d538a5737095a1ba0ad448c027b3afb"/><file name="Session.php" hash="516eeeb28038416dc885ed7af6a8a8b0"/></dir><dir name="Newsletter"><file name="Observer.php" hash="b3365f1de331f3bca220322af3fefe3f"/></dir><dir name="Observer"><file name="Abstract.php" hash="1db39dc86bed51af1d2a3b4df50099bd"/></dir><dir name="Order"><file name="Observer.php" hash="81416e0d6f8ce63513aae67a53005eb9"/></dir><dir name="Resource"><file name="Setup.php" hash="5435dccf0f14ec402018bb45af56ecb5"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Export"><file name="Batch.php" hash="96c51fc5c0b947750be4e612e32c83ab"/></dir><dir name="Send"><file name="Field.php" hash="8ecffa8ccce40f3b2db6513b24eb9200"/></dir><dir name="Signup"><file name="Opacity.php" hash="8eabed4c72e7347f0376c3d4cc1023a7"/><file name="Recurrence.php" hash="e11200bbc204b00486c373d8a4e6675e"/></dir><file name="Abandoned.php" hash="9881811b94f38be90bd20a99951a1903"/><file name="Abandonedlist.php" hash="b81d7f2cb03b8482debea5cd6a2bd1c5"/><file name="Additionallist.php" hash="9f109ab04c7ae7832887572b26868e3a"/><file name="Checkoutsubscribe.php" hash="fd90252a1f19649a420dae136ad2a2ba"/><file name="List.php" hash="84c1c8e27f579d5d33992fcb15202748"/><file name="Publication.php" hash="a5bc0192605fc558fe59b37cc0462825"/><file name="Sequence.php" hash="a599f218882d2cfc68dfcf4d58a98a41"/><file name="Source.php" hash="44815cbf4ac6443032df1e7d9c4cadef"/><file name="States.php" hash="a746affc786d8165a98801e68cbf80ab"/><file name="Statuses.php" hash="9844a7a9c3b5c68df45c8f6c518acf16"/><file name="Time.php" hash="8acbb5cb33e66de1e408cf55d17a9398"/></dir></dir></dir><dir name="Wrapper"><file name="Abandoned.php" hash="ef81d36a7276737f2d0aa1a5d783a83b"/><file name="Abstract.php" hash="9e97ce6a12e0d074921bb3a1391f3648"/><file name="Database.php" hash="3cceb467358d13584baff58c043762ec"/><file name="Execute.php" hash="e38737d197b2ccd6700ec87ec1836456"/><file name="Ftp.php" hash="d5335cfb68f99761d6902dd390a3d7a8"/><file name="Lists.php" hash="425d64b9256bbdbafa899c4138e78368"/><file name="Orders.php" hash="66be3441f9204048279fb4921a04e375"/><file name="Publications.php" hash="1bebd172a8bba669d075f09589785652"/><file name="Sources.php" hash="c6caf0274f7d0c50114324bc47a490c4"/><file name="Subscribers.php" hash="f9abcadf5b793640a4301495462d6ea7"/><file name="Wishlist.php" hash="2ceb111bbeaa06c4f13f61281aaa5b5e"/></dir><file name="Abandoned.php" hash="93bd43b59b143dec15858a6fba6ae568"/><file name="Observer.php" hash="24d421b11e04e228cbdf3eee0b852572"/><file name="Order.php" hash="b21426543cd46f799cd0743525120fb8"/><file name="Session.php" hash="c56ecf779dbfb2dae0030935af31911a"/></dir><dir name="controllers"><dir name="Admin"><file name="AbandonedController.php" hash="7366ad52662d5494e1b0e65988ee1dc7"/><file name="DiagnosticController.php" hash="aa0f4e9bf3c22124c61c3f46729372a9"/><file name="ExportController.php" hash="3ff11560de77d99bccb2cc257d14b8ab"/><file name="TroubleshootingController.php" hash="52847165f3c24c955832455e2c27a7a6"/></dir><dir name="Customer"><file name="AccountController.php" hash="91942750c1c3d20dc31159c1ffbe8200"/></dir><file name="AbandonedController.php" hash="39c9d1a72bca9369a3121ac15f68558e"/><file name="CaptureController.php" hash="89e043bb3864617a062e915d2209dcf4"/><file name="ExportController.php" hash="7ca147debc5c1436b3bf2d9501592f33"/><file name="SignupController.php" hash="fe975d44cc11f1270d34d9d82c7d4be9"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5501d4faf3da5ba1e380017b9608e1e8"/><file name="config.xml" hash="f8cdab6f6674d26aeef7027b46791b61"/><file name="system.xml" hash="4d641ef9e5c3a17fa1cd3b3d790f816a"/></dir><dir name="sql"><dir name="emaildirect_setup"><file name="mysql4-install-2.0.0.php" hash="bdc5e09fe949b36534c50c85fd198e66"/><file name="mysql4-upgrade-1.5.8-2.0.0.php" hash="8f33c7f6dca96cfa8210ec1fe016d95b"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="emaildirect"><file name="emaildirect-tab.png" hash="9ddb077b74a7078ac509d79b024631a1"/><file name="emaildirect.css" hash="61d3d7b29b97f75023f2232cae6eb0c1"/><file name="logo.png" hash="2e7e39ced387c798ef27b77dd69f073e"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="emaildirect"><dir name="images"><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir><file name="emaildirect.css" hash="c9caf9ea168efa3b0d6f4b881bcf093c"/><file name="integration.js" hash="7980204c0f594b180b9fa336954c9229"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="7767cd483e20d1930c0f1d79fee03b2a"/></dir><dir name="template"><dir name="emaildirect"><dir name="abandoned"><dir name="details"><dir name="tab"><dir name="diagnostics"><file name="status.phtml" hash="24829356b9dba966e53fb1cfe0f192b6"/></dir><file name="cart.phtml" hash="be7ca2b147fc836c2ca547b290ffe841"/></dir><file name="form.phtml" hash="60633d212382770e99d11d24ae919e47"/></dir><file name="details.phtml" hash="9d467b97a2d773aec950bea7061c6730"/><file name="status.phtml" hash="9e7723dc1fe5f8693345db9cc7cda808"/></dir><dir name="order"><dir name="view"><dir name="tab"><dir name="diagnostics"><file name="status.phtml" hash="a3bdecb1ec08903dd1b61dce6992e190"/></dir></dir></dir></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="176f3ddb8ea667a64a06967351526f3c"/></dir><dir name="form"><dir name="field"><dir name="export"><file name="date_range.phtml" hash="6a37b1e58456e1dcec734c48deb8c0c1"/><file name="orders.phtml" hash="1dfa19a712b18d2c95c2f4b938f6acef"/><file name="products.phtml" hash="098b7b21b6424c2a4eea26194883a623"/></dir><dir name="signup"><file name="test.phtml" hash="636501cd90c6ab4231bea54efb16b2ff"/></dir><file name="api.phtml" hash="468f33b2a23dbe2828489c1620000c74"/><file name="array.phtml" hash="5415eeff311735624354468c886d39b5"/><file name="diagnostics.phtml" hash="3327dba9e03362077f7562e3045180b7"/><file name="info.phtml" hash="44ab79fdfc5fb5b0cd7e15e79bfd9502"/><file name="logging.phtml" hash="3c7bd2a6f48a84efca1d0f1e75097a8a"/><file name="note.phtml" hash="6625a3771ba10daba5ded5570574716f"/><file name="trouble.phtml" hash="fe706c8465a404ae8fd9cf645db0491c"/></dir></dir><file name="setup_check.phtml" hash="1814302f58a15fb1629446e074a7e1e0"/></dir><dir name="convert"><dir name="profile"><file name="export.phtml" hash="c829eeccb120ffe4c0b9f0ddf9c7ff9a"/></dir></dir></dir><dir name="troubleshooting"><dir name="view"><dir name="tab"><file name="download.phtml" hash="d5701a0af7a8f308467fa5552d0de6b2"/><file name="help.phtml" hash="e1cb1209995b357bdbceb45a4197e17f"/><file name="info.phtml" hash="bd19bb1072ce1d60a4fb7bda660a0ce7"/><file name="log.phtml" hash="724a65165770bc92ed08ea32d20c1fe7"/><file name="settings.phtml" hash="b8661b58c492283b6670c377803fd03f"/><file name="submit.phtml" hash="2929f5910bcd809777d6f4634717d93e"/></dir><file name="form.phtml" hash="d2338bfe3598e9315ca8f5ac8d9b5516"/></dir><file name="status.phtml" hash="fac61e17efe7bd4cf67a47eb67786496"/><file name="view.phtml" hash="6ddfc8c6efe25d30e63f792b19a95c84"/></dir><file name="diagnostics.phtml" hash="f1f43a89824cad9f39e599df21ac44b4"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="d042caab36fccbb10ded229b26971a2f"/></dir><dir name="template"><dir name="emaildirect"><dir name="capture"><file name="email.phtml" hash="fa273ff1a48a12eb386f58f3e3e78f66"/></dir><dir name="checkout"><file name="subscribe.phtml" hash="d57eb93aab4e0f1d58f1ec8b9ed24c50"/></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="50ebf53c50e5e0419dd86a6d5faa2bf9"/></dir><file name="lists.phtml" hash="4c697dcfa63ece1db7885cadb02982d1"/></dir></dir><dir name="signup"><file name="form.phtml" hash="3d483079d29b79ad4daf306228120c0f"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="newsletter_subscr_success_emaildirect.html" hash="f6afb69d207bbc3f8920e7a72ac9dd07"/><file name="newsletter_unsub_success_emaildirect.html" hash="bd9f97e8f5485180d4420097b5200ef4"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EmailDirect_Integration.xml" hash="90a441f2d0dff6c247f810274e8a76ab"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>EmailDirect_Integration</name>
4
+ <version>2.0.14</version>
5
  <stability>stable</stability>
6
  <license/>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>EmailDirect integration for magento</summary>
10
  <description>EmailDirect integration for magento</description>
11
+ <notes>Cron warning fix</notes>
 
 
12
  <authors><author><name>Kevin Linden</name><user>auto-converted</user><email>Kevin@EmailDirect.com</email></author></authors>
13
+ <date>2015-07-30</date>
14
+ <time>04:47:36</time>
15
+ <contents><target name="magecommunity"><dir name="EmailDirect"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Abandoned"><dir name="Details"><dir name="Tab"><dir name="Diagnostics"><file name="Status.php" hash="8706487c8f465a5ce762cd923258bb35"/></dir><file name="Cart.php" hash="09e9331f6c72157f581ad7135b7f147c"/><file name="Diagnostics.php" hash="eba18ce04ccb125ce4aa6ed5e473734a"/></dir><file name="Form.php" hash="dffc6e49eb95db2f83050706eee1fd55"/></dir><file name="Details.php" hash="9f98f4dd9ea741f9f7dd2eb018af0d7d"/><file name="Grid.php" hash="e0a15673636acb7e113fdf6e3bcd8879"/><file name="Status.php" hash="9a740fd8c63148532bbcf07d19f462df"/><file name="Tabs.php" hash="19e184e72777dfc5b0c35b7027a3e1cf"/></dir><dir name="Diagnostics"><dir name="Status"><file name="Abstract.php" hash="4a54d82d748f880fc5bb8263935ddc98"/></dir></dir><dir name="Order"><dir name="View"><dir name="Tab"><dir name="Diagnostics"><file name="Status.php" hash="b4dd8410aa9ce649e603762d5d14f314"/></dir><file name="Diagnostics.php" hash="91bb6af0c9a0e6f41d2575651e8a59ef"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="25796ead15053f86d7adcd551b8b49e7"/></dir><dir name="Form"><dir name="Field"><dir name="Export"><file name="Orders.php" hash="5b101fadb6a64044b276eb07b21cf0a5"/><file name="Products.php" hash="32e13d4b7250890bf84aba87f25de03c"/><file name="Range.php" hash="4adac96fa53fa8e1449bae943a8cca80"/></dir><dir name="Signup"><file name="Test.php" hash="3b773dda25c62bc8cb28031931d67f9f"/></dir><file name="Addressmapfields.php" hash="97b75c8340d561e863a3985ad73ce228"/><file name="Api.php" hash="77dabda85973dc72227937397392c411"/><file name="Common.php" hash="6a86cce53f6df6857ea79241fa281939"/><file name="Diagnostics.php" hash="7efe5c8b90db90e9c512842388d3263d"/><file name="Info.php" hash="246de52ea5d2349ecd7f103cbba8cb8f"/><file name="Logging.php" hash="53b0b7d28d2680e479bfa89b6884802d"/><file name="Mapfields.php" hash="16894c5d76df1293e63128e349700e05"/><file name="Note.php" hash="ef99a474bbc3a828c7a618132a80fe66"/><file name="Shippingmapfields.php" hash="589a74260f394a5eae1b57ca89a74a8b"/></dir></dir></dir><dir name="Convert"><dir name="Profile"><dir name="Export"><file name="Orders.php" hash="947af2b0d8e3f7bc47c47b32cd434f18"/><file name="Products.php" hash="3f93e4789dbeb6710cd2742587d61726"/></dir><file name="Export.php" hash="ba879607ac0693e9db6251bbbc1676a1"/></dir></dir></dir><dir name="Troubleshooting"><dir name="View"><dir name="Tab"><file name="Download.php" hash="619916677df7c833e559aae74dae2aa0"/><file name="Help.php" hash="ad4007af59687653f4d6692f2b42b31d"/><file name="Info.php" hash="be5c15da32ef0e042c53d8ac007f8bd6"/><file name="Log.php" hash="a61e66923a287beee5910511b7282a0a"/><file name="Settings.php" hash="f15e57cdc6539c4da84042c98f0ab25c"/><file name="Submit.php" hash="81ae0e0636b66a329cf8f39939788d1d"/></dir><file name="Form.php" hash="e527a3a2335b109c48a69f06c1b0d01f"/></dir><file name="Status.php" hash="d140afcad424ff531bebb412539d6f1c"/><file name="Tabs.php" hash="5d4168cec60212beb87997e6391282e9"/><file name="View.php" hash="47efa0685db07fb73544ad477a0e2c85"/></dir><file name="Abandoned.php" hash="6e51c09f3c9d491f14ee6ecfb7f33f08"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="a49c1e7f612d379e6509658a56f53d7d"/></dir><dir name="Customer"><dir name="Account"><file name="Lists.php" hash="e1b911c77a78995d3b3390363926ae5a"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><dir name="Abandoned"><file name="Minutes.php" hash="e311f6de480fd4b63aee7f46ea412372"/></dir><file name="Action.php" hash="bf2243f50c9c6dafca26a5bcb889f372"/></dir></dir></dir></dir><file name="Capture.php" hash="e44034ad875957a566d3ac89abb408ed"/><file name="Signup.php" hash="c51c2e5cb93978170a65dc4b69d197bf"/></dir><dir name="Controller"><dir name="Front"><file name="Abstract.php" hash="48d93179d5f8a6b416fd82dd8763daf9"/></dir></dir><dir name="Helper"><file name="Abandoned.php" hash="7910bd8db8a030ae22adae9469d91fe7"/><file name="Data.php" hash="9d3e0377de044475d7f6e251c56bd715"/><file name="Diagnostic.php" hash="68867fd906405a6be98e14c1568437b6"/><file name="Fields.php" hash="5fa737c45be172f55fe965975aa6db52"/><file name="Order.php" hash="e4683daf9827a5cb47f17b0104509102"/><file name="Troubleshooting.php" hash="cf422b72b445a86326e73cbc6f506e18"/></dir><dir name="Model"><dir name="Abandoned"><file name="Observer.php" hash="00f8e4f8186a6c800df932b74b147844"/></dir><dir name="Configuration"><file name="Observer.php" hash="9a188656d5f7d73c91bf4221cc6e4aac"/></dir><dir name="Customer"><file name="Observer.php" hash="cef8d32ba304c51b448343555ea6a066"/></dir><dir name="Mysql4"><dir name="Abandoned"><file name="Collection.php" hash="1a9129267942a98ac3830ceaf714c2ab"/></dir><dir name="Order"><file name="Collection.php" hash="43d343562cf7e54f1b36315aa5d1d4a7"/></dir><dir name="Session"><file name="Collection.php" hash="7d6a8283fdbc1207d709e2bbbc78906d"/></dir><file name="Abandoned.php" hash="485b3771906783d383de75ae9761e55c"/><file name="Order.php" hash="8d538a5737095a1ba0ad448c027b3afb"/><file name="Session.php" hash="516eeeb28038416dc885ed7af6a8a8b0"/></dir><dir name="Newsletter"><file name="Observer.php" hash="d3181ac610e920dead78fff5656f65de"/></dir><dir name="Observer"><file name="Abstract.php" hash="1db39dc86bed51af1d2a3b4df50099bd"/></dir><dir name="Order"><file name="Observer.php" hash="17cd32f5111f0e423ac3a5d8dd62b256"/></dir><dir name="Resource"><file name="Setup.php" hash="83ba3645f702694355f14181546db330"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Export"><file name="Batch.php" hash="96c51fc5c0b947750be4e612e32c83ab"/></dir><dir name="Send"><file name="Field.php" hash="8ecffa8ccce40f3b2db6513b24eb9200"/></dir><dir name="Signup"><file name="Opacity.php" hash="8eabed4c72e7347f0376c3d4cc1023a7"/><file name="Recurrence.php" hash="e11200bbc204b00486c373d8a4e6675e"/></dir><file name="Abandoned.php" hash="9881811b94f38be90bd20a99951a1903"/><file name="Abandonedlist.php" hash="b81d7f2cb03b8482debea5cd6a2bd1c5"/><file name="Additionallist.php" hash="9f109ab04c7ae7832887572b26868e3a"/><file name="Checkoutsubscribe.php" hash="fd90252a1f19649a420dae136ad2a2ba"/><file name="List.php" hash="84c1c8e27f579d5d33992fcb15202748"/><file name="Publication.php" hash="a5bc0192605fc558fe59b37cc0462825"/><file name="Sequence.php" hash="a599f218882d2cfc68dfcf4d58a98a41"/><file name="Source.php" hash="44815cbf4ac6443032df1e7d9c4cadef"/><file name="States.php" hash="a746affc786d8165a98801e68cbf80ab"/><file name="Statuses.php" hash="9844a7a9c3b5c68df45c8f6c518acf16"/><file name="Time.php" hash="8acbb5cb33e66de1e408cf55d17a9398"/></dir></dir></dir><dir name="Wrapper"><file name="Abandoned.php" hash="ef81d36a7276737f2d0aa1a5d783a83b"/><file name="Abstract.php" hash="9e97ce6a12e0d074921bb3a1391f3648"/><file name="Database.php" hash="3cceb467358d13584baff58c043762ec"/><file name="Execute.php" hash="e38737d197b2ccd6700ec87ec1836456"/><file name="Ftp.php" hash="d5335cfb68f99761d6902dd390a3d7a8"/><file name="Lists.php" hash="425d64b9256bbdbafa899c4138e78368"/><file name="Orders.php" hash="fa1c481787b0f994c1c1f704f73d6741"/><file name="Publications.php" hash="1bebd172a8bba669d075f09589785652"/><file name="Sources.php" hash="c6caf0274f7d0c50114324bc47a490c4"/><file name="Subscribers.php" hash="53a2c24db3936b7768ae6a8a8f98f394"/><file name="Wishlist.php" hash="2ceb111bbeaa06c4f13f61281aaa5b5e"/></dir><file name="Abandoned.php" hash="b5e001d0bc059c66ef38130b7d6dcec0"/><file name="Observer.php" hash="37a2d4c63e4ef75d535426a8670764f1"/><file name="Order.php" hash="b21426543cd46f799cd0743525120fb8"/><file name="Session.php" hash="c56ecf779dbfb2dae0030935af31911a"/></dir><dir name="controllers"><dir name="Admin"><file name="AbandonedController.php" hash="7366ad52662d5494e1b0e65988ee1dc7"/><file name="DiagnosticController.php" hash="aa0f4e9bf3c22124c61c3f46729372a9"/><file name="ExportController.php" hash="3ff11560de77d99bccb2cc257d14b8ab"/><file name="TroubleshootingController.php" hash="52847165f3c24c955832455e2c27a7a6"/></dir><dir name="Customer"><file name="AccountController.php" hash="91942750c1c3d20dc31159c1ffbe8200"/></dir><file name="AbandonedController.php" hash="39c9d1a72bca9369a3121ac15f68558e"/><file name="CaptureController.php" hash="89e043bb3864617a062e915d2209dcf4"/><file name="ExportController.php" hash="7ca147debc5c1436b3bf2d9501592f33"/><file name="SignupController.php" hash="fe975d44cc11f1270d34d9d82c7d4be9"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5501d4faf3da5ba1e380017b9608e1e8"/><file name="cache.xml" hash="9f7ad708d6507ec880473689e70ef314"/><file name="config.xml" hash="d7b3fcc04cf6597d1e7258655974b970"/><file name="system.xml" hash="38f8dfb41b5fcc55490daf4d7c6e147c"/></dir><dir name="sql"><dir name="emaildirect_setup"><file name="mysql4-install-2.0.0.php" hash="bdc5e09fe949b36534c50c85fd198e66"/><file name="mysql4-upgrade-1.5.8-2.0.0.php" hash="8f33c7f6dca96cfa8210ec1fe016d95b"/><file name="mysql4-upgrade-2.0.0-2.0.14.php" hash="ead09ac13bb7798b08776dda5948f91d"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="emaildirect"><file name="emaildirect-tab.png" hash="9ddb077b74a7078ac509d79b024631a1"/><file name="emaildirect.css" hash="61d3d7b29b97f75023f2232cae6eb0c1"/><file name="logo.png" hash="2e7e39ced387c798ef27b77dd69f073e"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="emaildirect"><dir name="images"><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir><file name="emaildirect.css" hash="c9caf9ea168efa3b0d6f4b881bcf093c"/><file name="integration.js" hash="7980204c0f594b180b9fa336954c9229"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="7767cd483e20d1930c0f1d79fee03b2a"/></dir><dir name="template"><dir name="emaildirect"><dir name="abandoned"><dir name="details"><dir name="tab"><dir name="diagnostics"><file name="status.phtml" hash="24829356b9dba966e53fb1cfe0f192b6"/></dir><file name="cart.phtml" hash="be7ca2b147fc836c2ca547b290ffe841"/></dir><file name="form.phtml" hash="60633d212382770e99d11d24ae919e47"/></dir><file name="details.phtml" hash="9d467b97a2d773aec950bea7061c6730"/><file name="status.phtml" hash="9e7723dc1fe5f8693345db9cc7cda808"/></dir><dir name="order"><dir name="view"><dir name="tab"><dir name="diagnostics"><file name="status.phtml" hash="a3bdecb1ec08903dd1b61dce6992e190"/></dir></dir></dir></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="176f3ddb8ea667a64a06967351526f3c"/></dir><dir name="form"><dir name="field"><dir name="export"><file name="date_range.phtml" hash="6a37b1e58456e1dcec734c48deb8c0c1"/><file name="orders.phtml" hash="1dfa19a712b18d2c95c2f4b938f6acef"/><file name="products.phtml" hash="098b7b21b6424c2a4eea26194883a623"/></dir><dir name="signup"><file name="test.phtml" hash="636501cd90c6ab4231bea54efb16b2ff"/></dir><file name="api.phtml" hash="468f33b2a23dbe2828489c1620000c74"/><file name="array.phtml" hash="5415eeff311735624354468c886d39b5"/><file name="diagnostics.phtml" hash="3327dba9e03362077f7562e3045180b7"/><file name="info.phtml" hash="44ab79fdfc5fb5b0cd7e15e79bfd9502"/><file name="logging.phtml" hash="3c7bd2a6f48a84efca1d0f1e75097a8a"/><file name="note.phtml" hash="6625a3771ba10daba5ded5570574716f"/></dir></dir><file name="setup_check.phtml" hash="1814302f58a15fb1629446e074a7e1e0"/></dir><dir name="convert"><dir name="profile"><file name="export.phtml" hash="c829eeccb120ffe4c0b9f0ddf9c7ff9a"/></dir></dir></dir><dir name="troubleshooting"><dir name="view"><dir name="tab"><file name="download.phtml" hash="d5701a0af7a8f308467fa5552d0de6b2"/><file name="help.phtml" hash="ce11f0fb8f19a00d950266840b4ec3ce"/><file name="info.phtml" hash="bd19bb1072ce1d60a4fb7bda660a0ce7"/><file name="log.phtml" hash="724a65165770bc92ed08ea32d20c1fe7"/><file name="settings.phtml" hash="56cea7faf49b815ac8bd66896130c58c"/><file name="submit.phtml" hash="0d7df80ddbd24e499275315d91fbfd58"/></dir><file name="form.phtml" hash="d2338bfe3598e9315ca8f5ac8d9b5516"/></dir><file name="status.phtml" hash="fac61e17efe7bd4cf67a47eb67786496"/><file name="view.phtml" hash="6ddfc8c6efe25d30e63f792b19a95c84"/></dir><file name="diagnostics.phtml" hash="f1f43a89824cad9f39e599df21ac44b4"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="8cb8652ad2505bb6f0c5e80d7be60109"/></dir><dir name="template"><dir name="emaildirect"><dir name="capture"><file name="email.phtml" hash="fa273ff1a48a12eb386f58f3e3e78f66"/></dir><dir name="checkout"><file name="subscribe.phtml" hash="d57eb93aab4e0f1d58f1ec8b9ed24c50"/></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="50ebf53c50e5e0419dd86a6d5faa2bf9"/></dir><file name="lists.phtml" hash="101ea6709a4355786917a6845b8d52aa"/></dir></dir><dir name="signup"><file name="form.phtml" hash="3d483079d29b79ad4daf306228120c0f"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="newsletter_subscr_success_emaildirect.html" hash="f6afb69d207bbc3f8920e7a72ac9dd07"/><file name="newsletter_unsub_success_emaildirect.html" hash="bd9f97e8f5485180d4420097b5200ef4"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EmailDirect_Integration.xml" hash="90a441f2d0dff6c247f810274e8a76ab"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>