EmailDirect_Integration - Version 2.0.0

Version Notes

Moved code from local to community folder and using EmailDirect only tables to store data

Popup/Modal for visitors using an EmailDirect Signup Form (customizable)

Email Capture for guest accounts who abandon their cart

Updated Abandoned Cart page with more options for multiple stores

Added ability to use order state or status to determine when to send order

Orders can now be processed in batches through a cron process

Download this release

Release Info

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


Code changes from version 1.5.8 to 2.0.0

Files changed (119) hide show
  1. app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned.php +59 -0
  2. app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned/Grid.php +265 -0
  3. app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned/Status.php +9 -0
  4. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Fieldset/Hint.php +5 -5
  5. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Addressmapfields.php +0 -0
  6. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Common.php +7 -10
  7. app/code/community/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Export/Orders.php +17 -0
  8. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Export/Products.php +0 -11
  9. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Export/Range.php +2 -14
  10. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Info.php +5 -0
  11. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Mapfields.php +1 -1
  12. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Note.php +0 -0
  13. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Shippingmapfields.php +0 -0
  14. app/code/{local/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Export/Orders.php → community/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Signup/Test.php} +3 -3
  15. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Troubleshooting.php +6 -0
  16. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Convert/Profile/Export.php +6 -2
  17. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Convert/Profile/Export/Orders.php +1 -1
  18. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Convert/Profile/Export/Products.php +4 -6
  19. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/Tabs.php +0 -0
  20. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View.php +3 -3
  21. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Form.php +0 -0
  22. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Download.php +2 -2
  23. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Info.php +2 -2
  24. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Log.php +2 -2
  25. app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Submit.php +2 -2
  26. app/code/community/EmailDirect/Integration/Block/Capture.php +32 -0
  27. app/code/{local → community}/EmailDirect/Integration/Block/Checkout/Subscribe.php +0 -0
  28. app/code/{local → community}/EmailDirect/Integration/Block/Customer/Account/Dashboard/Info.php +0 -0
  29. app/code/{local → community}/EmailDirect/Integration/Block/Customer/Account/Lists.php +0 -0
  30. app/code/community/EmailDirect/Integration/Block/Signup.php +92 -0
  31. app/code/community/EmailDirect/Integration/Block/Widget/Grid/Column/Renderer/Abandoned/Minutes.php +23 -0
  32. app/code/{local → community}/EmailDirect/Integration/Block/Widget/Grid/Column/Renderer/Action.php +9 -4
  33. app/code/{local → community}/EmailDirect/Integration/Helper/Data.php +322 -198
  34. app/code/{local → community}/EmailDirect/Integration/Helper/Fields.php +0 -0
  35. app/code/community/EmailDirect/Integration/Helper/Upgrade.php +29 -0
  36. app/code/community/EmailDirect/Integration/Model/Abandoned.php +44 -0
  37. app/code/community/EmailDirect/Integration/Model/Mysql4/Abandoned.php +26 -0
  38. app/code/community/EmailDirect/Integration/Model/Mysql4/Abandoned/Collection.php +115 -0
  39. app/code/community/EmailDirect/Integration/Model/Mysql4/Order.php +26 -0
  40. app/code/community/EmailDirect/Integration/Model/Mysql4/Order/Collection.php +78 -0
  41. app/code/community/EmailDirect/Integration/Model/Mysql4/Session.php +26 -0
  42. app/code/community/EmailDirect/Integration/Model/Mysql4/Session/Collection.php +15 -0
  43. app/code/{local → community}/EmailDirect/Integration/Model/Observer.php +340 -141
  44. app/code/community/EmailDirect/Integration/Model/Order.php +49 -0
  45. app/code/community/EmailDirect/Integration/Model/Session.php +67 -0
  46. app/code/community/EmailDirect/Integration/Model/System/Config/Source/Abandoned.php +31 -0
  47. app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Abandonedlist.php +0 -0
  48. app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Additionallist.php +0 -0
  49. app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Checkoutsubscribe.php +0 -0
  50. app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Export/Batch.php +0 -0
  51. app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/List.php +0 -0
  52. app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Publication.php +0 -0
  53. app/code/community/EmailDirect/Integration/Model/System/Config/Source/Send/Field.php +14 -0
  54. app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Sequence.php +0 -0
  55. app/code/community/EmailDirect/Integration/Model/System/Config/Source/Signup/Opacity.php +17 -0
  56. app/code/community/EmailDirect/Integration/Model/System/Config/Source/Signup/Recurrence.php +16 -0
  57. app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Source.php +0 -0
  58. app/code/community/EmailDirect/Integration/Model/System/Config/Source/States.php +39 -0
  59. app/code/community/EmailDirect/Integration/Model/System/Config/Source/Statuses.php +21 -0
  60. app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Time.php +0 -0
  61. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Abandoned.php +0 -0
  62. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Abstract.php +0 -0
  63. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Database.php +0 -0
  64. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Execute.php +0 -0
  65. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Ftp.php +0 -0
  66. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Lists.php +1 -5
  67. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Orders.php +2 -2
  68. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Publications.php +0 -0
  69. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Sources.php +0 -0
  70. app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Subscribers.php +15 -7
  71. app/code/{local → community}/EmailDirect/Integration/controllers/AbandonedController.php +2 -6
  72. app/code/{local → community}/EmailDirect/Integration/controllers/Admin/AbandonedController.php +26 -14
  73. app/code/{local → community}/EmailDirect/Integration/controllers/Admin/ExportController.php +5 -3
  74. app/code/{local → community}/EmailDirect/Integration/controllers/Admin/TroubleshootingController.php +4 -37
  75. app/code/community/EmailDirect/Integration/controllers/CaptureController.php +35 -0
  76. app/code/{local → community}/EmailDirect/Integration/controllers/Customer/AccountController.php +31 -37
  77. app/code/{local → community}/EmailDirect/Integration/controllers/ExportController.php +0 -0
  78. app/code/{local → community}/EmailDirect/Integration/etc/adminhtml.xml +18 -0
  79. app/code/{local → community}/EmailDirect/Integration/etc/config.xml +42 -53
  80. app/code/{local → community}/EmailDirect/Integration/etc/system.xml +232 -79
  81. app/code/community/EmailDirect/Integration/sql/emaildirect_setup/mysql4-install-2.0.0.php +47 -0
  82. app/code/community/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-1.5.8-2.0.0.php +50 -0
  83. app/code/local/EmailDirect/Integration/Block/Adminhtml/Abandoned.php +0 -49
  84. app/code/local/EmailDirect/Integration/Block/Adminhtml/Abandoned/Grid.php +0 -285
  85. app/code/local/EmailDirect/Integration/Block/Adminhtml/System/Config/Account.php +0 -21
  86. app/code/local/EmailDirect/Integration/Block/Widget/Grid/Column/Renderer/AbandonedMinutes.php +0 -28
  87. app/code/local/EmailDirect/Integration/Model/System/Config/Source/States.php +0 -20
  88. app/code/local/EmailDirect/Integration/sql/emaildirect_setup/mysql4-install-1.0.0.php +0 -20
  89. app/code/local/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-1.0.13-1.0.14.php +0 -19
  90. app/code/local/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-1.0.19-1.2.0.php +0 -20
  91. app/code/local/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-1.5.4-1.5.5.php +0 -19
  92. app/design/adminhtml/default/default/layout/emaildirect.xml +11 -12
  93. app/{code/local/EmailDirect/Integration/controllers/Admin/OrderExportController.php → design/adminhtml/default/default/template/emaildirect/abandoned/grid.phtml} +0 -0
  94. app/design/adminhtml/default/default/template/emaildirect/abandoned/status.phtml +18 -0
  95. app/design/adminhtml/default/default/template/emaildirect/system/config/fieldset/hint.phtml +13 -28
  96. app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/export/date_range.phtml +33 -22
  97. app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/export/orders.phtml +3 -0
  98. app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/export/products.phtml +7 -0
  99. app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/info.phtml +6 -2
  100. app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/signup/test.phtml +26 -0
  101. app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/trouble.phtml +51 -47
  102. app/design/adminhtml/default/default/template/emaildirect/system/convert/profile/export.phtml +13 -8
  103. app/design/adminhtml/default/default/template/emaildirect/troubleshooting/view/tab/download.phtml +1 -2
  104. app/design/frontend/base/default/layout/emaildirect.xml +13 -2
  105. app/design/frontend/base/default/template/emaildirect/capture/email.phtml +13 -0
  106. app/design/frontend/base/default/template/emaildirect/email/order/items.phtml +0 -23
  107. app/design/frontend/base/default/template/emaildirect/email/order/items/order/default.phtml +0 -111
  108. app/design/frontend/base/default/template/emaildirect/signup/form.phtml +34 -0
  109. app/etc/modules/EmailDirect_Integration.xml +3 -3
  110. package.xml +13 -7
  111. skin/adminhtml/default/default/emaildirect/emaildirect.css +5 -1
  112. skin/adminhtml/default/default/emaildirect/emaildirect.js +0 -1
  113. skin/frontend/base/default/emaildirect/emaildirect.css +44 -0
  114. skin/frontend/base/default/emaildirect/images/bkg_block-title.gif +0 -0
  115. skin/frontend/base/default/emaildirect/images/dotted_divider.gif +0 -0
  116. skin/frontend/base/default/emaildirect/images/emaildirect-tile.png +0 -0
  117. skin/frontend/base/default/emaildirect/images/i_block-subscribe.gif +0 -0
  118. skin/frontend/base/default/emaildirect/images/window_close.png +0 -0
  119. skin/frontend/base/default/emaildirect/integration.js +1 -1
app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Block_Adminhtml_Abandoned extends Mage_Adminhtml_Block_Widget_Grid_Container
4
+ {
5
+ public function __construct()
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('run_now', array(
22
+ 'label' => Mage::helper('emaildirect')->__($label),
23
+ 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/run') .'\')',
24
+ ));
25
+ }
26
+ else
27
+ $this->_headerText = "Abandoned Carts - <span class='ab_ng'>Disabled</span>";
28
+
29
+ parent::__construct();
30
+ $this->_removeButton('add');
31
+ }
32
+
33
+ public function getStatusHtml()
34
+ {
35
+ return $this->getChildHtml('abandoned_status');
36
+ }
37
+
38
+ protected function _prepareLayout()
39
+ {
40
+ $this->setChild('store_switcher',
41
+ $this->getLayout()->createBlock('adminhtml/store_switcher')
42
+ ->setUseConfirm(false)
43
+ ->setSwitchUrl($this->getUrl('*/*/*', array('store'=>null)))
44
+ ->setTemplate('report/store/switcher.phtml')
45
+ );
46
+
47
+ $this->setChild('abandoned_status',
48
+ $this->getLayout()->createBlock('emaildirect/adminhtml_abandoned_status')
49
+ ->setTemplate('emaildirect/abandoned/status.phtml')
50
+ );
51
+
52
+ return parent::_prepareLayout();
53
+ }
54
+
55
+ public function getGridHtml()
56
+ {
57
+ return $this->getStatusHtml() . parent::getGridHtml();
58
+ }
59
+ }
app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned/Grid.php ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Block_Adminhtml_Abandoned_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+
6
+ /**
7
+ * ids of current stores
8
+ */
9
+ protected $_store_ids = array();
10
+
11
+ protected $_abandoned_status = null;
12
+
13
+ /**
14
+ * stores current currency code
15
+ */
16
+ protected $_currentCurrencyCode = null;
17
+
18
+ public function __construct()
19
+ {
20
+ parent::__construct();
21
+ $this->setId('abandonedGrid');
22
+ $this->setUseAjax(true);
23
+ $this->setDefaultSort('updated_at');
24
+ $this->setSaveParametersInSession(true);
25
+ $this->setPagerVisibility(true);
26
+ $this->setTemplate('widget/grid.phtml');
27
+ $this->setRowClickCallback('openGridRow');
28
+
29
+ $this->_abandoned_status = Mage::helper('emaildirect')->getAbandonedStatus();
30
+ }
31
+
32
+ /**
33
+ * Retrieve currency code based on selected store
34
+ *
35
+ * @return string
36
+ */
37
+ public function getCurrentCurrencyCode()
38
+ {
39
+ if (is_null($this->_currentCurrencyCode))
40
+ {
41
+ reset($this->_store_ids);
42
+ $this->_currentCurrencyCode = (count($this->_store_ids) > 0)
43
+ ? Mage::app()->getStore(current($this->_store_ids))->getBaseCurrencyCode()
44
+ : Mage::app()->getStore()->getBaseCurrencyCode();
45
+ }
46
+ return $this->_currentCurrencyCode;
47
+ }
48
+
49
+ /**
50
+ * store_ids setter
51
+ *
52
+ * @param array $store_ids
53
+ * @return Mage_Adminhtml_Block_Report_Grid_Shopcart_Abstract
54
+ */
55
+ public function setStoreIds()
56
+ {
57
+ if ($this->getRequest()->getParam('website'))
58
+ $this->_store_ids = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
59
+ else if ($this->getRequest()->getParam('group'))
60
+ $this->_store_ids = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
61
+ else if ($this->getRequest()->getParam('store'))
62
+ $this->_store_ids = array((int)$this->getRequest()->getParam('store'));
63
+ else
64
+ $this->_store_ids = array();
65
+ }
66
+
67
+ protected function _prepareCollection()
68
+ {
69
+ $collection = Mage::getResourceModel('emaildirect/abandoned_collection');
70
+
71
+ $filter = $this->getParam($this->getVarNameFilter(), array());
72
+
73
+ if ($filter)
74
+ {
75
+ $filter = base64_decode($filter);
76
+ parse_str(urldecode($filter), $data);
77
+ }
78
+
79
+ $this->setCollection($collection);
80
+
81
+ if (!empty($data))
82
+ $collection->prepareForAbandonedReport($this->_store_ids, $data);
83
+ else
84
+ $collection->prepareForAbandonedReport($this->_store_ids);
85
+
86
+ return parent::_prepareCollection();
87
+ }
88
+
89
+ protected function _addColumnFilterToCollection($column)
90
+ {
91
+ $field = ($column->getFilterIndex()) ? $column->getFilterIndex() : $column->getIndex();
92
+
93
+ parent::_addColumnFilterToCollection($column);
94
+ return $this;
95
+ }
96
+
97
+ private function getCustomerGroups($blank = false)
98
+ {
99
+ $options = array();
100
+
101
+ $groups = Mage::Helper('customer')->getGroups();
102
+
103
+ if ($blank)
104
+ $options[""] = "";
105
+
106
+ foreach($groups as $group)
107
+ {
108
+ $options[$group->getData('customer_group_id')] = Mage::helper('catalog')->__($group->getData('customer_group_code'));
109
+ }
110
+
111
+ $options[0] = Mage::helper('catalog')->__('NOT LOGGED IN');
112
+
113
+ return $options;
114
+ }
115
+
116
+ protected function _prepareColumns()
117
+ {
118
+ $this->addColumn('customer_firstname', array(
119
+ 'header' => Mage::helper('emaildirect')->__('First Name'),
120
+ 'index' => 'customer_firstname'
121
+ ));
122
+
123
+ $this->addColumn('customer_lastname', array(
124
+ 'header' => Mage::helper('emaildirect')->__('Last Name'),
125
+ 'index' => 'customer_lastname'
126
+ ));
127
+
128
+ $this->addColumn('email', array(
129
+ 'header' => Mage::helper('emaildirect')->__('Email'),
130
+ 'filter_index' => 'IF(main_table.customer_email IS NOT NULL, main_table.customer_email, email)',
131
+ 'index' => 'email'
132
+ ));
133
+
134
+ $this->addColumn('customer_group_id', array(
135
+ 'header' => Mage::helper('emaildirect')->__('Customer Group'),
136
+ 'index' => 'customer_group_id',
137
+ 'type' => 'options',
138
+ 'options' => $this->getCustomerGroups()
139
+ ));
140
+
141
+ $this->addColumn('items_count', array(
142
+ 'header' => Mage::helper('emaildirect')->__('Number of Items'),
143
+ 'align' => 'right',
144
+ 'index' => 'items_count',
145
+ 'type' => 'number'
146
+ ));
147
+
148
+ $this->addColumn('items_qty', array(
149
+ 'header' => Mage::helper('emaildirect')->__('Quantity of Items'),
150
+ 'align' => 'right',
151
+ 'index' => 'items_qty',
152
+ 'type' => 'number'
153
+ ));
154
+
155
+ $this->setStoreIds();
156
+
157
+ $currencyCode = $this->getCurrentCurrencyCode();
158
+
159
+ $this->addColumn('store_id', array(
160
+ 'header' => Mage::helper('catalog')->__('Store'),
161
+ 'index' => 'store_id',
162
+ 'type' => 'store',
163
+ 'filter_index' => 'main_table.store_id',
164
+ 'store_view' => true,
165
+ 'sortable' => false
166
+ ));
167
+
168
+ $this->addColumn('subtotal', array(
169
+ 'header' => Mage::helper('emaildirect')->__('Subtotal'),
170
+ 'width' => '80px',
171
+ 'type' => 'currency',
172
+ 'currency_code' => $currencyCode,
173
+ 'index' => 'subtotal',
174
+ 'renderer' => 'adminhtml/report_grid_column_renderer_currency',
175
+ 'rate' => $this->getRate($currencyCode),
176
+ ));
177
+
178
+ $this->addColumn('updated_at', array(
179
+ 'header' => Mage::helper('emaildirect')->__('Abandoned Date'),
180
+ 'type' => 'datetime',
181
+ 'index' => 'updated_at',
182
+ 'filter_index' => 'main_table.updated_at'
183
+ ));
184
+
185
+ $this->addColumn('abandoned_minutes', array(
186
+ 'header' => Mage::helper('emaildirect')->__('Minutes'),
187
+ 'width' => '70px',
188
+ 'renderer' => 'EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_Abandoned_Minutes',
189
+ 'index' => 'abandoned_minutes',
190
+ 'sortable' => false,
191
+ 'filter' => false,
192
+ ));
193
+
194
+ $this->addColumn('remote_ip', array(
195
+ 'header' => Mage::helper('emaildirect')->__('IP Address'),
196
+ 'width' => '80px',
197
+ 'index' => 'remote_ip'
198
+ ));
199
+
200
+ $this->addColumn('date_sent', array(
201
+ 'header' => Mage::helper('emaildirect')->__('Date Sent to EmailDirect'),
202
+ 'index' => 'date_sent',
203
+ 'type' => 'datetime'
204
+ ));
205
+
206
+ if ($this->_abandoned_status['enabled'])
207
+ {
208
+ $this->addColumn('action',
209
+ array(
210
+ 'header' => Mage::helper('emaildirect')->__('Action'),
211
+ 'width' => '50px',
212
+ 'type' => 'action',
213
+ 'getter' => 'getId',
214
+ 'actions' => array(
215
+ array(
216
+ 'caption' => Mage::helper('emaildirect')->__('Send'),
217
+ 'url' => array('base'=> '*/*/send', 'params' => Mage::helper('emaildirect')->getUrlParams()),
218
+ 'field' => 'id',
219
+ 'sent' => false
220
+ ),
221
+ array(
222
+ 'caption' => Mage::helper('emaildirect')->__('Resend'),
223
+ 'url' => array('base'=> '*/*/send', 'params' => Mage::helper('emaildirect')->getUrlParams()),
224
+ 'field' => 'id',
225
+ 'sent' => true
226
+ )
227
+ ),
228
+ 'filter' => false,
229
+ 'sortable' => false,
230
+ 'renderer' => 'EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_Action',
231
+ 'index' => 'stores',
232
+ 'is_system' => true,
233
+ ));
234
+ }
235
+
236
+ return parent::_prepareColumns();
237
+ }
238
+
239
+ protected function _prepareMassaction()
240
+ {
241
+ if (!$this->_abandoned_status['enabled'])
242
+ return $this;
243
+
244
+ $this->setMassactionIdField('post_id');
245
+ $this->getMassactionBlock()->setFormFieldName('id');
246
+
247
+ $this->getMassactionBlock()->addItem('send', array(
248
+ 'label' => Mage::helper('emaildirect')->__('Send or Resend'),
249
+ 'url' => $this->getUrl('*/*/massSend', Mage::helper('emaildirect')->getUrlParams())
250
+ ));
251
+
252
+ return $this;
253
+ }
254
+
255
+ public function getGridUrl()
256
+ {
257
+ return $this->getUrl('*/*/grid', array('_current'=> true));
258
+ }
259
+
260
+ public function getRowUrl($row)
261
+ {
262
+ if ($row->getCustomerId())
263
+ return $this->getUrl('adminhtml/customer/edit', array('id'=>$row->getCustomerId(), 'active_tab'=>'cart'));
264
+ }
265
+ }
app/code/community/EmailDirect/Integration/Block/Adminhtml/Abandoned/Status.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Block_Adminhtml_Abandoned_Status extends Mage_Adminhtml_Block_Template
4
+ {
5
+ public function getAbandonedStatus()
6
+ {
7
+ return Mage::helper('emaildirect')->getAbandonedStatus();
8
+ }
9
+ }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Fieldset/Hint.php RENAMED
@@ -16,11 +16,6 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Fieldset_Hint
16
  {
17
  return $this->toHtml();
18
  }
19
-
20
- public function checkDatabaseColumns()
21
- {
22
- return Mage::helper('emaildirect')->checkDatabaseColumns();
23
- }
24
 
25
  public function getEmaildirectVersion()
26
  {
@@ -36,4 +31,9 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Fieldset_Hint
36
  {
37
  return Mage::helper('emaildirect')->getAbandonedEnabled();
38
  }
 
 
 
 
 
39
  }
16
  {
17
  return $this->toHtml();
18
  }
 
 
 
 
 
19
 
20
  public function getEmaildirectVersion()
21
  {
31
  {
32
  return Mage::helper('emaildirect')->getAbandonedEnabled();
33
  }
34
+
35
+ public function isWebsiteConfig()
36
+ {
37
+ return Mage::helper('emaildirect')->isWebsiteConfig();
38
+ }
39
  }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Addressmapfields.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Common.php RENAMED
@@ -2,15 +2,12 @@
2
 
3
  class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Common extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
4
  {
5
- /**
6
- * Check if columns are defined, set template
7
- *
8
- */
9
  public function __construct()
10
  {
11
  parent::__construct();
12
  $this->setTemplate('emaildirect/system/config/form/field/array.phtml');
13
  }
 
14
  /**
15
  * Add a column to array-grid
16
  *
@@ -20,12 +17,12 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Common ex
20
  public function addColumn($name, $params)
21
  {
22
  $this->_columns[$name] = array(
23
- 'label' => empty($params['label']) ? 'Column' : $params['label'],
24
- 'size' => empty($params['size']) ? false : $params['size'],
25
- 'style' => empty($params['style']) ? null : $params['style'],
26
- 'class' => empty($params['class']) ? null : $params['class'],
27
- 'type' => empty($params['type']) ? null : $params['type'],
28
- 'options' => empty($params['options']) ? array() : $params['options'],
29
  'renderer' => false,
30
  );
31
  if ((!empty($params['renderer'])) && ($params['renderer'] instanceof Mage_Core_Block_Abstract)) {
2
 
3
  class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Common extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
4
  {
 
 
 
 
5
  public function __construct()
6
  {
7
  parent::__construct();
8
  $this->setTemplate('emaildirect/system/config/form/field/array.phtml');
9
  }
10
+
11
  /**
12
  * Add a column to array-grid
13
  *
17
  public function addColumn($name, $params)
18
  {
19
  $this->_columns[$name] = array(
20
+ 'label' => empty($params['label']) ? 'Column' : $params['label'],
21
+ 'size' => empty($params['size']) ? false : $params['size'],
22
+ 'style' => empty($params['style']) ? null : $params['style'],
23
+ 'class' => empty($params['class']) ? null : $params['class'],
24
+ 'type' => empty($params['type']) ? null : $params['type'],
25
+ 'options' => empty($params['options']) ? array() : $params['options'],
26
  'renderer' => false,
27
  );
28
  if ((!empty($params['renderer'])) && ($params['renderer'] instanceof Mage_Core_Block_Abstract)) {
app/code/community/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Export/Orders.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Orders extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setTemplate('emaildirect/system/config/form/field/export/orders.phtml');
9
+ }
10
+
11
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
12
+ {
13
+ $this->setElement($element);
14
+ $html = $this->_toHtml();
15
+ return $html;
16
+ }
17
+ }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Export/Products.php RENAMED
@@ -2,27 +2,16 @@
2
 
3
  class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Products extends Mage_Adminhtml_Block_System_Config_Form_Field
4
  {
5
- /**
6
- * Check if columns are defined, set template
7
- *
8
- */
9
  public function __construct()
10
  {
11
  parent::__construct();
12
  $this->setTemplate('emaildirect/system/config/form/field/export/products.phtml');
13
  }
14
 
15
- /**
16
- * Get the grid and scripts contents
17
- *
18
- * @param Varien_Data_Form_Element_Abstract $element
19
- * @return string
20
- */
21
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
22
  {
23
  $this->setElement($element);
24
  $html = $this->_toHtml();
25
- //$this->_arrayRowsCache = null; // doh, the object is used as singleton!
26
  return $html;
27
  }
28
  }
2
 
3
  class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Products extends Mage_Adminhtml_Block_System_Config_Form_Field
4
  {
 
 
 
 
5
  public function __construct()
6
  {
7
  parent::__construct();
8
  $this->setTemplate('emaildirect/system/config/form/field/export/products.phtml');
9
  }
10
 
 
 
 
 
 
 
11
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
12
  {
13
  $this->setElement($element);
14
  $html = $this->_toHtml();
 
15
  return $html;
16
  }
17
  }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Export/Range.php RENAMED
@@ -2,10 +2,6 @@
2
 
3
  class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Range extends Mage_Adminhtml_Block_System_Config_Form_Field
4
  {
5
- /**
6
- * Check if columns are defined, set template
7
- *
8
- */
9
  public function __construct()
10
  {
11
  parent::__construct();
@@ -30,7 +26,7 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Ra
30
  {
31
  $store = Mage::helper('emaildirect')->getAdminStore();
32
  $orders = Mage::helper('emaildirect')->getOrderExportCollection($this->getFromDate(),$this->getToDate(), Mage::helper('emaildirect')->exportConfig('include_already_sent'), $store);
33
-
34
  return $orders->getSize();
35
  }
36
  catch (Exception $e)
@@ -39,19 +35,11 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Ra
39
  return "Unknown";
40
  }
41
  }
42
-
43
-
44
- /**
45
- * Get the grid and scripts contents
46
- *
47
- * @param Varien_Data_Form_Element_Abstract $element
48
- * @return string
49
- */
50
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
51
  {
52
  $this->setElement($element);
53
  $html = $this->_toHtml();
54
- //$this->_arrayRowsCache = null; // doh, the object is used as singleton!
55
  return $html;
56
  }
57
  }
2
 
3
  class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Range extends Mage_Adminhtml_Block_System_Config_Form_Field
4
  {
 
 
 
 
5
  public function __construct()
6
  {
7
  parent::__construct();
26
  {
27
  $store = Mage::helper('emaildirect')->getAdminStore();
28
  $orders = Mage::helper('emaildirect')->getOrderExportCollection($this->getFromDate(),$this->getToDate(), Mage::helper('emaildirect')->exportConfig('include_already_sent'), $store);
29
+
30
  return $orders->getSize();
31
  }
32
  catch (Exception $e)
35
  return "Unknown";
36
  }
37
  }
38
+
 
 
 
 
 
 
 
39
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
40
  {
41
  $this->setElement($element);
42
  $html = $this->_toHtml();
 
43
  return $html;
44
  }
45
  }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Info.php RENAMED
@@ -18,4 +18,9 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Info exte
18
  $element->getHtmlId(), $this->_toHtml()
19
  );
20
  }
 
 
 
 
 
21
  }
18
  $element->getHtmlId(), $this->_toHtml()
19
  );
20
  }
21
+
22
+ public function isWebsiteConfig()
23
+ {
24
+ return $this->_helper->isWebsiteConfig();
25
+ }
26
  }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Mapfields.php RENAMED
@@ -18,4 +18,4 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Mapfields
18
  $this->_addButtonLabel = Mage::helper('emaildirect')->__('Add field');
19
  parent::__construct();
20
  }
21
- }
18
  $this->_addButtonLabel = Mage::helper('emaildirect')->__('Add field');
19
  parent::__construct();
20
  }
21
+ }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Note.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Shippingmapfields.php RENAMED
File without changes
app/code/{local/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Export/Orders.php → community/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Signup/Test.php} RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Orders extends Mage_Adminhtml_Block_System_Config_Form_Field
4
  {
5
  /**
6
  * Check if columns are defined, set template
@@ -9,7 +9,7 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Or
9
  public function __construct()
10
  {
11
  parent::__construct();
12
- $this->setTemplate('emaildirect/system/config/form/field/export/orders.phtml');
13
  }
14
 
15
  /**
@@ -22,7 +22,7 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Export_Or
22
  {
23
  $this->setElement($element);
24
  $html = $this->_toHtml();
25
- //$this->_arrayRowsCache = null; // doh, the object is used as singleton!
26
  return $html;
27
  }
28
  }
1
  <?php
2
 
3
+ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Signup_Test extends Mage_Adminhtml_Block_System_Config_Form_Field
4
  {
5
  /**
6
  * Check if columns are defined, set template
9
  public function __construct()
10
  {
11
  parent::__construct();
12
+ $this->setTemplate('emaildirect/system/config/form/field/signup/test.phtml');
13
  }
14
 
15
  /**
22
  {
23
  $this->setElement($element);
24
  $html = $this->_toHtml();
25
+
26
  return $html;
27
  }
28
  }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Config/Form/Field/Troubleshooting.php RENAMED
@@ -115,4 +115,10 @@ class EmailDirect_Integration_Block_Adminhtml_System_Config_Form_Field_Troublesh
115
  return "Unknown/Error";
116
  }
117
  }
 
 
 
 
 
 
118
  }
115
  return "Unknown/Error";
116
  }
117
  }
118
+
119
+ public function isLoggingEnabled()
120
+ {
121
+ return Mage::helper('emaildirect')->isLoggingEnabled();
122
+ }
123
+
124
  }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Convert/Profile/Export.php RENAMED
@@ -71,6 +71,10 @@ class EmailDirect_Integration_Block_Adminhtml_System_Convert_Profile_Export exte
71
 
72
  public function getStore()
73
  {
74
- return Mage::app()->getRequest()->getParam('store');
 
 
 
 
75
  }
76
- }
71
 
72
  public function getStore()
73
  {
74
+ $store = Mage::app()->getRequest()->getParam('store');
75
+ if ($store)
76
+ return $store;
77
+
78
+ return 0;
79
  }
80
+ }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Convert/Profile/Export/Orders.php RENAMED
@@ -24,4 +24,4 @@ class EmailDirect_Integration_Block_Adminhtml_System_Convert_Profile_Export_Orde
24
 
25
  return $orders;
26
  }
27
- }
24
 
25
  return $orders;
26
  }
27
+ }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/System/Convert/Profile/Export/Products.php RENAMED
@@ -15,11 +15,9 @@ class EmailDirect_Integration_Block_Adminhtml_System_Convert_Profile_Export_Prod
15
 
16
  public function getCollection()
17
  {
18
- $products = Mage::getModel('catalog/product')->getCollection();
 
19
 
20
- if (Mage::helper('emaildirect')->exportConfig('include_disabled') == false)
21
- $products->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
22
-
23
- return $products;
24
  }
25
- }
15
 
16
  public function getCollection()
17
  {
18
+ $include = Mage::app()->getRequest()->getParam('include_disabled') == 1;
19
+ $store = Mage::app()->getRequest()->getParam('store');
20
 
21
+ return Mage::helper('emaildirect')->getProductExportCollection($include, $store);
 
 
 
22
  }
23
+ }
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/Tabs.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View.php RENAMED
@@ -17,13 +17,13 @@ class EmailDirect_Integration_Block_Adminhtml_Troubleshooting_View extends Mage_
17
  $this->setId('troubleshooting_view');
18
 
19
  $this->_addButton('info_send', array(
20
- 'label' => Mage::helper('sales')->__('Send to EmailDirect'),
21
  'onclick' => 'ed_form.submit();',
22
  ));
23
-
24
  $onClick = "setLocation('{$this->getDownloadUrl()}')";
25
  $this->_addButton('info_download', array(
26
- 'label' => Mage::helper('sales')->__('Download Report'),
27
  'onclick' => $onClick,
28
  ));
29
  $this->setTemplate('emaildirect/troubleshooting/view.phtml');
17
  $this->setId('troubleshooting_view');
18
 
19
  $this->_addButton('info_send', array(
20
+ 'label' => Mage::helper('emaildirect')->__('Send to EmailDirect'),
21
  'onclick' => 'ed_form.submit();',
22
  ));
23
+
24
  $onClick = "setLocation('{$this->getDownloadUrl()}')";
25
  $this->_addButton('info_download', array(
26
+ 'label' => Mage::helper('emaildirect')->__('Download Report'),
27
  'onclick' => $onClick,
28
  ));
29
  $this->setTemplate('emaildirect/troubleshooting/view.phtml');
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Form.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Download.php RENAMED
@@ -7,12 +7,12 @@ class EmailDirect_Integration_Block_Adminhtml_Troubleshooting_View_Tab_Download
7
 
8
  public function getTabLabel()
9
  {
10
- return Mage::helper('sales')->__('Download Report');
11
  }
12
 
13
  public function getTabTitle()
14
  {
15
- return Mage::helper('sales')->__('Download Report');
16
  }
17
 
18
  public function canShowTab()
7
 
8
  public function getTabLabel()
9
  {
10
+ return Mage::helper('emaildirect')->__('Download Report');
11
  }
12
 
13
  public function getTabTitle()
14
  {
15
+ return Mage::helper('emaildirect')->__('Download Report');
16
  }
17
 
18
  public function canShowTab()
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Info.php RENAMED
@@ -6,12 +6,12 @@ class EmailDirect_Integration_Block_Adminhtml_Troubleshooting_View_Tab_Info
6
  {
7
  public function getTabLabel()
8
  {
9
- return Mage::helper('sales')->__('Configuration Info');
10
  }
11
 
12
  public function getTabTitle()
13
  {
14
- return Mage::helper('sales')->__('Configuration Information');
15
  }
16
 
17
  public function canShowTab()
6
  {
7
  public function getTabLabel()
8
  {
9
+ return Mage::helper('emaildirect')->__('Configuration Info');
10
  }
11
 
12
  public function getTabTitle()
13
  {
14
+ return Mage::helper('emaildirect')->__('Configuration Information');
15
  }
16
 
17
  public function canShowTab()
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Log.php RENAMED
@@ -7,12 +7,12 @@ class EmailDirect_Integration_Block_Adminhtml_Troubleshooting_View_Tab_Log
7
 
8
  public function getTabLabel()
9
  {
10
- return Mage::helper('sales')->__('Log File');
11
  }
12
 
13
  public function getTabTitle()
14
  {
15
- return Mage::helper('sales')->__('Log file');
16
  }
17
 
18
  public function canShowTab()
7
 
8
  public function getTabLabel()
9
  {
10
+ return Mage::helper('emaildirect')->__('Log File');
11
  }
12
 
13
  public function getTabTitle()
14
  {
15
+ return Mage::helper('emaildirect')->__('Log file');
16
  }
17
 
18
  public function canShowTab()
app/code/{local → community}/EmailDirect/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Submit.php RENAMED
@@ -6,12 +6,12 @@ class EmailDirect_Integration_Block_Adminhtml_Troubleshooting_View_Tab_Submit
6
  {
7
  public function getTabLabel()
8
  {
9
- return Mage::helper('sales')->__('Send to EmailDirect');
10
  }
11
 
12
  public function getTabTitle()
13
  {
14
- return Mage::helper('sales')->__('Send Information to EmailDirect');
15
  }
16
 
17
  public function canShowTab()
6
  {
7
  public function getTabLabel()
8
  {
9
+ return Mage::helper('emaildirect')->__('Send to EmailDirect');
10
  }
11
 
12
  public function getTabTitle()
13
  {
14
+ return Mage::helper('emaildirect')->__('Send Information to EmailDirect');
15
  }
16
 
17
  public function canShowTab()
app/code/community/EmailDirect/Integration/Block/Capture.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Block_Capture extends Mage_Core_Block_Template
4
+ {
5
+ private $_active = false;
6
+
7
+ public function __construct()
8
+ {
9
+ if ($this->helper('emaildirect')->canCapture())
10
+ $this->_active = true;
11
+ }
12
+
13
+ protected function _toHtml()
14
+ {
15
+ if (!$this->_active)
16
+ return "";
17
+
18
+ return parent::_toHtml();
19
+ }
20
+
21
+ public function getFields()
22
+ {
23
+ $fields = array(
24
+ 'login-email',
25
+ 'newsletter',
26
+ 'email',
27
+ 'billing:email'
28
+ );
29
+
30
+ return $fields;
31
+ }
32
+ }
app/code/{local → community}/EmailDirect/Integration/Block/Checkout/Subscribe.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Block/Customer/Account/Dashboard/Info.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Block/Customer/Account/Lists.php RENAMED
File without changes
app/code/community/EmailDirect/Integration/Block/Signup.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Block_Signup extends Mage_Core_Block_Template
4
+ {
5
+ private $_test_mode = false;
6
+ private $_signup_width = 0;
7
+ private $_signup_height = 0;
8
+ private $_signup_url = "";
9
+ private $_signup_delay = 0;
10
+ private $_signup_opacity = 0;
11
+
12
+ private $_active = false;
13
+
14
+ public function __construct()
15
+ {
16
+ if ($this->helper('emaildirect')->canShowSignup())
17
+ {
18
+ $this->_active = true;
19
+
20
+ if ($this->helper('emaildirect')->isSignupTest())
21
+ {
22
+ $this->_test_mode = true;
23
+ $request = Mage::app()->getRequest();
24
+
25
+ $this->_signup_width = $request->getParam('width');
26
+ $this->_height = $request->getParam('height');
27
+ $this->_signup_url = $request->getParam('url');
28
+ $this->_signup_delay = $request->getParam('delay');
29
+ $this->_signup_opacity = $request->getParam('opacity');
30
+ }
31
+ else
32
+ {
33
+ $this->_signup_width = $this->helper('emaildirect')->config('signup_width');
34
+ $this->_height = $this->helper('emaildirect')->config('signup_height');
35
+ $this->_signup_url = $this->helper('emaildirect')->config('signup_url');
36
+ $this->_signup_delay = $this->helper('emaildirect')->config('signup_delay');
37
+ $this->_signup_opacity = $this->helper('emaildirect')->config('signup_opacity');
38
+ }
39
+
40
+ if ($this->_signup_width == "" || $this->_height == "" || $this->_signup_url == "")
41
+ $this->_active = false;
42
+ }
43
+ }
44
+
45
+ protected function _toHtml()
46
+ {
47
+ if (!$this->_active)
48
+ return "";
49
+
50
+ return parent::_toHtml();
51
+ }
52
+
53
+ public function getSignupWidth()
54
+ {
55
+ return "{$this->_signup_width}px";
56
+ }
57
+
58
+ public function getSignupHeight()
59
+ {
60
+ return "{$this->_height}px";
61
+ }
62
+
63
+ public function getSignupFrameWidth()
64
+ {
65
+ return "100%";
66
+ }
67
+
68
+ public function getSignupFrameHeight()
69
+ {
70
+ return "100%";
71
+ }
72
+
73
+ public function getSignupUrl()
74
+ {
75
+ return $this->_signup_url;
76
+ }
77
+
78
+ public function getSignupDelay()
79
+ {
80
+ return (int)$this->_signup_delay * 1000;
81
+ }
82
+
83
+ public function getSignupOpacity()
84
+ {
85
+ return (int)$this->_signup_opacity;
86
+ }
87
+
88
+ public function isSignupTest()
89
+ {
90
+ return $this->_test_mode;
91
+ }
92
+ }
app/code/community/EmailDirect/Integration/Block/Widget/Grid/Column/Renderer/Abandoned/Minutes.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_Abandoned_Minutes extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
+ {
4
+ public function render(Varien_Object $row)
5
+ {
6
+ $processed_date = $row->getData('date_sent');
7
+
8
+ if ($processed_date != "")
9
+ return "";
10
+
11
+ $abandoned_date = strtotime($row->getData('updated_at'));
12
+
13
+ $current_date = Mage::getModel('core/date')->gmtTimestamp();
14
+
15
+ $minutes = round(abs($current_date - $abandoned_date) / 60,0);
16
+
17
+ $class = 'ab_ok';
18
+ if ($minutes > 60)
19
+ $class = 'ab_ng';
20
+
21
+ return "<span class='{$class}'>{$minutes}</span>";
22
+ }
23
+ }
app/code/{local → community}/EmailDirect/Integration/Block/Widget/Grid/Column/Renderer/Action.php RENAMED
@@ -2,10 +2,15 @@
2
 
3
  class EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
4
  {
5
-
6
  public function render(Varien_Object $row)
7
  {
8
- $processed_date = $row->getData('emaildirect_abandoned_date');
 
 
 
 
 
 
9
  $processed = $processed_date != "";
10
 
11
  $actions = $this->getColumn()->getActions();
@@ -16,7 +21,7 @@ class EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_Action extends M
16
 
17
  foreach ($actions as $action)
18
  {
19
- if (is_array($action))
20
  {
21
  // Change text if cart has already been sent
22
  if ($action['sent'] == $processed)
@@ -30,4 +35,4 @@ class EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_Action extends M
30
  }
31
  return $out;
32
  }
33
- }
2
 
3
  class EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
4
  {
 
5
  public function render(Varien_Object $row)
6
  {
7
+ $processed_date = $row->getData('date_sent');
8
+
9
+ $store_id = $row->getData('store_id');
10
+
11
+ if (!Mage::helper('emaildirect')->getAbandonedEnabled($store_id))
12
+ return '';
13
+
14
  $processed = $processed_date != "";
15
 
16
  $actions = $this->getColumn()->getActions();
21
 
22
  foreach ($actions as $action)
23
  {
24
+ if (is_array($action))
25
  {
26
  // Change text if cart has already been sent
27
  if ($action['sent'] == $processed)
35
  }
36
  return $out;
37
  }
38
+ }
app/code/{local → community}/EmailDirect/Integration/Helper/Data.php RENAMED
@@ -82,25 +82,43 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
82
  $orders->addAttributeToFilter('store_id', array('eq' => $store));
83
 
84
  if (!$include)
85
- $orders->addAttributeToFilter('sent_to_emaildirect', array('eq' => 0));
 
 
 
 
 
86
 
87
  return $orders;
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  public function formatSize($size)
91
  {
92
  try
93
  {
94
  if ($size == 0 || $size == null || $size == "")
95
  return "0 b";
96
-
97
  $unit = array('b','kb','mb','gb','tb','pb');
98
-
99
  $numeric_size = @round($size/pow(1024,($i=$size?floor(log($size,1024)):0)),2);
100
-
101
  if (!isset($unit[$i]))
102
  return "Unknown";
103
-
104
  return "{$numeric_size} {$unit[$i]}";
105
  }
106
  catch (Exception $e)
@@ -134,7 +152,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
134
  public function getExportFileName($name,$full = true)
135
  {
136
  $filename = "{$name}.csv";
137
- // get name from config page?
138
  if ($full)
139
  return Mage::getBaseDir('export').'/' . $filename;
140
 
@@ -146,6 +164,16 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
146
  return $this->config('apikey',$store);
147
  }
148
 
 
 
 
 
 
 
 
 
 
 
149
  public function updateConfig($path, $value, $store = 0, $base_path = 'general')
150
  {
151
  $scope = "stores";
@@ -161,14 +189,31 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
161
  $config->cleanCache();
162
  }
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  public function getCurrentStore()
165
  {
166
  $store = Mage::app()->getStore()->getId();
167
 
168
- $configscope = Mage::app()->getRequest()->getParam('store');
169
 
170
- if ($configscope)
171
- $store = $configscope;
 
 
172
  else if (!is_null($this->_current_store))
173
  $store = $this->_current_store;
174
 
@@ -184,7 +229,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
184
  $store = $this->getCurrentStore();
185
 
186
  $realvalue = Mage::getStoreConfig("emaildirect/{$section}/{$value}", $store);
187
-
188
  return $realvalue;
189
  }
190
 
@@ -216,34 +261,34 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
216
  $invalid_columns[] = $cf['name'];
217
  }
218
 
219
- $options = array();
220
-
221
  if (!isset($columns))
222
  return $options;
223
 
224
- foreach ($columns as $column)
225
- {
226
- if ($column->IsCustom == 'true' && !in_array((string)$column->ColumnName,$invalid_columns))
227
- {
228
- $key = (string)$column->ColumnName;
229
-
230
- $options[$key] = $key;
231
- }
232
- }
233
 
234
- return $options;
235
- }
236
 
237
  public function getShippingColumnOptions()
238
  {
239
- $options = array(
240
- 'shipping_code' => 'Shipping Code',
241
- 'shipping_description' => 'Shipping Description',
242
- 'carrier_code' => 'Tracking Carrier Code',
243
- 'title' => 'Tracking Title',
244
- 'number' => 'Tracking Number');
245
-
246
- return $options;
247
  }
248
 
249
  public function getDefaultPublication($storeId)
@@ -254,24 +299,22 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
254
  public function getMergeVars($customer, $includeEmail = FALSE)
255
  {
256
  $merge_vars = array();
257
- $maps = unserialize( $this->config('map_fields', $customer->getStoreId()) );
258
-
259
  if($maps)
260
  {
261
- $this->processMap($merge_vars, $maps, $customer);
262
- }
263
-
264
- $address_maps = unserialize( $this->config('address_fields', $customer->getStoreId()) );
265
-
266
- // Process address
267
- if ($address_maps)
268
- {
269
- $address = $customer->getBillingAddress();
270
- if ($address)
271
- {
272
- $this->processMap($merge_vars, $address_maps, $address);
273
- }
274
- }
275
 
276
  return $merge_vars;
277
  }
@@ -285,7 +328,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
285
  {
286
  foreach($_shipment->getAllTracks() as $tracknum)
287
  {
288
- return $tracknum->getData();
289
  }
290
  }
291
 
@@ -318,19 +361,17 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
318
  public function getOrderMergeVars(&$merge_vars, $order)
319
  {
320
  $this->log('getOrderMergeVars');
321
- $maps = unserialize( $this->config('shipping_fields', $order->getStoreId()) );
322
-
323
  if ($maps)
324
  {
325
-
326
  $this->log($maps, "Maps");
327
  $shipping_data = $this->getShippingData($order);
328
 
329
-
330
  $this->log($shipping_data,'Shipping Data');
331
 
332
- $this->processMap($merge_vars, $maps, $shipping_data);
333
- }
334
 
335
  return $merge_vars;
336
  }
@@ -340,7 +381,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
340
  $this->log('getTrackingMergeVars Start');
341
 
342
  $merge_vars = array();
343
- $maps = unserialize( $this->config('shipping_fields', $order->getStoreId()) );
344
 
345
  if (!$maps)
346
  return null;
@@ -349,71 +390,121 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
349
 
350
  $this->log($track->getData(), "Tracking Data");
351
 
352
- $this->processMap($merge_vars, $maps, $track);
353
 
354
  return $merge_vars;
355
  }
356
 
357
  private function processMap(&$merge_vars,$maps, $data)
358
  {
359
- $request = Mage::app()->getRequest();
360
-
361
- foreach($maps as $map)
362
- {
363
- $customAtt = $map['magento'];
364
- $emaildirectTag = $key = $map['emaildirect'];
365
-
366
- if($emaildirectTag && $customAtt)
367
- {
368
- switch ($customAtt)
 
 
369
  {
370
- case 'state_code':
371
- {
372
- $region_id = $data->getData('region_id');
373
-
374
- $region = Mage::getModel('directory/region')->load($region_id);
375
-
376
- if (!$region)
377
- continue;
378
-
379
- $state_code = $region->getCode();
 
 
380
 
381
  if ($state_code != "")
382
- $merge_vars[$key] = $state_code;
383
- }
384
- break;
385
- case 'date_of_purchase':
386
- $last_order = Mage::getResourceModel('sales/order_collection')
387
- ->addFieldToFilter('customer_id', $data->getId())
388
- ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
389
- ->setOrder('created_at', 'desc')
390
- ->getFirstItem();
391
-
392
- if ( $last_order->getId() )
393
- {
394
- $merge_vars[$key] = Mage::helper('core')->formatDate($last_order->getCreatedAt());
395
- }
396
-
397
- break;
398
- default:
399
-
400
- if( ($value = (string)$data->getData(strtolower($customAtt)))
401
- OR ($value = (string)$request->getPost(strtolower($customAtt))) )
402
- {
403
- $merge_vars[$key] = $value;
404
- }
405
-
406
- break;
407
  }
 
 
408
 
409
- }
410
- }
411
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  public function canCheckoutSubscribe()
414
  {
 
 
 
415
  return (bool)($this->config('checkout_subscribe') != 0);
416
  }
 
417
  public function canEdirect()
418
  {
419
  // Necessary?
@@ -425,6 +516,11 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
425
  if ($active && $setup)
426
  return true;
427
 
 
 
 
 
 
428
  $controller = Mage::app()->getRequest()->getControllerName();
429
 
430
  if ($controller == 'system_config')
@@ -449,10 +545,38 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
449
  $customer->setPrimaryShippingAddress($order->getShippingAddress());
450
  Mage::register('ed_guest_customer', $customer, TRUE);
451
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
452
 
453
- public function getAbandonedLastRunHtml()
454
  {
455
- $last_run = $this->config('abandoned_last_run');
456
 
457
  $class = 'ab_ng';
458
 
@@ -480,6 +604,16 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
480
 
481
  return "<span class='{$class}'>{$last_run}{$minutes}</span>";
482
  }
 
 
 
 
 
 
 
 
 
 
483
 
484
  public function getAdminUrl($url)
485
  {
@@ -491,7 +625,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
491
  foreach ($url_params as $up)
492
  {
493
  if ($request->getParam($up))
494
- $params[$up] = $request->getParam($up);
495
  }
496
 
497
  return Mage::helper("adminhtml")->getUrl($url, $params);
@@ -502,9 +636,31 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
502
  $active = $this->config('active');
503
  $setup = $this->config('setup');
504
  $sendit = $this->config('sendorder');
505
-
506
- if (!$sendit || !$setup || !$active)
507
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
508
 
509
  return true;
510
  }
@@ -527,20 +683,28 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
527
  if ($base != "")
528
  return $base;
529
 
530
- //$sendit = $this->config('sendorder');
531
-
532
  return "Sending Orders is disabled.";
533
  }
534
 
535
- public function getAbandonedEnabled()
536
  {
537
- $active = $this->config('active');
538
- $setup = $this->config('setup');
539
- $sendit = $this->config('sendabandoned');
540
- $abandoned_setup = $this->config('abandonedsetup');
541
-
542
- if (!$sendit || !$setup || !$active || !$abandoned_setup)
543
- return false;
 
 
 
 
 
 
 
 
 
 
544
 
545
  return true;
546
  }
@@ -551,7 +715,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
551
 
552
  if ($base != "")
553
  return $base;
554
-
555
  if (!$this->config('abandonedsetup'))
556
  return "Abandoned Cart Processing Not Setup.";
557
 
@@ -572,7 +736,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
572
  <th>Value</th>
573
  </tr>
574
  </thead>";
575
-
576
  foreach ($table as $key => $value)
577
  {
578
  $output .= "<tr class='border'>
@@ -619,7 +783,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
619
  <th>EmailDirect</th>
620
  </tr>
621
  </thead>";
622
-
623
  foreach ($data as $row)
624
  {
625
  $output .= "<tbody><tr class='border'><td>{$row['magento']}</td><td>{$row['emaildirect']}</td></tr></tbody>";
@@ -676,8 +840,6 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
676
  }
677
  }
678
 
679
-
680
-
681
  $store_data[$store->getName()] = $data;
682
  }
683
 
@@ -688,13 +850,15 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
688
  {
689
  $log_file = $this->getLogFilePath();
690
 
 
 
 
691
  $max_size = $this->getMaxLogFileSize();
692
  $log_file_size = filesize($log_file);
693
  $offset = 0;
694
 
695
  if ($log_file_size > $max_size)
696
- $offset = $log_file_size - $max_size;
697
-
698
 
699
  return htmlentities(file_get_contents($log_file,false,null,$offset));
700
  }
@@ -734,6 +898,12 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
734
  return $this->troubleConfig('max_file_size');
735
  }
736
 
 
 
 
 
 
 
737
  public function turnOnTroubleshooting($store = null)
738
  {
739
  $date = date(Mage::getModel('core/date')->gmtTimestamp());
@@ -746,25 +916,6 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
746
  {
747
  $this->updateConfig("start_date","",$store,"troubleshooting");
748
  $this->updateConfig("enabled","0",$store,"troubleshooting");
749
-
750
- $log_file = $this->getLogFileName();
751
-
752
- return;
753
-
754
- // Need to add path and give options to send/view specific files before enabling
755
- if (!file_exists($log_file))
756
- return; // Ignore
757
-
758
- Mage::log("Rename Log File: [$log_file]", null,'test.log');
759
-
760
- $date = date(Mage::getModel('core/date')->gmtTimestamp());
761
- $date = date(" Y_m_d_H_i_s", $date);
762
-
763
- $new_log_file = str_replace(self::LOG_FILE_EXT, $date . self::LOG_FILE_EXT, $log_file);
764
-
765
- sleep(1); // Sleep or it won't rename the file.
766
- if (!rename($log_file,$new_log_file) && !$quiet)
767
- Mage::throwException("Failed to Rename Log File");
768
  }
769
 
770
  // Newsletter
@@ -833,16 +984,16 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
833
 
834
  private function getLists()
835
  {
 
836
  $additional_lists = $this->config('additional_lists');
837
 
838
  if ($additional_lists == "")
839
- return null;
840
 
841
  $active_lists = explode(",",$additional_lists);
842
 
843
  $all_lists = Mage::getSingleton('emaildirect/wrapper_lists')->getLists();
844
 
845
- $list_data = array();
846
  foreach($all_lists as $list)
847
  {
848
  if (in_array($list['id'],$active_lists))
@@ -860,18 +1011,31 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
860
  {
861
  $this->setLogArea(self::CUSTOMER);
862
  $this->setLogLevel(self::LOG_LEVEL_LOW);
863
- $data = array(
864
- 'publication' => $this->getPublication(),
865
- 'lists' => $this->getLists(),
866
- 'count' => 0,
867
- 'list_count' => 0
868
- );
869
 
870
- $data = $this->getSubscriberData($data, $email);
 
 
 
 
 
871
 
872
- $this->resetLogLevel();
873
-
874
- return $data;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
875
  }
876
 
877
  public function formatXml($xml_string)
@@ -890,46 +1054,6 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
890
  return $xml_string;
891
  }
892
  }
893
-
894
- public function checkDatabaseColumns()
895
- {
896
- $resource = Mage::getSingleton('core/resource');
897
- $database_columns = array('sales_flat_quote' =>
898
- array(
899
- array('column' => 'emaildirect_abandoned_date', 'type' => 'TIMESTAMP NULL'),
900
- array('column' => 'emaildirect_abandoned_url', 'type' => 'Text NULL')
901
- ),
902
- 'sales_flat_order' =>
903
- array(
904
- array('column' => 'sent_to_emaildirect', 'type' => 'BOOLEAN NULL DEFAULT 0')
905
- )
906
- );
907
- $failed = array();
908
-
909
- foreach ($database_columns as $table => $columns)
910
- {
911
- $table = $resource->getTableName($table);
912
-
913
- foreach ($columns as $column)
914
- {
915
- try
916
- {
917
- $sql = "SELECT {$column['column']} FROM {$table} LIMIT 1";
918
-
919
-
920
- $resource->getConnection('core_read')
921
- ->query($sql);
922
- }
923
- catch (Exception $e)
924
- {
925
- $sql = "ALTER TABLE `{$table}` ADD COLUMN `{$column['column']}` {$column['type']}";
926
- $failed[] = array('table' => $table, 'column' => $column['column'], 'type' => $column['type'], 'sql' => $sql);
927
- }
928
- }
929
- }
930
-
931
- return $failed;
932
- }
933
 
934
  // LOGGING
935
 
82
  $orders->addAttributeToFilter('store_id', array('eq' => $store));
83
 
84
  if (!$include)
85
+ {
86
+ $orders->getSelect()->joinLeft(array('ed_or' => Mage::getSingleton('core/resource')->getTableName("emaildirect/order")),"ed_or.order_id=main_table.entity_id",array(
87
+ 'date_sent' => "date_sent"
88
+ ));
89
+ $orders->getSelect()->where('`ed_or`.`date_sent` IS NULL');
90
+ }
91
 
92
  return $orders;
93
  }
94
 
95
+ public function getProductExportCollection($include = false, $store = null)
96
+ {
97
+ $products = Mage::getModel('catalog/product')->getCollection();
98
+
99
+ if ($include == false)
100
+ $products->addFieldToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
101
+
102
+ if ($store != null && $store != 0)
103
+ $products->addStoreFilter($store);
104
+
105
+ return $products;
106
+ }
107
+
108
  public function formatSize($size)
109
  {
110
  try
111
  {
112
  if ($size == 0 || $size == null || $size == "")
113
  return "0 b";
114
+
115
  $unit = array('b','kb','mb','gb','tb','pb');
116
+
117
  $numeric_size = @round($size/pow(1024,($i=$size?floor(log($size,1024)):0)),2);
118
+
119
  if (!isset($unit[$i]))
120
  return "Unknown";
121
+
122
  return "{$numeric_size} {$unit[$i]}";
123
  }
124
  catch (Exception $e)
152
  public function getExportFileName($name,$full = true)
153
  {
154
  $filename = "{$name}.csv";
155
+
156
  if ($full)
157
  return Mage::getBaseDir('export').'/' . $filename;
158
 
164
  return $this->config('apikey',$store);
165
  }
166
 
167
+ public function isWebsiteConfig()
168
+ {
169
+ $request = Mage::app()->getRequest();
170
+
171
+ if ($request->getParam('website') && !$request->getParam('store'))
172
+ return true;
173
+
174
+ return false;
175
+ }
176
+
177
  public function updateConfig($path, $value, $store = 0, $base_path = 'general')
178
  {
179
  $scope = "stores";
189
  $config->cleanCache();
190
  }
191
 
192
+ public function deleteConfig($path, $store = 0, $base_path = 'general')
193
+ {
194
+ $scope = "stores";
195
+
196
+ if ($store == null)
197
+ $store = $this->getCurrentStore();
198
+
199
+ if ($store == 0)
200
+ $scope = "default";
201
+
202
+ $config = Mage::getConfig();
203
+ $config->deleteConfig("emaildirect/{$base_path}/{$path}",$scope,$store);
204
+ $config->cleanCache();
205
+ }
206
+
207
  public function getCurrentStore()
208
  {
209
  $store = Mage::app()->getStore()->getId();
210
 
211
+ $config_store = Mage::app()->getRequest()->getParam('store');
212
 
213
+ $on_config = $this->onConfigPage();
214
+
215
+ if ($config_store && $on_config)
216
+ $store = $config_store;
217
  else if (!is_null($this->_current_store))
218
  $store = $this->_current_store;
219
 
229
  $store = $this->getCurrentStore();
230
 
231
  $realvalue = Mage::getStoreConfig("emaildirect/{$section}/{$value}", $store);
232
+
233
  return $realvalue;
234
  }
235
 
261
  $invalid_columns[] = $cf['name'];
262
  }
263
 
264
+ $options = array();
265
+
266
  if (!isset($columns))
267
  return $options;
268
 
269
+ foreach ($columns as $column)
270
+ {
271
+ if ($column->IsCustom == 'true' && !in_array((string)$column->ColumnName,$invalid_columns))
272
+ {
273
+ $key = (string)$column->ColumnName;
274
+
275
+ $options[$key] = $key;
276
+ }
277
+ }
278
 
279
+ return $options;
280
+ }
281
 
282
  public function getShippingColumnOptions()
283
  {
284
+ $options = array(
285
+ 'shipping_code' => 'Shipping Code',
286
+ 'shipping_description' => 'Shipping Description',
287
+ 'carrier_code' => 'Tracking Carrier Code',
288
+ 'title' => 'Tracking Title',
289
+ 'number' => 'Tracking Number');
290
+
291
+ return $options;
292
  }
293
 
294
  public function getDefaultPublication($storeId)
299
  public function getMergeVars($customer, $includeEmail = FALSE)
300
  {
301
  $merge_vars = array();
302
+ $maps = unserialize( $this->config('map_fields', $customer->getStoreId()) );
303
+
304
  if($maps)
305
  {
306
+ $this->processMap($merge_vars, $maps, $customer);
307
+ }
308
+
309
+ $address_maps = unserialize( $this->config('address_fields', $customer->getStoreId()) );
310
+
311
+ // Process address
312
+ if ($address_maps)
313
+ {
314
+ $address = $customer->getBillingAddress();
315
+ if ($address)
316
+ $this->processMap($merge_vars, $address_maps, $address);
317
+ }
 
 
318
 
319
  return $merge_vars;
320
  }
328
  {
329
  foreach($_shipment->getAllTracks() as $tracknum)
330
  {
331
+ return $tracknum->getData();
332
  }
333
  }
334
 
361
  public function getOrderMergeVars(&$merge_vars, $order)
362
  {
363
  $this->log('getOrderMergeVars');
364
+ $maps = unserialize( $this->config('shipping_fields', $order->getStoreId()) );
365
+
366
  if ($maps)
367
  {
 
368
  $this->log($maps, "Maps");
369
  $shipping_data = $this->getShippingData($order);
370
 
 
371
  $this->log($shipping_data,'Shipping Data');
372
 
373
+ $this->processMap($merge_vars, $maps, $shipping_data);
374
+ }
375
 
376
  return $merge_vars;
377
  }
381
  $this->log('getTrackingMergeVars Start');
382
 
383
  $merge_vars = array();
384
+ $maps = unserialize( $this->config('shipping_fields', $order->getStoreId()) );
385
 
386
  if (!$maps)
387
  return null;
390
 
391
  $this->log($track->getData(), "Tracking Data");
392
 
393
+ $this->processMap($merge_vars, $maps, $track);
394
 
395
  return $merge_vars;
396
  }
397
 
398
  private function processMap(&$merge_vars,$maps, $data)
399
  {
400
+ $request = Mage::app()->getRequest();
401
+
402
+ foreach($maps as $map)
403
+ {
404
+ // Make sure we have values for both
405
+ if (!isset($map['magento']) || !isset($map['emaildirect']))
406
+ continue;
407
+
408
+ $custom_field = $map['magento'];
409
+ $emaildirect_field = $map['emaildirect'];
410
+
411
+ if ($emaildirect_field && $custom_field)
412
  {
413
+ switch ($custom_field)
414
+ {
415
+ case 'state_code':
416
+ {
417
+ $region_id = $data->getData('region_id');
418
+
419
+ $region = Mage::getModel('directory/region')->load($region_id);
420
+
421
+ if (!$region)
422
+ continue;
423
+
424
+ $state_code = $region->getCode();
425
 
426
  if ($state_code != "")
427
+ $merge_vars[$emaildirect_field] = $state_code;
428
+ } break;
429
+ case 'date_of_purchase':
430
+ {
431
+ $last_order = Mage::getResourceModel('sales/order_collection')
432
+ ->addFieldToFilter('customer_id', $data->getId())
433
+ ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
434
+ ->setOrder('created_at', 'desc')
435
+ ->getFirstItem();
436
+
437
+ if ( $last_order->getId() )
438
+ {
439
+ $merge_vars[$emaildirect_field] = Mage::helper('core')->formatDate($last_order->getCreatedAt());
440
+ }
441
+ } break;
442
+ default:
443
+ {
444
+ if (($value = (string)$data->getData(strtolower($custom_field)))
445
+ OR ($value = (string)$request->getPost(strtolower($custom_field))))
446
+ {
447
+ $merge_vars[$emaildirect_field] = $value;
448
+ }
449
+ } break;
450
+ }
 
451
  }
452
+ }
453
+ }
454
 
455
+ public function isSignupTest()
456
+ {
457
+ return Mage::app()->getRequest()->getParam('signup_test') == "true";
458
+ }
459
+
460
+ public function canCapture()
461
+ {
462
+ if (!$this->canEdirect())
463
+ return false;
464
+
465
+ if ((bool)($this->config('capture_enabled') != 0) && !Mage::helper('customer')->isLoggedIn())
466
+ return true;
467
+ }
468
+
469
+ public function canShowSignup()
470
+ {
471
+ if ($this->isSignupTest())
472
+ return true;
473
+
474
+ if (!$this->canEdirect())
475
+ return false;
476
+
477
+ if ((bool)($this->config('signup_enabled') != 0) && (bool)($this->config('signup_activated') != 0))
478
+ {
479
+ $last_closed = Mage::getModel('core/cookie')->get('ed_signup');
480
+
481
+ $recurrence = $this->config('signup_recurrence');
482
+
483
+ if ($last_closed == "")
484
+ return true;
485
 
486
+ switch ($recurrence)
487
+ {
488
+ case "once": return false;
489
+ default:
490
+ $last_closed = strtotime("+{$recurrence}",$last_closed); break;
491
+ }
492
+
493
+ if ($last_closed > time())
494
+ return false;
495
+ }
496
+
497
+ return true;
498
+ }
499
+
500
  public function canCheckoutSubscribe()
501
  {
502
+ if (!$this->canEdirect())
503
+ return false;
504
+
505
  return (bool)($this->config('checkout_subscribe') != 0);
506
  }
507
+
508
  public function canEdirect()
509
  {
510
  // Necessary?
516
  if ($active && $setup)
517
  return true;
518
 
519
+ return $this->onConfigPage();
520
+ }
521
+
522
+ public function onConfigPage()
523
+ {
524
  $controller = Mage::app()->getRequest()->getControllerName();
525
 
526
  if ($controller == 'system_config')
545
  $customer->setPrimaryShippingAddress($order->getShippingAddress());
546
  Mage::register('ed_guest_customer', $customer, TRUE);
547
  }
548
+
549
+ public function getAbandonedStatus()
550
+ {
551
+ $stores = Mage::app()->getStores();
552
+
553
+ $abandoned_status = array(
554
+ 'enabled' => false,
555
+ 'cron_last_run' => $this->getCronLastRunHtml(),
556
+ 'stores' => array()
557
+ );
558
+
559
+ foreach ($stores as $store)
560
+ {
561
+ $data = array();
562
+
563
+ $data['id'] = $store->getId();
564
+ $data['name'] = $store->getName();
565
+ $data['enabled'] = $this->getAbandonedEnabled($store->getId());
566
+ if ($data['enabled'])
567
+ $abandoned_status['enabled'] = true;
568
+
569
+ $data['last_run'] = $this->getAbandonedLastRunhtml($store->getId());
570
+
571
+ $abandoned_status['stores'][] = $data;
572
+ }
573
+
574
+ return $abandoned_status;
575
+ }
576
 
577
+ private function getLastRunHtml($store = null, $config = 'abandoned_last_run')
578
  {
579
+ $last_run = $this->config($config, $store);
580
 
581
  $class = 'ab_ng';
582
 
604
 
605
  return "<span class='{$class}'>{$last_run}{$minutes}</span>";
606
  }
607
+
608
+ public function getAbandonedLastRunHtml($store = null)
609
+ {
610
+ return $this->getLastRunHtml($store);
611
+ }
612
+
613
+ public function getCronLastRunHtml()
614
+ {
615
+ return $this->getLastRunHtml(0, 'cron_last_run');
616
+ }
617
 
618
  public function getAdminUrl($url)
619
  {
625
  foreach ($url_params as $up)
626
  {
627
  if ($request->getParam($up))
628
+ $params[$up] = $request->getParam($up);
629
  }
630
 
631
  return Mage::helper("adminhtml")->getUrl($url, $params);
636
  $active = $this->config('active');
637
  $setup = $this->config('setup');
638
  $sendit = $this->config('sendorder');
639
+
640
+ if (!$sendit || !$setup || !$active)
641
+ return false;
642
+
643
+ return true;
644
+ }
645
+
646
+ public function getBatchEnabled()
647
+ {
648
+ $active = $this->config('active');
649
+ $setup = $this->config('setup');
650
+ $batch = $this->config('batch_enabled');
651
+
652
+ if (!$batch || !$setup || !$active)
653
+ return false;
654
+
655
+ return true;
656
+ }
657
+
658
+ public function getBatchOnly()
659
+ {
660
+ $batch_only = $this->config('batch_only');
661
+
662
+ if (!$batch_only)
663
+ return false;
664
 
665
  return true;
666
  }
683
  if ($base != "")
684
  return $base;
685
 
 
 
686
  return "Sending Orders is disabled.";
687
  }
688
 
689
+ public function getBatchDisabledReason()
690
  {
691
+ $base = $this->getDisabledReason();
692
+
693
+ if ($base != "")
694
+ return $base;
695
+
696
+ return "Sending Orders in batch is disabled.";
697
+ }
698
+
699
+ public function getAbandonedEnabled($store = null)
700
+ {
701
+ $active = $this->config('active', $store);
702
+ $setup = $this->config('setup', $store);
703
+ $sendit = $this->config('sendabandoned', $store);
704
+ $abandoned_setup = $this->config('abandonedsetup', $store);
705
+
706
+ if (!$sendit || !$setup || !$active || !$abandoned_setup)
707
+ return false;
708
 
709
  return true;
710
  }
715
 
716
  if ($base != "")
717
  return $base;
718
+
719
  if (!$this->config('abandonedsetup'))
720
  return "Abandoned Cart Processing Not Setup.";
721
 
736
  <th>Value</th>
737
  </tr>
738
  </thead>";
739
+
740
  foreach ($table as $key => $value)
741
  {
742
  $output .= "<tr class='border'>
783
  <th>EmailDirect</th>
784
  </tr>
785
  </thead>";
786
+
787
  foreach ($data as $row)
788
  {
789
  $output .= "<tbody><tr class='border'><td>{$row['magento']}</td><td>{$row['emaildirect']}</td></tr></tbody>";
840
  }
841
  }
842
 
 
 
843
  $store_data[$store->getName()] = $data;
844
  }
845
 
850
  {
851
  $log_file = $this->getLogFilePath();
852
 
853
+ if (!file_exists($log_file))
854
+ return "";
855
+
856
  $max_size = $this->getMaxLogFileSize();
857
  $log_file_size = filesize($log_file);
858
  $offset = 0;
859
 
860
  if ($log_file_size > $max_size)
861
+ $offset = $log_file_size - $max_size;
 
862
 
863
  return htmlentities(file_get_contents($log_file,false,null,$offset));
864
  }
898
  return $this->troubleConfig('max_file_size');
899
  }
900
 
901
+ public function eraseTroubleshooting($store = null)
902
+ {
903
+ $this->deleteConfig("start_date",$store,"troubleshooting");
904
+ $this->deleteConfig("enabled",$store,"troubleshooting");
905
+ }
906
+
907
  public function turnOnTroubleshooting($store = null)
908
  {
909
  $date = date(Mage::getModel('core/date')->gmtTimestamp());
916
  {
917
  $this->updateConfig("start_date","",$store,"troubleshooting");
918
  $this->updateConfig("enabled","0",$store,"troubleshooting");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
919
  }
920
 
921
  // Newsletter
984
 
985
  private function getLists()
986
  {
987
+ $list_data = array();
988
  $additional_lists = $this->config('additional_lists');
989
 
990
  if ($additional_lists == "")
991
+ return $list_data;
992
 
993
  $active_lists = explode(",",$additional_lists);
994
 
995
  $all_lists = Mage::getSingleton('emaildirect/wrapper_lists')->getLists();
996
 
 
997
  foreach($all_lists as $list)
998
  {
999
  if (in_array($list['id'],$active_lists))
1011
  {
1012
  $this->setLogArea(self::CUSTOMER);
1013
  $this->setLogLevel(self::LOG_LEVEL_LOW);
 
 
 
 
 
 
1014
 
1015
+ $data = array(
1016
+ 'publication' => array('id' => -1,'name' => 'Unknown', 'subscribed' => false, 'disabled' => true),
1017
+ 'lists' => array(),
1018
+ 'count' => 0,
1019
+ 'list_count' => 0
1020
+ );
1021
 
1022
+ try
1023
+ {
1024
+ $data['publication'] = $this->getPublication();
1025
+ $data['lists'] = $this->getLists();
1026
+
1027
+ $data = $this->getSubscriberData($data, $email);
1028
+
1029
+ $this->resetLogLevel();
1030
+
1031
+ return $data;
1032
+ }
1033
+ catch (Exception $e)
1034
+ {
1035
+ Mage::logException($e);
1036
+ $this->logException($e);
1037
+ return $data;
1038
+ }
1039
  }
1040
 
1041
  public function formatXml($xml_string)
1054
  return $xml_string;
1055
  }
1056
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1057
 
1058
  // LOGGING
1059
 
app/code/{local → community}/EmailDirect/Integration/Helper/Fields.php RENAMED
File without changes
app/code/community/EmailDirect/Integration/Helper/Upgrade.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Helper_Upgrade extends Mage_Core_Helper_Abstract
4
+ {
5
+ const INSTALL_LOG_FILE_NAME = 'emaildirect_install';
6
+
7
+ public function install_log($data)
8
+ {
9
+ Mage::log($data,null,self::INSTALL_LOG_FILE_NAME . EmailDirect_Integration_Helper_Data::LOG_FILE_EXT, true);
10
+ }
11
+
12
+ public function renameOld()
13
+ {
14
+ try
15
+ {
16
+ $local = Mage::getBaseDir('code') . DS . "local" . DS;
17
+
18
+ $old = "{$local}EmailDirect";
19
+ $new = "{$local}EmailDirect_Old";
20
+
21
+ if (is_dir($old))
22
+ rename($old,$new);
23
+ }
24
+ catch (Exception $e)
25
+ {
26
+ Mage::helper('emaildirect')->logException($e);
27
+ }
28
+ }
29
+ }
app/code/community/EmailDirect/Integration/Model/Abandoned.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_Abandoned extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('emaildirect/abandoned');
9
+ }
10
+
11
+ public function loadByQuoteId($quote_id)
12
+ {
13
+ if ($data = $this->getResource()->loadByQuoteId($quote_id))
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);
33
+ $this->setSessionId($session->getId());
34
+ $this->save();
35
+ }
36
+ }
37
+ catch (Exception $e)
38
+ {
39
+ Mage::helper('emaildirect')->logException($e);
40
+ Mage::logException($e);
41
+ }
42
+ return $this;
43
+ }
44
+ }
app/code/community/EmailDirect/Integration/Model/Mysql4/Abandoned.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_Mysql4_Abandoned extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ protected $_read = null;
6
+ protected $_write = null;
7
+
8
+ protected function _construct()
9
+ {
10
+ $this->_init('emaildirect/abandoned', 'id');
11
+ $this->_read = $this->_getReadAdapter();
12
+ $this->_write = $this->_getWriteAdapter();
13
+ }
14
+
15
+ public function loadByQuoteId($quote_id)
16
+ {
17
+ $select = $this->_read->select()
18
+ ->from($this->getTable('emaildirect/abandoned'))
19
+ ->where('quote_id=?', $quote_id);
20
+
21
+ if ($result = $this->_read->fetchRow($select))
22
+ return $result;
23
+
24
+ return false;
25
+ }
26
+ }
app/code/community/EmailDirect/Integration/Model/Mysql4/Abandoned/Collection.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_Mysql4_Abandoned_Collection extends Mage_Sales_Model_Mysql4_Quote_Collection
4
+ {
5
+ protected function _construct()
6
+ {
7
+ parent::_construct();
8
+ }
9
+
10
+ private function prepareCollection($store_ids)
11
+ {
12
+ $resource = Mage::getSingleton('core/resource');
13
+
14
+ $this->getSelect()->joinInner(array('ed_ac' => $resource->getTableName("emaildirect/abandoned")),"ed_ac.quote_id=main_table.entity_id",array(
15
+ 'date_sent' => "date_sent"
16
+ ));
17
+ $this->getSelect()->joinInner(array('ed_s' => $resource->getTableName("emaildirect/session") ),"ed_s.id=ed_ac.session_id",array(
18
+ 'email' => "IF(main_table.customer_email IS NOT NULL, main_table.customer_email, email)"
19
+ ));
20
+
21
+ $this->addFieldToFilter('items_count', array('neq' => '0'))
22
+ ->addFieldToFilter('main_table.is_active', '1');
23
+
24
+ $this->getSelect()->where('(customer_email IS NOT NULL) OR (email IS NOT NULL)');
25
+
26
+ $this->setOrder('updated_at');
27
+
28
+ if (is_array($store_ids) && !empty($store_ids))
29
+ $this->addFieldToFilter('main_table.store_id', array('in' => $store_ids));
30
+ }
31
+
32
+ /**
33
+ * Prepare for abandoned report
34
+ *
35
+ * @param array $store_ids
36
+ * @param string $filter
37
+ * @return Mage_Reports_Model_Resource_Quote_Collection
38
+ */
39
+ public function prepareForAbandonedReport($store_ids, $filter = null)
40
+ {
41
+ $this->prepareCollection($store_ids);
42
+
43
+ $this->addSubtotal($store_ids, $filter);
44
+
45
+ return $this;
46
+ }
47
+
48
+ public function prepareForAbandonedProcess($check_date, $store_id = null)
49
+ {
50
+ $store_ids = array($store_id);
51
+
52
+ $this->prepareCollection($store_ids);
53
+
54
+ $this->addFieldToFilter('date_sent',array('null' => true));
55
+ $this->addFieldToFilter('main_table.updated_at', array('lt' => $check_date));
56
+
57
+ return $this;
58
+ }
59
+
60
+ public function prepareForManualAbandonedProcess($id_list, $store_id)
61
+ {
62
+ $store_ids = array($store_id);
63
+
64
+ $this->prepareCollection($store_ids);
65
+
66
+ $this->addFieldToFilter('entity_id', array('in' => $id_list))
67
+ ->setOrder('updated_at');
68
+
69
+ return $this;
70
+ }
71
+
72
+ /**
73
+ * Add subtotals
74
+ *
75
+ * @param array $store_ids
76
+ * @param array $filter
77
+ * @return Mage_Reports_Model_Resource_Quote_Collection
78
+ */
79
+ public function addSubtotal($store_ids = '', $filter = null)
80
+ {
81
+ if (is_array($store_ids))
82
+ {
83
+ $this->getSelect()->columns(array(
84
+ 'subtotal' => '(main_table.base_subtotal_with_discount*main_table.base_to_global_rate)'
85
+ ));
86
+ $this->_joinedFields['subtotal'] =
87
+ '(main_table.base_subtotal_with_discount*main_table.base_to_global_rate)';
88
+ }
89
+ else
90
+ {
91
+ $this->getSelect()->columns(array('subtotal' => 'main_table.base_subtotal_with_discount'));
92
+ $this->_joinedFields['subtotal'] = 'main_table.base_subtotal_with_discount';
93
+ }
94
+
95
+ if ($filter && is_array($filter) && isset($filter['subtotal']))
96
+ {
97
+ if (isset($filter['subtotal']['from']))
98
+ {
99
+ $this->getSelect()->where(
100
+ $this->_joinedFields['subtotal'] . ' >= ?',
101
+ $filter['subtotal']['from'], Zend_Db::FLOAT_TYPE
102
+ );
103
+ }
104
+ if (isset($filter['subtotal']['to']))
105
+ {
106
+ $this->getSelect()->where(
107
+ $this->_joinedFields['subtotal'] . ' <= ?',
108
+ $filter['subtotal']['to'], Zend_Db::FLOAT_TYPE
109
+ );
110
+ }
111
+ }
112
+
113
+ return $this;
114
+ }
115
+ }
app/code/community/EmailDirect/Integration/Model/Mysql4/Order.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_Mysql4_Order extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ protected $_read = null;
6
+ protected $_write = null;
7
+
8
+ protected function _construct()
9
+ {
10
+ $this->_init('emaildirect/order', 'id');
11
+ $this->_read = $this->_getReadAdapter();
12
+ $this->_write = $this->_getWriteAdapter();
13
+ }
14
+
15
+ public function loadByOrderId($order_id)
16
+ {
17
+ $select = $this->_read->select()
18
+ ->from($this->getTable('emaildirect/order'))
19
+ ->where('order_id=?', $order_id);
20
+
21
+ if ($result = $this->_read->fetchRow($select))
22
+ return $result;
23
+
24
+ return false;
25
+ }
26
+ }
app/code/community/EmailDirect/Integration/Model/Mysql4/Order/Collection.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_Mysql4_Order_Collection extends Mage_Sales_Model_Mysql4_Order_Collection
4
+ {
5
+ protected $_helper = null;
6
+
7
+ protected function _construct()
8
+ {
9
+ $this->_helper = Mage::helper('emaildirect');
10
+ parent::_construct();
11
+ }
12
+
13
+ public function prepareCollection($store_ids = '')
14
+ {
15
+ $resource = Mage::getSingleton('core/resource');
16
+
17
+ $this->getSelect()->joinLeft(array('ed_or' => $resource->getTableName("emaildirect/order")),"ed_or.order_id=main_table.entity_id",array(
18
+ 'date_sent' => "date_sent"
19
+ ));
20
+
21
+ if (is_array($store_ids) && !empty($store_ids))
22
+ $this->addFieldToFilter('main_table.store_id', array('in' => $store_ids));
23
+
24
+ $this->getSelect()->order('created_at ASC');
25
+
26
+ return $this;
27
+ }
28
+
29
+ private function stateStatusFilter()
30
+ {
31
+ $mode = $this->_helper->config('send_field');
32
+
33
+ if ($mode == "state")
34
+ $options = $this->_helper->config('send_states');
35
+ else
36
+ $options = $this->_helper->config('send_statuses');
37
+
38
+ $option_list = explode(",",$options);
39
+
40
+ $this->addFieldToFilter($mode, array('in' => $option_list));
41
+ }
42
+
43
+ private function limitByDate()
44
+ {
45
+ $this->_helper = Mage::helper('emaildirect');
46
+
47
+ $date_adj = $this->_helper->config('batch_date_adjust');
48
+
49
+ if ($date_adj == null || $date_adj == "")
50
+ $date_adj = "-1 week";
51
+
52
+ $time = date("Y-m-d",strtotime($date_adj, Mage::getModel('core/date')->timestamp(time())));
53
+
54
+ $limit_date = Mage::getModel('core/date')->gmtDate(null,strtotime($time));
55
+
56
+ $this->addAttributeToFilter('created_at', array('from' => $limit_date));
57
+ }
58
+
59
+ public function getUnsentOrders($store_id = null, $limit = 100)
60
+ {
61
+ $store_ids = null;
62
+ if ($store_id != null)
63
+ $store_ids = array($store_id);
64
+
65
+ $this->prepareCollection($store_ids);
66
+
67
+ $this->addFieldToFilter('date_sent', array('null' => true));
68
+
69
+ $this->limitByDate();
70
+
71
+ $this->stateStatusFilter();
72
+
73
+ if ($limit != null && $limit != "")
74
+ $this->getSelect()->limit($limit);
75
+
76
+ return $this;
77
+ }
78
+ }
app/code/community/EmailDirect/Integration/Model/Mysql4/Session.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_Mysql4_Session extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ protected $_read = null;
6
+ protected $_write = null;
7
+
8
+ protected function _construct()
9
+ {
10
+ $this->_init('emaildirect/session', 'id');
11
+ $this->_read = $this->_getReadAdapter();
12
+ $this->_write = $this->_getWriteAdapter();
13
+ }
14
+
15
+ public function loadByMagentoSessionId($magento_session_id)
16
+ {
17
+ $select = $this->_read->select()
18
+ ->from($this->getTable('emaildirect/session'))
19
+ ->where('magento_session_id=?', $magento_session_id);
20
+
21
+ if ($result = $this->_read->fetchRow($select))
22
+ return $result;
23
+
24
+ return false;
25
+ }
26
+ }
app/code/community/EmailDirect/Integration/Model/Mysql4/Session/Collection.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_Mysql4_Session_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ protected function _construct()
6
+ {
7
+ $this->_init('emaildirect/session');
8
+ }
9
+
10
+ public function addStoreFilter($store_ids)
11
+ {
12
+ $this->getSelect()->where('main_table.store_id IN (?)', $store_ids);
13
+ return $this;
14
+ }
15
+ }
app/code/{local → community}/EmailDirect/Integration/Model/Observer.php RENAMED
@@ -10,6 +10,8 @@ class EmailDirect_Integration_Model_Observer
10
  private $_sequence_enabled = false;
11
  private $_sequence_field = "";
12
 
 
 
13
  public function __construct()
14
  {
15
  $this->_helper = Mage::helper('emaildirect');
@@ -130,7 +132,7 @@ class EmailDirect_Integration_Model_Observer
130
  {
131
  if (!$this->_helper->canEdirect())
132
  return $observer;
133
-
134
  $block = $observer->getEvent()->getBlock();
135
 
136
  if (get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
@@ -215,6 +217,15 @@ class EmailDirect_Integration_Model_Observer
215
  {
216
  $post = Mage::app()->getRequest()->getPost();
217
 
 
 
 
 
 
 
 
 
 
218
  $status = $post['groups']['troubleshooting']['fields']['enabled']['value'];
219
 
220
  if ($status)
@@ -223,28 +234,13 @@ class EmailDirect_Integration_Model_Observer
223
  $this->_helper->turnOffTroubleshooting($store);
224
  }
225
 
226
- private function getStoreId($code)
227
- {
228
- if ($code == null)
229
- return 0;
230
-
231
- try
232
- {
233
- $store = Mage::getModel("core/store")->load($code);
234
- return $store->getId();
235
- }
236
- catch (Exception $e)
237
- {
238
- return 0;
239
- }
240
- }
241
-
242
  public function saveConfig(Varien_Event_Observer $observer)
243
  {
244
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::CONFIG);
245
  $this->_helper->setLogLevel(EmailDirect_Integration_Helper_Data::LOG_LEVEL_LOW);
246
- $store = $this->getStoreId($observer->getEvent()->getStore());
247
  $post = Mage::app()->getRequest()->getPost();
 
248
  $fields = $post['groups']['general']['fields'];
249
 
250
  $apiKey = isset($fields['apikey']['value']) ? $fields['apikey']['value'] : $this->_helper->config('apikey');
@@ -252,7 +248,6 @@ class EmailDirect_Integration_Model_Observer
252
  if ($apiKey == '')
253
  {
254
  $this->_helper->updateConfig('setup', 0, $store);
255
- //$this->_helper->updateConfig('setup', 0, $store, 'export');
256
  $this->_helper->updateConfig('active', false, $store);
257
  return $observer;
258
  }
@@ -262,12 +257,14 @@ class EmailDirect_Integration_Model_Observer
262
  if (is_string($sources))
263
  {
264
  $this->_helper->updateConfig('setup', 0, $store);
265
- //$this->_helper->updateConfig('setup', false, $store, 'export');
266
- Mage::throwException($sources);
 
 
 
267
  }
268
 
269
  $this->_helper->updateConfig('setup', true, $store);
270
- //$this->_helper->updateConfig('setup', true, $store, 'export');
271
 
272
  $source = isset($fields['source']['value']) ? $fields['source']['value'] : $this->_helper->config('source');
273
 
@@ -446,46 +443,88 @@ class EmailDirect_Integration_Model_Observer
446
  return $merge_vars;
447
  }
448
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
449
  public function updateCustomer(Varien_Event_Observer $observer)
450
  {
451
  try
452
  {
453
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::CUSTOMER);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454
  $this->_helper->log("Update Customer Start");
455
 
456
  if (!$this->_helper->canEdirect())
457
  {
458
  $this->_helper->logReason($this->_helper->getDisabledReason());
459
- return $observer;
460
  }
461
 
462
- //$store = Mage::app()->getStore()->getId();
463
- $customer = $observer->getEvent()->getCustomer();
464
-
465
- $merge_vars = $this->_mergeVars($customer, TRUE);
466
 
467
  $this->_helper->log($merge_vars,"Merge Vars");
468
 
469
- $api = Mage::getSingleton('emaildirect/wrapper_subscribers');
470
-
471
  $oldEmail = $customer->getOrigData('email');
472
  $email = $customer->getEmail();
473
 
474
  if ($oldEmail == '')
475
  {
476
  $this->_helper->log("Original Email was blank. Adding Subscriber");
477
- $rc = $api->subscriberAdd($email,$merge_vars);
478
  }
479
  elseif ($oldEmail != $email)
480
  {
481
  $this->_helper->log("Modifying Email");
482
- $rc = $api->mailModify($oldEmail,$email);
 
 
483
 
484
  $this->_helper->log("Adding Subscriber");
485
- $rc = $api->subscriberAdd($email,$merge_vars);
486
  }
487
  else
488
- $this->_helper->logReason("Email has not been changed");
 
 
 
 
 
 
 
 
489
 
490
  $this->_helper->log("Update Customer End");
491
  }
@@ -510,11 +549,9 @@ class EmailDirect_Integration_Model_Observer
510
  return;
511
  }
512
  $subscribe = Mage::app()->getRequest()->getPost('emaildirect_subscribe');
513
-
514
  if(!is_null($subscribe))
515
- {
516
  Mage::getSingleton('core/session')->setEmaildirectCheckout($subscribe);
517
- }
518
 
519
  $this->_helper->log("Register Checkout Subscribe End");
520
  }
@@ -548,7 +585,7 @@ class EmailDirect_Integration_Model_Observer
548
  }
549
 
550
  $orderId = (int)current($observer->getEvent()->getOrderIds());
551
-
552
  if (!$orderId)
553
  {
554
  $this->_helper->logReason("Order ID not found.");
@@ -631,38 +668,155 @@ class EmailDirect_Integration_Model_Observer
631
  }
632
  }
633
 
634
- private function canSendOrder($order)
635
  {
636
- if ($order->getData('sent_to_emaildirect') != false)
 
 
637
  {
638
  $this->_helper->logReason("Order has already been sent.");
639
  return false;
640
  }
641
 
642
- $this->_helper->log("Order State: " . $order->getState());
 
 
 
 
 
 
 
 
 
 
 
 
643
 
644
- $states = Mage::helper('emaildirect')->config('send_states');
645
- $state_list = explode(",",$states);
646
 
647
- $this->_helper->log("Check States: " . $states);
648
- $this->_helper->log($state_list, "State array");
649
 
650
- if (array_search($order->getState(),$state_list) === FALSE)
651
- {
652
- $this->_helper->logReason("State not setup to send (" . $order->getState() . ")");
653
- return false;
 
 
 
 
 
 
 
 
 
 
 
654
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  return true;
656
  }
657
 
658
- public function orderSaveAfter(Varien_Event_Observer $observer)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
  {
660
  try
661
  {
662
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ORDERS);
663
- $this->_helper->log("Order Save After Start");
664
 
665
- $order = $observer->getEvent()->getOrder();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
666
 
667
  $this->_helper->log("Order Save After: " . $order->getIncrementId());
668
 
@@ -672,14 +826,14 @@ class EmailDirect_Integration_Model_Observer
672
  if (!$this->_helper->getOrdersEnabled())
673
  {
674
  $this->_helper->logReason($this->_helper->getOrdersDisabledReason());
675
- return $observer;
676
  }
677
 
678
- if (!$this->canSendOrder($order))
679
- return $observer;
680
 
681
- //$this->_helper->log("Order is complete. Processing...");
682
-
683
  $email = $order->getCustomerEmail();
684
 
685
  if ($order->getData('customer_is_guest'))
@@ -722,7 +876,34 @@ class EmailDirect_Integration_Model_Observer
722
 
723
  $rc = Mage::getSingleton('emaildirect/wrapper_orders')->addSubscriberOrder($email, $order, $merge_vars);
724
 
725
- $this->setOrderSentToEmailDirect($order);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
726
 
727
  $this->_helper->log("Order Save After End");
728
 
@@ -745,7 +926,7 @@ class EmailDirect_Integration_Model_Observer
745
 
746
  $date = $date - $time;
747
 
748
- return date("Y-m-d H:i:s", $date);
749
  }
750
 
751
  private function getLastOrder($quote)
@@ -771,19 +952,17 @@ class EmailDirect_Integration_Model_Observer
771
  return $order;
772
  }
773
 
774
- private function setOrderSentToEmailDirect($order)
775
  {
776
- $table_name = Mage::getSingleton('core/resource')->getTableName("sales_flat_order");
777
-
778
- $sql = "UPDATE {$table_name} SET sent_to_emaildirect = 1 WHERE entity_id = {$order->getId()}";
779
-
780
- $this->_helper->log($sql);
781
-
782
  try
783
  {
784
- Mage::getSingleton('core/resource')
785
- ->getConnection('core_write')
786
- ->query($sql);
 
 
 
 
787
  }
788
  catch (Exception $e)
789
  {
@@ -792,17 +971,14 @@ class EmailDirect_Integration_Model_Observer
792
  }
793
  }
794
 
795
- private function setSentToEmailDirectDate($quote,$date)
796
  {
797
- $table_name = Mage::getSingleton('core/resource')->getTableName("sales_flat_quote");
798
-
799
- $sql = "UPDATE {$table_name} SET emaildirect_abandoned_date = '{$date}' WHERE entity_id = {$quote->getId()}";
800
-
801
  try
802
  {
803
- Mage::getSingleton('core/resource')
804
- ->getConnection('core_write')
805
- ->query($sql);
 
806
  }
807
  catch (Exception $e)
808
  {
@@ -826,6 +1002,9 @@ class EmailDirect_Integration_Model_Observer
826
  {
827
  $this->_helper->log("ProcessAbandoned Start");
828
  $email = $quote->getCustomerEmail();
 
 
 
829
 
830
  $abandonedDate = $quote->getUpdatedAt();
831
 
@@ -835,7 +1014,7 @@ class EmailDirect_Integration_Model_Observer
835
  $merge_vars['LastName'] = $quote->getData('customer_lastname');
836
 
837
  $merge_vars['AbandonedDate'] = $abandonedDate;
838
- $merge_vars['AbandonedUrl'] = $quote->getEmaildirectAbandonedUrl();
839
 
840
  $this->addSequence($merge_vars);
841
 
@@ -877,20 +1056,21 @@ class EmailDirect_Integration_Model_Observer
877
  {
878
  // Store the time we last run
879
  $date = date(Mage::getModel('core/date')->gmtTimestamp());
880
- $date = date("Y-m-d H:i:s", $date);
881
-
882
- $this->_helper->log("Saving Last Run Date: {$date}");
883
 
884
  if ($mark_time)
 
 
885
  $this->_helper->updateConfig("abandoned_last_run", $date, $store);
886
-
 
887
  $subscribers = false;
888
 
889
  $xml = "<Subscribers>";
890
 
891
  // Get the data for each abandoned cart
892
  foreach ($collection as $quote)
893
- {
894
  $xml .= $this->processAbandoned($quote, $date);
895
  $subscribers = true;
896
  }
@@ -945,18 +1125,9 @@ class EmailDirect_Integration_Model_Observer
945
  $this->setupSequence();
946
 
947
  // Get abandoned collection
948
- $collection = Mage::getResourceModel('reports/quote_collection');
949
 
950
- $collection->addFieldToFilter('items_count', array('neq' => '0'))
951
- ->addFieldToFilter('main_table.is_active', '1')
952
- ->setOrder('updated_at');
953
-
954
- $collection->addFieldToFilter('main_table.updated_at', array('lt' => $check_date));
955
- $collection->addFieldToFilter('main_table.emaildirect_abandoned_date', array('null' => true));
956
- $collection->addFieldToFilter('main_table.emaildirect_abandoned_url', array('notnull' => true));
957
- $collection->addFieldToFilter('main_table.customer_email', array('notnull' => true));
958
-
959
- $collection->addFieldToFilter('store_id', array('eq' => $store->getId()));
960
 
961
  $this->_helper->log("SQL: " . $collection->getSelect()->__toString());
962
 
@@ -970,6 +1141,42 @@ class EmailDirect_Integration_Model_Observer
970
  $this->_helper->logException($e);
971
  }
972
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
973
 
974
  public function abandonedCartsProcessor()
975
  {
@@ -995,6 +1202,12 @@ class EmailDirect_Integration_Model_Observer
995
 
996
  Mage::app()->setCurrentStore($starting_store);
997
 
 
 
 
 
 
 
998
  $this->_helper->log("Abandoned Carts Processor End");
999
  }
1000
  catch (Exception $e)
@@ -1008,24 +1221,47 @@ class EmailDirect_Integration_Model_Observer
1008
  {
1009
  try
1010
  {
 
 
1011
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
1012
  $this->_helper->log("Sending Specific Abandoned Carts Start");
1013
 
1014
  Mage::helper('emaildirect/fields')->checkFields();
1015
 
1016
  $this->_helper->log($id_list, "ID LIST");
1017
-
1018
- // Get abandoned collection
1019
- $collection = Mage::getResourceModel('reports/quote_collection');
1020
-
1021
- $collection->addFieldToFilter('entity_id', array('in' => $id_list))
1022
- ->setOrder('updated_at');
1023
 
1024
- $this->_helper->log("SQL: " . $collection->getSelect()->__toString());
1025
-
1026
- $this->_abandonedCartsProcessor($collection, null, false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1027
 
1028
  $this->_helper->log("Sending Specific Abandoned Carts End");
 
 
1029
  }
1030
  catch (Exception $e)
1031
  {
@@ -1036,25 +1272,6 @@ class EmailDirect_Integration_Model_Observer
1036
  // END ABANDONED CRON
1037
 
1038
  // START QUOTE SAVE AFTER
1039
- private function setAbandonedUrl($quote,$url)
1040
- {
1041
- $table_name = Mage::getSingleton('core/resource')->getTableName("sales_flat_quote");
1042
-
1043
- $sql = "UPDATE {$table_name} SET emaildirect_abandoned_url = '{$url}' WHERE entity_id = {$quote->getId()}";
1044
-
1045
- try
1046
- {
1047
- Mage::getSingleton('core/resource')
1048
- ->getConnection('core_write')
1049
- ->query($sql);
1050
- }
1051
- catch (Exception $e)
1052
- {
1053
- $this->_helper->logException($e);
1054
- Mage::logException($e);
1055
- }
1056
- }
1057
-
1058
  private function getAbandonedUrl($quote)
1059
  {
1060
  // We are using comma separated lists for the ID's and Quantities so that it takes up less
@@ -1095,27 +1312,9 @@ class EmailDirect_Integration_Model_Observer
1095
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
1096
  $this->_helper->setLogLevel(EmailDirect_Integration_Helper_Data::LOG_LEVEL_LOW);
1097
  $this->_helper->log("Quote Save After Start");
1098
- $quote = $observer->getEvent()->getQuote();
1099
-
1100
- if (trim($quote->getEmaildirectAbandonedDate()))
1101
- {
1102
- $this->_helper->logReason("Already sent.");
1103
- return;
1104
- }
1105
-
1106
- $url = $this->getAbandonedUrl($quote);
1107
 
1108
- $this->_helper->log("Abandoned Url: {$url}");
1109
-
1110
- if ($quote->getEmaildirectAbandonedUrl() == $url)
1111
- {
1112
- $this->_helper->logReason("Abandoned Url is up to date.");
1113
- return;
1114
- }
1115
-
1116
- $this->_helper->log("Saving Quote.");
1117
- // Re-save quote with new URL
1118
- $this->setAbandonedUrl($quote, $url);
1119
  $this->_helper->log("Quote Save After End");
1120
  $this->_helper->resetLogLevel();
1121
  }
10
  private $_sequence_enabled = false;
11
  private $_sequence_field = "";
12
 
13
+ private $_date_format = "Y-m-d H:i:s";
14
+
15
  public function __construct()
16
  {
17
  $this->_helper = Mage::helper('emaildirect');
132
  {
133
  if (!$this->_helper->canEdirect())
134
  return $observer;
135
+
136
  $block = $observer->getEvent()->getBlock();
137
 
138
  if (get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
217
  {
218
  $post = Mage::app()->getRequest()->getPost();
219
 
220
+ $enabled = $post['groups']['troubleshooting']['fields']['enabled'];
221
+
222
+ if (isset($enabled['inherit']))
223
+ {
224
+ $inherit = $enabled['inherit'];
225
+
226
+ if ($inherit == 1)
227
+ return $this->_helper->eraseTroubleshooting($store);
228
+ }
229
  $status = $post['groups']['troubleshooting']['fields']['enabled']['value'];
230
 
231
  if ($status)
234
  $this->_helper->turnOffTroubleshooting($store);
235
  }
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  public function saveConfig(Varien_Event_Observer $observer)
238
  {
239
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::CONFIG);
240
  $this->_helper->setLogLevel(EmailDirect_Integration_Helper_Data::LOG_LEVEL_LOW);
241
+ $store = $this->_helper->getStoreId($observer->getEvent()->getStore());
242
  $post = Mage::app()->getRequest()->getPost();
243
+
244
  $fields = $post['groups']['general']['fields'];
245
 
246
  $apiKey = isset($fields['apikey']['value']) ? $fields['apikey']['value'] : $this->_helper->config('apikey');
248
  if ($apiKey == '')
249
  {
250
  $this->_helper->updateConfig('setup', 0, $store);
 
251
  $this->_helper->updateConfig('active', false, $store);
252
  return $observer;
253
  }
257
  if (is_string($sources))
258
  {
259
  $this->_helper->updateConfig('setup', 0, $store);
260
+ $e = new Exception("Module setup failed: {$sources}");
261
+ $this->_helper->logException($e);
262
+ Mage::logException($e);
263
+
264
+ Mage::throwException($e->getMessage());
265
  }
266
 
267
  $this->_helper->updateConfig('setup', true, $store);
 
268
 
269
  $source = isset($fields['source']['value']) ? $fields['source']['value'] : $this->_helper->config('source');
270
 
443
  return $merge_vars;
444
  }
445
 
446
+ private function hasCustomerChanged($customer)
447
+ {
448
+ $maps = unserialize( $this->_helper->config('map_fields', $customer->getStoreId()) );
449
+
450
+ $this->_helper->log('Checking for mapped data changes');
451
+
452
+ foreach ($maps as $map)
453
+ {
454
+ $field = $map['magento'];
455
+
456
+ if ($customer->getOrigData($field) != $customer->getData($field))
457
+ return true;
458
+ }
459
+
460
+ return false;
461
+ }
462
+
463
  public function updateCustomer(Varien_Event_Observer $observer)
464
  {
465
  try
466
  {
467
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::CUSTOMER);
468
+
469
+ $customer = $observer->getEvent()->getCustomer();
470
+
471
+ $customer_store = $customer->getStore()->getId();
472
+
473
+ $current_store = Mage::app()->getStore()->getId();
474
+
475
+ if ($current_store == 0)
476
+ {
477
+ if ($customer_store == 0)
478
+ {
479
+ $this->_helper->logReason("Customer store can't be determined");
480
+ return $observer;
481
+ }
482
+ else
483
+ $this->_helper->setCurrentStore($customer_store);
484
+ }
485
+
486
  $this->_helper->log("Update Customer Start");
487
 
488
  if (!$this->_helper->canEdirect())
489
  {
490
  $this->_helper->logReason($this->_helper->getDisabledReason());
491
+ return $observer;
492
  }
493
 
494
+ $merge_vars = $this->_mergeVars($customer, true);
 
 
 
495
 
496
  $this->_helper->log($merge_vars,"Merge Vars");
497
 
498
+ $api = Mage::getSingleton('emaildirect/wrapper_subscribers');
499
+
500
  $oldEmail = $customer->getOrigData('email');
501
  $email = $customer->getEmail();
502
 
503
  if ($oldEmail == '')
504
  {
505
  $this->_helper->log("Original Email was blank. Adding Subscriber");
506
+ $rc = $api->subscriberAdd($email,$merge_vars,"",false);
507
  }
508
  elseif ($oldEmail != $email)
509
  {
510
  $this->_helper->log("Modifying Email");
511
+
512
+ // If this fails we just add the subscriber
513
+ $rc = $api->mailModify($oldEmail,$email);
514
 
515
  $this->_helper->log("Adding Subscriber");
516
+ $rc = $api->subscriberAdd($email,$merge_vars,"",false);
517
  }
518
  else
519
+ {
520
+ if ($this->hasCustomerChanged($customer))
521
+ {
522
+ $this->_helper->log("Updating Subscriber");
523
+ $rc = $api->subscriberAdd($email,$merge_vars,"",false);
524
+ }
525
+ else
526
+ $this->_helper->logReason("Neither Email nor Mapped Data changed");
527
+ }
528
 
529
  $this->_helper->log("Update Customer End");
530
  }
549
  return;
550
  }
551
  $subscribe = Mage::app()->getRequest()->getPost('emaildirect_subscribe');
552
+
553
  if(!is_null($subscribe))
 
554
  Mage::getSingleton('core/session')->setEmaildirectCheckout($subscribe);
 
555
 
556
  $this->_helper->log("Register Checkout Subscribe End");
557
  }
585
  }
586
 
587
  $orderId = (int)current($observer->getEvent()->getOrderIds());
588
+
589
  if (!$orderId)
590
  {
591
  $this->_helper->logReason("Order ID not found.");
668
  }
669
  }
670
 
671
+ private function canSendOrder($order, $batch = false)
672
  {
673
+ $ed_order = Mage::getModel('emaildirect/order')->loadByOrderId($order->getId());
674
+
675
+ if ($ed_order != null && $ed_order->getDateSent() != null)
676
  {
677
  $this->_helper->logReason("Order has already been sent.");
678
  return false;
679
  }
680
 
681
+ // Check the old data just in case
682
+ if ($order->getData('sent_to_emaildirect') != false)
683
+ {
684
+ $this->_helper->logReason("Order has already been sent. (Older Version)");
685
+ $this->setOrderSentToEmailDirect($order, $order->getData('updated_at'));
686
+ return false;
687
+ }
688
+
689
+ if ($batch)
690
+ {
691
+ $this->_helper->log("Batch process. Skipping State/Status Check");
692
+ return true;
693
+ }
694
 
695
+ $mode = $this->_helper->config('send_field');
 
696
 
697
+ $this->_helper->log("Send Field: {$mode}");
 
698
 
699
+ if ($mode == "state")
700
+ {
701
+ $this->_helper->log("Order State: " . $order->getState());
702
+
703
+ $states = Mage::helper('emaildirect')->config('send_states');
704
+ $state_list = explode(",",$states);
705
+
706
+ $this->_helper->log("Check States: " . $states);
707
+ $this->_helper->log($state_list, "State array");
708
+
709
+ if (array_search($order->getState(),$state_list) === FALSE)
710
+ {
711
+ $this->_helper->logReason("State not setup to send (" . $order->getState() . ")");
712
+ return false;
713
+ }
714
  }
715
+ else
716
+ {
717
+ $this->_helper->log("Order Status: " . $order->getStatus());
718
+
719
+ $statuses = Mage::helper('emaildirect')->config('send_statuses');
720
+ $status_list = explode(",",$statuses);
721
+
722
+ $this->_helper->log("Check Statuses: " . $statuses);
723
+ $this->_helper->log($status_list, "Status array");
724
+
725
+ if (array_search($order->getStatus(),$status_list) === FALSE)
726
+ {
727
+ $this->_helper->logReason("Status not setup to send (" . $order->getStatus() . ")");
728
+ return false;
729
+ }
730
+ }
731
+
732
  return true;
733
  }
734
 
735
+ private function processBatchStoreOrders($store)
736
+ {
737
+ try
738
+ {
739
+ $store_code = $store->getCode();
740
+
741
+ $this->_helper->log("Processing Store: {$store_code}");
742
+
743
+ if (!$this->_helper->getBatchEnabled())
744
+ {
745
+ $this->_helper->logReason($this->_helper->getBatchDisabledReason());
746
+ return;
747
+ }
748
+
749
+ Mage::helper('emaildirect/fields')->checkFields();
750
+
751
+ // Get order collection
752
+ $collection = Mage::getResourceModel('emaildirect/order_collection');
753
+
754
+ $limit = $this->_helper->config('batch_size');
755
+
756
+ $this->_helper->log("Batch Size: [{$limit}]");
757
+
758
+ if ($limit != "")
759
+ {
760
+ if (!is_numeric($limit))
761
+ $limit = 100;
762
+ else
763
+ $limit = (int)$limit;
764
+ }
765
+
766
+ $collection->getUnsentOrders($store->getId(), $limit);
767
+
768
+ $this->_helper->log("SQL: " . $collection->getSelect()->__toString());
769
+
770
+ foreach ($collection as $order)
771
+ {
772
+ $this->processSavedOrder($order, true);
773
+ }
774
+
775
+ $this->_helper->log("Finished Processing Store: {$store_code}");
776
+ }
777
+ catch (Exception $e)
778
+ {
779
+ Mage::logException($e);
780
+ $this->_helper->logException($e);
781
+ }
782
+ }
783
+
784
+ public function processBatchOrders()
785
  {
786
  try
787
  {
788
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ORDERS);
789
+ $this->_helper->log("Process Batch Orders Start");
790
 
791
+ $stores = Mage::app()->getStores();
792
+
793
+ $starting_store = Mage::app()->getStore()->getCode();
794
+
795
+ foreach ($stores as $store)
796
+ {
797
+ Mage::app()->setCurrentStore($store->getCode());
798
+ $this->_helper->setCurrentStore($store->getId());
799
+
800
+ $this->processBatchStoreOrders($store);
801
+ }
802
+
803
+ Mage::app()->setCurrentStore($starting_store);
804
+
805
+ $this->_helper->log("Process Batch Orders End");
806
+ }
807
+ catch (Exception $e)
808
+ {
809
+ Mage::logException($e);
810
+ $this->_helper->logException($e);
811
+ }
812
+ }
813
+
814
+ public function processSavedOrder($order, $batch = false)
815
+ {
816
+ try
817
+ {
818
+ $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ORDERS);
819
+ $this->_helper->log("Process Saved Order Start");
820
 
821
  $this->_helper->log("Order Save After: " . $order->getIncrementId());
822
 
826
  if (!$this->_helper->getOrdersEnabled())
827
  {
828
  $this->_helper->logReason($this->_helper->getOrdersDisabledReason());
829
+ return;
830
  }
831
 
832
+ if (!$this->canSendOrder($order, $batch))
833
+ return;
834
 
835
+ $this->_helper->log("Order is ready to send. Processing...");
836
+
837
  $email = $order->getCustomerEmail();
838
 
839
  if ($order->getData('customer_is_guest'))
876
 
877
  $rc = Mage::getSingleton('emaildirect/wrapper_orders')->addSubscriberOrder($email, $order, $merge_vars);
878
 
879
+ if (!isset($rc->ErrorCode))
880
+ $this->setOrderSentToEmailDirect($order);
881
+
882
+ $this->_helper->log("Process Saved Order End");
883
+ }
884
+ catch (Exception $e)
885
+ {
886
+ Mage::logException($e);
887
+ $this->_helper->logException($e);
888
+ }
889
+ }
890
+
891
+ public function orderSaveAfter(Varien_Event_Observer $observer)
892
+ {
893
+ try
894
+ {
895
+ $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ORDERS);
896
+ $this->_helper->log("Order Save After Start");
897
+
898
+ if ($this->_helper->getBatchOnly())
899
+ {
900
+ $this->_helper->log("Skipping... Batch Processing Only");
901
+ return $observer;
902
+ }
903
+
904
+ $order = $observer->getEvent()->getOrder();
905
+
906
+ $this->processSavedOrder($order);
907
 
908
  $this->_helper->log("Order Save After End");
909
 
926
 
927
  $date = $date - $time;
928
 
929
+ return date($this->_date_format, $date);
930
  }
931
 
932
  private function getLastOrder($quote)
952
  return $order;
953
  }
954
 
955
+ private function setOrderSentToEmailDirect($order, $date = null)
956
  {
 
 
 
 
 
 
957
  try
958
  {
959
+ if ($date == null)
960
+ {
961
+ $date = date(Mage::getModel('core/date')->gmtTimestamp());
962
+ $date = date($this->_date_format, $date);
963
+ }
964
+
965
+ $ed_order = Mage::getModel('emaildirect/order')->saveSent($order, $date);
966
  }
967
  catch (Exception $e)
968
  {
971
  }
972
  }
973
 
974
+ private function setSentToEmailDirectDate($quote, $date)
975
  {
 
 
 
 
976
  try
977
  {
978
+ $abandoned = Mage::getModel('emaildirect/abandoned')->loadByQuoteId($quote->getId());
979
+
980
+ $abandoned->setDateSent($date);
981
+ $abandoned->save();
982
  }
983
  catch (Exception $e)
984
  {
1002
  {
1003
  $this->_helper->log("ProcessAbandoned Start");
1004
  $email = $quote->getCustomerEmail();
1005
+
1006
+ if ($email == null)
1007
+ $email = $quote->getEmail();
1008
 
1009
  $abandonedDate = $quote->getUpdatedAt();
1010
 
1014
  $merge_vars['LastName'] = $quote->getData('customer_lastname');
1015
 
1016
  $merge_vars['AbandonedDate'] = $abandonedDate;
1017
+ $merge_vars['AbandonedUrl'] = $this->getAbandonedUrl($quote); //$quote->getEmaildirectAbandonedUrl();
1018
 
1019
  $this->addSequence($merge_vars);
1020
 
1056
  {
1057
  // Store the time we last run
1058
  $date = date(Mage::getModel('core/date')->gmtTimestamp());
1059
+ $date = date($this->_date_format, $date);
 
 
1060
 
1061
  if ($mark_time)
1062
+ {
1063
+ $this->_helper->log("Saving Last Run Date: {$date}");
1064
  $this->_helper->updateConfig("abandoned_last_run", $date, $store);
1065
+ }
1066
+
1067
  $subscribers = false;
1068
 
1069
  $xml = "<Subscribers>";
1070
 
1071
  // Get the data for each abandoned cart
1072
  foreach ($collection as $quote)
1073
+ {
1074
  $xml .= $this->processAbandoned($quote, $date);
1075
  $subscribers = true;
1076
  }
1125
  $this->setupSequence();
1126
 
1127
  // Get abandoned collection
1128
+ $collection = Mage::getResourceModel('emaildirect/abandoned_collection');
1129
 
1130
+ $collection->prepareForAbandonedProcess($check_date, $store->getId());
 
 
 
 
 
 
 
 
 
1131
 
1132
  $this->_helper->log("SQL: " . $collection->getSelect()->__toString());
1133
 
1141
  $this->_helper->logException($e);
1142
  }
1143
  }
1144
+
1145
+ public function manualCartsProcessor($store_id = null)
1146
+ {
1147
+ try
1148
+ {
1149
+ $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
1150
+ $this->_helper->log("Manual Abandoned Carts Processor Start");
1151
+
1152
+ $check_date = $this->getAbandonedTime();
1153
+
1154
+ $this->_helper->log("Check Date: {$check_date}");
1155
+
1156
+ $stores = Mage::app()->getStores();
1157
+
1158
+ $starting_store = Mage::app()->getStore()->getCode();
1159
+
1160
+ foreach ($stores as $store)
1161
+ {
1162
+ if ($store_id == null || $store_id == $store->getId())
1163
+ {
1164
+ Mage::app()->setCurrentStore($store->getCode());
1165
+
1166
+ $this->abandonedStoreProcessor($store, $check_date);
1167
+ }
1168
+ }
1169
+
1170
+ Mage::app()->setCurrentStore($starting_store);
1171
+
1172
+ $this->_helper->log("Manual Abandoned Carts Processor End");
1173
+ }
1174
+ catch (Exception $e)
1175
+ {
1176
+ Mage::logException($e);
1177
+ $this->_helper->logException($e);
1178
+ }
1179
+ }
1180
 
1181
  public function abandonedCartsProcessor()
1182
  {
1202
 
1203
  Mage::app()->setCurrentStore($starting_store);
1204
 
1205
+ $date = date(Mage::getModel('core/date')->gmtTimestamp());
1206
+ $date = date($this->_date_format, $date);
1207
+
1208
+ $this->_helper->log("Saving Last Cron Run Date: {$date}");
1209
+ $this->_helper->updateConfig("cron_last_run", $date);
1210
+
1211
  $this->_helper->log("Abandoned Carts Processor End");
1212
  }
1213
  catch (Exception $e)
1221
  {
1222
  try
1223
  {
1224
+ $count = 0;
1225
+
1226
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
1227
  $this->_helper->log("Sending Specific Abandoned Carts Start");
1228
 
1229
  Mage::helper('emaildirect/fields')->checkFields();
1230
 
1231
  $this->_helper->log($id_list, "ID LIST");
 
 
 
 
 
 
1232
 
1233
+ $stores = Mage::app()->getStores();
1234
+
1235
+ $starting_store = Mage::app()->getStore()->getCode();
1236
+
1237
+ foreach ($stores as $store)
1238
+ {
1239
+ $this->_helper->log("Checking for valid carts in store: {$store->getName()} ({$store->getId()})");
1240
+ if (!Mage::helper('emaildirect')->getAbandonedEnabled($store->getId()))
1241
+ {
1242
+ $this->_helper->log('Abandoned Carts not enabled...');
1243
+ continue;
1244
+ }
1245
+
1246
+ Mage::app()->setCurrentStore($store->getCode());
1247
+
1248
+ // Get abandoned collection
1249
+ $collection = Mage::getResourceModel('emaildirect/abandoned_collection');
1250
+
1251
+ $collection->prepareForManualAbandonedProcess($id_list, $store->getId());
1252
+
1253
+ $count += count($collection);
1254
+
1255
+ $this->_helper->log("SQL: " . $collection->getSelect()->__toString());
1256
+
1257
+ $this->_abandonedCartsProcessor($collection, $store, false);
1258
+ }
1259
+
1260
+ Mage::app()->setCurrentStore($starting_store);
1261
 
1262
  $this->_helper->log("Sending Specific Abandoned Carts End");
1263
+
1264
+ return $count;
1265
  }
1266
  catch (Exception $e)
1267
  {
1272
  // END ABANDONED CRON
1273
 
1274
  // START QUOTE SAVE AFTER
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1275
  private function getAbandonedUrl($quote)
1276
  {
1277
  // We are using comma separated lists for the ID's and Quantities so that it takes up less
1312
  $this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
1313
  $this->_helper->setLogLevel(EmailDirect_Integration_Helper_Data::LOG_LEVEL_LOW);
1314
  $this->_helper->log("Quote Save After Start");
 
 
 
 
 
 
 
 
 
1315
 
1316
+ Mage::getSingleton('emaildirect/session')->init();
1317
+
 
 
 
 
 
 
 
 
 
1318
  $this->_helper->log("Quote Save After End");
1319
  $this->_helper->resetLogLevel();
1320
  }
app/code/community/EmailDirect/Integration/Model/Order.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_Order extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('emaildirect/order');
9
+ }
10
+
11
+ public function loadByOrderId($order_id)
12
+ {
13
+ try
14
+ {
15
+ if ($data = $this->getResource()->loadByOrderId($order_id))
16
+ $this->addData($data);
17
+ else
18
+ return false;
19
+ }
20
+ catch (Exception $e)
21
+ {
22
+ Mage::logException($e);
23
+ Mage::helper('emaildirect')->logException($e);
24
+ return false;
25
+ }
26
+ return $this;
27
+ }
28
+
29
+ public function saveSent($order, $date)
30
+ {
31
+ try
32
+ {
33
+ if (!$this->loadByOrderId($order->getId()))
34
+ $this->setOrderId($order->getId());
35
+
36
+ $this->setDateSent($date);
37
+
38
+ $this->save();
39
+ }
40
+ catch (Exception $e)
41
+ {
42
+ Mage::logException($e);
43
+ Mage::helper('emaildirect')->logException($e);
44
+ return false;
45
+ }
46
+
47
+ return $this;
48
+ }
49
+ }
app/code/community/EmailDirect/Integration/Model/Session.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_Session extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('emaildirect/session');
9
+ }
10
+
11
+ public function loadByMagentoSessionId($magento_session_id)
12
+ {
13
+ if ($data = $this->getResource()->loadByMagentoSessionId($magento_session_id))
14
+ $this->addData($data);
15
+ else
16
+ return false;
17
+
18
+ return $this;
19
+ }
20
+
21
+ public function init($email = null)
22
+ {
23
+ try
24
+ {
25
+ $customer_session = Mage::getSingleton("customer/session");
26
+
27
+ $magento_session_id = $customer_session->getEncryptedSessionId();
28
+
29
+ $emaildirect_id = Mage::getModel('core/cookie')->get('ed_id');
30
+
31
+ $new = false;
32
+
33
+ if (!empty($emaildirect_id))
34
+ $this->load($emaildirect_id);
35
+ else
36
+ {
37
+ $new = true;
38
+ if (!$this->loadByMagentoSessionId($magento_session_id));
39
+ $this->setMagentoSessionId($magento_session_id);
40
+ }
41
+
42
+ if ($customer_session->isLoggedIn())
43
+ $this->setCustomerId($customer_session->getId());
44
+
45
+ if ($email != null)
46
+ $this->setEmail($email);
47
+
48
+ if ($new)
49
+ {
50
+ $this->save();
51
+
52
+ Mage::getModel('core/cookie')->set('ed_id', $this->getId(), true, null, null, null, false);
53
+ }
54
+ else
55
+ $this->save();
56
+
57
+ Mage::getModel('emaildirect/abandoned')->init($this);
58
+ }
59
+ catch (Exception $e)
60
+ {
61
+ Mage::helper('emaildirect')->logException($e);
62
+ Mage::logException($e);
63
+ }
64
+
65
+ return $this;
66
+ }
67
+ }
app/code/community/EmailDirect/Integration/Model/System/Config/Source/Abandoned.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_System_Config_Source_Abandoned extends Varien_Data_Form_Abstract
4
+ {
5
+ /**
6
+ * Options getter
7
+ *
8
+ * @return array
9
+ */
10
+ public function toOptionArray()
11
+ {
12
+ return array(
13
+ array('value' => 0, 'label' => Mage::helper('emaildirect')->__('Do not send through Magento')),
14
+ array('value' => 1, 'label' => Mage::helper('emaildirect')->__('1 Day')),
15
+ array('value' => 2, 'label' => Mage::helper('emaildirect')->__('2 Days')),
16
+ array('value' => 3, 'label' => Mage::helper('emaildirect')->__('3 Days')),
17
+ array('value' => 4, 'label' => Mage::helper('emaildirect')->__('4 Days')),
18
+ array('value' => 5, 'label' => Mage::helper('emaildirect')->__('5 Days')),
19
+ array('value' => 6, 'label' => Mage::helper('emaildirect')->__('6 Days')),
20
+ array('value' => 7, 'label' => Mage::helper('emaildirect')->__('7 Days')),
21
+ array('value' => 8, 'label' => Mage::helper('emaildirect')->__('8 Days')),
22
+ array('value' => 9, 'label' => Mage::helper('emaildirect')->__('9 Days')),
23
+ array('value' => 10, 'label' => Mage::helper('emaildirect')->__('10 Days')),
24
+ array('value' => 11, 'label' => Mage::helper('emaildirect')->__('11 Days')),
25
+ array('value' => 12, 'label' => Mage::helper('emaildirect')->__('12 Days')),
26
+ array('value' => 13, 'label' => Mage::helper('emaildirect')->__('13 Days')),
27
+ array('value' => 14, 'label' => Mage::helper('emaildirect')->__('14 Days')),
28
+ array('value' => 15, 'label' => Mage::helper('emaildirect')->__('15 Days')),
29
+ );
30
+ }
31
+ }
app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Abandonedlist.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Additionallist.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Checkoutsubscribe.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Export/Batch.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/List.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Publication.php RENAMED
File without changes
app/code/community/EmailDirect/Integration/Model/System/Config/Source/Send/Field.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_System_Config_Source_Send_Field extends Varien_Data_Form_Abstract
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $options = array(
8
+ array('value' => 'state','label' => "State"),
9
+ array('value' => 'status','label' => "Status"),
10
+ );
11
+
12
+ return $options;
13
+ }
14
+ }
app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Sequence.php RENAMED
File without changes
app/code/community/EmailDirect/Integration/Model/System/Config/Source/Signup/Opacity.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_System_Config_Source_Signup_Opacity extends Varien_Data_Form_Abstract
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $options = array();
8
+
9
+ for($i = 1; $i < 10; $i++)
10
+ {
11
+ $percent = $i * 10;
12
+ $options[] = array('value' => $percent, 'label' => "{$percent}%");
13
+ }
14
+
15
+ return $options;
16
+ }
17
+ }
app/code/community/EmailDirect/Integration/Model/System/Config/Source/Signup/Recurrence.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_System_Config_Source_Signup_Recurrence extends Varien_Data_Form_Abstract
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $options = array(
8
+ array('value' => 'once','label' => "Only show once"),
9
+ array('value' => '1 day','label' => "1 day"),
10
+ array('value' => '1 week','label' => "1 week"),
11
+ array('value' => '1 month','label' => "1 month"),
12
+ );
13
+
14
+ return $options;
15
+ }
16
+ }
app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Source.php RENAMED
File without changes
app/code/community/EmailDirect/Integration/Model/System/Config/Source/States.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_System_Config_Source_States
4
+ {
5
+ private function getStates()
6
+ {
7
+ $states = array();
8
+
9
+ $config_states = Mage::getConfig()->getNode('global/sales/order/states');
10
+
11
+ foreach ($config_states->children() as $state)
12
+ {
13
+ $label = (string) $state->label;
14
+ $states[$state->getName()] = Mage::helper('sales')->__($label);
15
+ }
16
+
17
+ return $states;
18
+ }
19
+
20
+ public function toOptionArray()
21
+ {
22
+ $sales_config = Mage::getSingleton('sales/order_config');
23
+
24
+ if (!method_exists($sales_config,'getStates'))
25
+ $states = $this->getStates();
26
+ else
27
+ $states = $sales_config->getStates();
28
+
29
+ $options = array();
30
+
31
+ foreach($states as $value => $label)
32
+ {
33
+ $options[] = array(
34
+ 'value' => $value,
35
+ 'label' => $label);
36
+ }
37
+ return $options;
38
+ }
39
+ }
app/code/community/EmailDirect/Integration/Model/System/Config/Source/Statuses.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_Model_System_Config_Source_Statuses
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $sales_config = Mage::getSingleton('sales/order_config');
8
+
9
+ $statuses = $sales_config->getStatuses();
10
+
11
+ $options = array();
12
+
13
+ foreach($statuses as $value => $label)
14
+ {
15
+ $options[] = array(
16
+ 'value' => $value,
17
+ 'label' => $label);
18
+ }
19
+ return $options;
20
+ }
21
+ }
app/code/{local → community}/EmailDirect/Integration/Model/System/Config/Source/Time.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Abandoned.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Abstract.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Database.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Execute.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Ftp.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Lists.php RENAMED
@@ -49,9 +49,5 @@ class EmailDirect_Integration_Model_Wrapper_Lists
49
  $xml = "<Subscribers><EmailAddress>{$email}</EmailAddress></Subscribers>";
50
  $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand('lists','AddEmails',$list_id,$xml);
51
  }
52
- else {
53
- // Mage::log("add subscriber and subscribe to list");
54
-
55
- }
56
  }
57
- }
49
  $xml = "<Subscribers><EmailAddress>{$email}</EmailAddress></Subscribers>";
50
  $rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand('lists','AddEmails',$list_id,$xml);
51
  }
 
 
 
 
52
  }
53
+ }
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Orders.php RENAMED
@@ -51,13 +51,13 @@ class EmailDirect_Integration_Model_Wrapper_Orders extends EmailDirect_Integrati
51
  $order_data = "<Orders>" . $this->getOrderXml($order) . "</Orders>";
52
 
53
  // Same call just different adding the order info
54
- return Mage::getSingleton('emaildirect/wrapper_subscribers')->subscriberAdd($email, $merge_vars, $order_data);
55
  }
56
 
57
  public function addSubscriberTracking($email,$merge_vars)
58
  {
59
  // Same call just different Merge Vars
60
- return Mage::getSingleton('emaildirect/wrapper_subscribers')->subscriberAdd($email, $merge_vars);
61
  }
62
 
63
  }
51
  $order_data = "<Orders>" . $this->getOrderXml($order) . "</Orders>";
52
 
53
  // Same call just different adding the order info
54
+ return Mage::getSingleton('emaildirect/wrapper_subscribers')->subscriberAdd($email, $merge_vars, $order_data, false);
55
  }
56
 
57
  public function addSubscriberTracking($email,$merge_vars)
58
  {
59
  // Same call just different Merge Vars
60
+ return Mage::getSingleton('emaildirect/wrapper_subscribers')->subscriberAdd($email, $merge_vars, "", false);
61
  }
62
 
63
  }
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Publications.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Sources.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/Model/Wrapper/Subscribers.php RENAMED
@@ -18,14 +18,18 @@ class EmailDirect_Integration_Model_Wrapper_subscribers extends EmailDirect_Inte
18
  return true;
19
  }
20
 
21
- public function subscriberAdd($email,$merge_vars, $extra_data = "", $use_lists = true)
22
  {
23
- $source_data = $this->getSource($email);
24
- $publication_data = $this->getPublications();
25
  $list_data = "";
26
 
27
- if ($use_lists)
 
 
 
 
28
  $list_data = $this->getLists();
 
29
 
30
  $custom_fields = $this->getCustomFields($merge_vars);
31
 
@@ -63,6 +67,8 @@ class EmailDirect_Integration_Model_Wrapper_subscribers extends EmailDirect_Inte
63
  Mage::getSingleton('customer/session')->addError((string)$rc->Message);
64
  Mage::throwException((string)$rc->Message);
65
  }
 
 
66
  }
67
 
68
  public function mailModify($old_mail,$new_mail)
@@ -73,15 +79,17 @@ class EmailDirect_Integration_Model_Wrapper_subscribers extends EmailDirect_Inte
73
  if (isset($rc->ErrorCode))
74
  {
75
  if ($rc->ErrorCode == 202)
76
- {
77
- $this->fixBouncedMail($old_mail, $new_mail);
78
- }
79
  else
80
  {
81
  Mage::getSingleton('customer/session')->addError((string)$rc->Message);
82
  Mage::throwException((string)$rc->Message);
83
  }
84
  }
 
 
85
  }
86
 
87
  public function getProperties($email)
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
 
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)
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)
app/code/{local → community}/EmailDirect/Integration/controllers/AbandonedController.php RENAMED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class EmailDirect_Integration_AbandonedController extends Mage_Core_Controller_Front_Action
3
  {
4
  public function restoreAction()
@@ -59,7 +60,6 @@ class EmailDirect_Integration_AbandonedController extends Mage_Core_Controller_F
59
  }
60
  catch (Exception $e)
61
  {
62
- //Zend_Debug::dump($e->getMessage());
63
  Mage::logException($e);
64
  return false;
65
  }
@@ -70,9 +70,7 @@ class EmailDirect_Integration_AbandonedController extends Mage_Core_Controller_F
70
  $quote = Mage::getModel('sales/quote')->load($original_quote_id);
71
 
72
  if ($quote->getId() == $original_quote_id)
73
- {
74
  $quote->delete();
75
- }
76
  }
77
 
78
  private function clearCart($original_quote_id)
@@ -88,10 +86,8 @@ class EmailDirect_Integration_AbandonedController extends Mage_Core_Controller_F
88
  // Check to see if we need to remove the quote
89
  // if they aren't logged in then we will need to otherwise when they login the items won't match
90
  if ($quote->getId() != $original_quote_id)
91
- {
92
  $this->removeOldQuote($original_quote_id);
93
- }
94
-
95
  foreach ($quote->getItemsCollection() as $item)
96
  {
97
  $item->isDeleted(true);
1
  <?php
2
+
3
  class EmailDirect_Integration_AbandonedController extends Mage_Core_Controller_Front_Action
4
  {
5
  public function restoreAction()
60
  }
61
  catch (Exception $e)
62
  {
 
63
  Mage::logException($e);
64
  return false;
65
  }
70
  $quote = Mage::getModel('sales/quote')->load($original_quote_id);
71
 
72
  if ($quote->getId() == $original_quote_id)
 
73
  $quote->delete();
 
74
  }
75
 
76
  private function clearCart($original_quote_id)
86
  // Check to see if we need to remove the quote
87
  // if they aren't logged in then we will need to otherwise when they login the items won't match
88
  if ($quote->getId() != $original_quote_id)
 
89
  $this->removeOldQuote($original_quote_id);
90
+
 
91
  foreach ($quote->getItemsCollection() as $item)
92
  {
93
  $item->isDeleted(true);
app/code/{local → community}/EmailDirect/Integration/controllers/Admin/AbandonedController.php RENAMED
@@ -7,7 +7,7 @@ class EmailDirect_Integration_Admin_AbandonedController extends Mage_Adminhtml_C
7
  $this->loadLayout();
8
 
9
  $this->getLayout()->getBlock('head')->setTitle($this->__('EmailDirect Abandoned Carts'));
10
- $this->_setActiveMenu('sales');
11
  $this->renderLayout();
12
  }
13
 
@@ -24,18 +24,32 @@ class EmailDirect_Integration_Admin_AbandonedController extends Mage_Adminhtml_C
24
 
25
  public function runAction()
26
  {
27
- Mage::getSingleton('emaildirect/observer')->abandonedCartsProcessor();
28
- $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("The Abandoned Cart process has been run."));
29
- $this->_redirect('emaildirect/admin_abandoned/index', Mage::helper('emaildirect')->getUrlParams());
 
 
 
 
 
 
 
 
30
  }
31
 
32
  public function sendAction()
33
  {
34
  $id = $this->getRequest()->getParam('id');
35
- $id_list = array($id);
36
- Mage::getSingleton('emaildirect/observer')->SendAbandonedCarts($id_list);
37
- $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("Abandoned Carts have been sent."));
38
- $this->_redirect('emaildirect/admin_abandoned/index', Mage::helper('emaildirect')->getUrlParams());
 
 
 
 
 
 
39
  }
40
 
41
  public function massSendAction()
@@ -46,18 +60,16 @@ class EmailDirect_Integration_Admin_AbandonedController extends Mage_Adminhtml_C
46
 
47
  $id_list = $params['id'];
48
 
49
- if(!is_array($id_list))
50
- {
51
  Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select at least one cart to send or resend.'));
52
- }
53
  else
54
  {
55
  try
56
  {
57
- Mage::getSingleton('emaildirect/observer')->SendAbandonedCarts($id_list);
58
 
59
  Mage::getSingleton('adminhtml/session')->addSuccess(
60
- Mage::helper('adminhtml')->__('Total of %d carts(s) were sent.', count($id_list)));
61
  }
62
  catch (Exception $e)
63
  {
@@ -66,4 +78,4 @@ class EmailDirect_Integration_Admin_AbandonedController extends Mage_Adminhtml_C
66
  }
67
  $this->_redirect('*/*/index', Mage::helper('emaildirect')->getUrlParams());
68
  }
69
- }
7
  $this->loadLayout();
8
 
9
  $this->getLayout()->getBlock('head')->setTitle($this->__('EmailDirect Abandoned Carts'));
10
+ $this->_setActiveMenu('emaildirect');
11
  $this->renderLayout();
12
  }
13
 
24
 
25
  public function runAction()
26
  {
27
+ $store_id = $this->getRequest()->getParam('store_id');
28
+
29
+ Mage::getSingleton('emaildirect/observer')->manualCartsProcessor($store_id);
30
+
31
+ $msg = "The Abandoned Cart process has been run";
32
+
33
+ if ($store_id)
34
+ $msg .= " on store: "; // GET STORE NAME!!!
35
+
36
+ $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__($msg));
37
+ $this->_redirect('*/*/index');
38
  }
39
 
40
  public function sendAction()
41
  {
42
  $id = $this->getRequest()->getParam('id');
43
+
44
+ if ($id == null)
45
+ $this->_getSession()->addError(Mage::helper('adminhtml')->__("No Carts were specified."));
46
+ else
47
+ {
48
+ $id_list = array($id);
49
+ Mage::getSingleton('emaildirect/observer')->SendAbandonedCarts($id_list);
50
+ $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("Abandoned Cart has been sent."));
51
+ }
52
+ $this->_redirect('*/*/index');
53
  }
54
 
55
  public function massSendAction()
60
 
61
  $id_list = $params['id'];
62
 
63
+ if (!is_array($id_list))
 
64
  Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select at least one cart to send or resend.'));
 
65
  else
66
  {
67
  try
68
  {
69
+ $count = Mage::getSingleton('emaildirect/observer')->SendAbandonedCarts($id_list);
70
 
71
  Mage::getSingleton('adminhtml/session')->addSuccess(
72
+ Mage::helper('adminhtml')->__('Total of %d carts(s) were sent.', $count));
73
  }
74
  catch (Exception $e)
75
  {
78
  }
79
  $this->_redirect('*/*/index', Mage::helper('emaildirect')->getUrlParams());
80
  }
81
+ }
app/code/{local → community}/EmailDirect/Integration/controllers/Admin/ExportController.php RENAMED
@@ -306,6 +306,9 @@ class EmailDirect_Integration_Admin_ExportController extends Mage_Adminhtml_Cont
306
  if ($this->getRequest()->isPost())
307
  {
308
  $file_name = $this->getRequest()->getPost('filename', 0);
 
 
 
309
 
310
  $url = $this->getUrl('*/*/download') . "filename/{$file_name}/export_type/" . $this->getExportType();
311
 
@@ -323,7 +326,6 @@ class EmailDirect_Integration_Admin_ExportController extends Mage_Adminhtml_Cont
323
  }
324
 
325
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
326
- }
327
-
328
  }
329
- }
306
  if ($this->getRequest()->isPost())
307
  {
308
  $file_name = $this->getRequest()->getPost('filename', 0);
309
+ $store = $this->getRequest()->getPost('store', 0);
310
+ if ($store != 0)
311
+ Mage::helper('emaildirect')->setCurrentStore($store);
312
 
313
  $url = $this->getUrl('*/*/download') . "filename/{$file_name}/export_type/" . $this->getExportType();
314
 
326
  }
327
 
328
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
329
+ }
 
330
  }
331
+ }
app/code/{local → community}/EmailDirect/Integration/controllers/Admin/TroubleshootingController.php RENAMED
@@ -4,11 +4,10 @@ class EmailDirect_Integration_Admin_TroubleshootingController extends Mage_Admin
4
  {
5
  public function indexAction()
6
  {
7
- $this->loadLayout();
8
-
9
  $this->getLayout()->getBlock('head')->setTitle($this->__('EmailDirect Troubleshooting'));
10
- $this->_setActiveMenu('system');
11
- $this->renderLayout();
12
  }
13
 
14
  public function sendAction()
@@ -59,38 +58,6 @@ class EmailDirect_Integration_Admin_TroubleshootingController extends Mage_Admin
59
  $this->_prepareDownloadResponse(Mage::helper('emaildirect')->troubleConfig('report_file'), $output);
60
  }
61
 
62
- public function columnsAction()
63
- {
64
- $failed_columns = Mage::helper('emaildirect')->checkDatabaseColumns();
65
- $error = false;
66
-
67
- if (count($failed_columns) > 0)
68
- {
69
- $resource = Mage::getSingleton('core/resource');
70
-
71
- foreach ($failed_columns as $column)
72
- {
73
- $sql = $column['sql'];
74
-
75
- try
76
- {
77
- $resource->getConnection('core_write')
78
- ->query($sql);
79
- }
80
- catch (Exception $e)
81
- {
82
- $error = true;
83
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('emaildirect')->__('Failed to create column: %s - %s',$column['table'],$column['column']));
84
- }
85
- }
86
- }
87
-
88
- if (!$error)
89
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('emaildirect')->__('Database Columns have been restored'));
90
-
91
- $this->_redirect('adminhtml/system_config/edit/',array('section' => 'emaildirect'));
92
- }
93
-
94
  /**
95
  * Declare headers and content file in responce for file download
96
  *
@@ -168,4 +135,4 @@ class EmailDirect_Integration_Admin_TroubleshootingController extends Mage_Admin
168
  }
169
  return $this;
170
  }
171
- }
4
  {
5
  public function indexAction()
6
  {
7
+ $this->loadLayout();
 
8
  $this->getLayout()->getBlock('head')->setTitle($this->__('EmailDirect Troubleshooting'));
9
+ $this->_setActiveMenu('system');
10
+ $this->renderLayout();
11
  }
12
 
13
  public function sendAction()
58
  $this->_prepareDownloadResponse(Mage::helper('emaildirect')->troubleConfig('report_file'), $output);
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  /**
62
  * Declare headers and content file in responce for file download
63
  *
135
  }
136
  return $this;
137
  }
138
+ }
app/code/community/EmailDirect/Integration/controllers/CaptureController.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class EmailDirect_Integration_CaptureController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ public function indexAction()
6
+ {
7
+ $result = array();
8
+
9
+ if (!$this->getRequest()->isXmlHttpRequest())
10
+ {
11
+ $this->_redirect('*/*/');
12
+ return;
13
+ }
14
+
15
+ $email = Mage::app()->getRequest()->getParam('email');
16
+
17
+ if (!Zend_Validate::is($email, 'EmailAddress'))
18
+ {
19
+ $result['success'] = false;
20
+ $result['message'] = "Invalid Email";
21
+ }
22
+ else
23
+ {
24
+ Mage::getSingleton('emaildirect/session')->init($email);
25
+ $result['success'] = true;
26
+ }
27
+
28
+ $this->getResponse()->setBody(json_encode($result));
29
+ }
30
+ }
31
+
32
+
33
+
34
+
35
+
app/code/{local → community}/EmailDirect/Integration/controllers/Customer/AccountController.php RENAMED
@@ -2,49 +2,48 @@
2
  class EmailDirect_Integration_Customer_AccountController extends Mage_Core_Controller_Front_Action
3
  {
4
 
5
- /**
6
- * Action predispatch
7
- *
8
- * Check customer authentication for some actions
9
- */
10
- public function preDispatch()
11
- {
12
- parent::preDispatch();
13
 
14
- if (!$this->getRequest()->isDispatched()) {
15
- return;
16
- }
17
 
18
- if (!$this->_getCustomerSession()->authenticate($this)) {
19
- $this->setFlag('', 'no-dispatch', true);
20
- }
21
- }
22
 
23
- /**
24
- * Retrieve customer session model object
25
- *
26
- * @return Mage_Customer_Model_Session
27
- */
28
- protected function _getCustomerSession()
29
- {
30
- return Mage::getSingleton('customer/session');
31
- }
32
 
33
  /**
34
  * Display data
35
  */
36
  public function indexAction()
37
  {
38
- $this->loadLayout();
39
- $this->_initLayoutMessages('customer/session');
40
 
41
- $this->getLayout()->getBlock('head')->setTitle($this->__('Newsletter Subscription'));
42
- $this->renderLayout();
43
  }
44
 
45
  public function saveadditionalAction()
46
  {
47
-
48
  $helper = Mage::helper('emaildirect');
49
 
50
  $helper->setLogArea(EmailDirect_Integration_Helper_Data::NEWSLETTER);
@@ -63,12 +62,12 @@ class EmailDirect_Integration_Customer_AccountController extends Mage_Core_Contr
63
  $helper->log($odata, 'State Data');
64
 
65
  $active_lists = (TRUE === array_key_exists('list', $odata)) ? $odata['list'] : array();
66
- $lists = $this->getRequest()->getPost('list', array());
67
 
68
  $helper->log($lists, 'List Selection');
69
 
70
  $customer = Mage::helper('customer')->getCustomer();
71
- $email = $customer->getEmail();
72
 
73
  $helper->log("Email: {$email}");
74
 
@@ -86,11 +85,6 @@ class EmailDirect_Integration_Customer_AccountController extends Mage_Core_Contr
86
 
87
  $new_subscriber = false;
88
 
89
- // SCENARIO - User is not in EmailDirect yet but has selected only the main publication.
90
- // When adding to EmailDirect we automatically subscribe to ALL lists selected.
91
- // Make it work with only the selected lists
92
-
93
-
94
  if (!$pub_selection)
95
  {
96
  $helper->log("Unsubscribe from All");
@@ -177,4 +171,4 @@ class EmailDirect_Integration_Customer_AccountController extends Mage_Core_Contr
177
 
178
  $this->_redirect('*/*/index');
179
  }
180
- }
2
  class EmailDirect_Integration_Customer_AccountController extends Mage_Core_Controller_Front_Action
3
  {
4
 
5
+ /**
6
+ * Action predispatch
7
+ *
8
+ * Check customer authentication for some actions
9
+ */
10
+ public function preDispatch()
11
+ {
12
+ parent::preDispatch();
13
 
14
+ if (!$this->getRequest()->isDispatched()) {
15
+ return;
16
+ }
17
 
18
+ if (!$this->_getCustomerSession()->authenticate($this)) {
19
+ $this->setFlag('', 'no-dispatch', true);
20
+ }
21
+ }
22
 
23
+ /**
24
+ * Retrieve customer session model object
25
+ *
26
+ * @return Mage_Customer_Model_Session
27
+ */
28
+ protected function _getCustomerSession()
29
+ {
30
+ return Mage::getSingleton('customer/session');
31
+ }
32
 
33
  /**
34
  * Display data
35
  */
36
  public function indexAction()
37
  {
38
+ $this->loadLayout();
39
+ $this->_initLayoutMessages('customer/session');
40
 
41
+ $this->getLayout()->getBlock('head')->setTitle($this->__('Newsletter Subscription'));
42
+ $this->renderLayout();
43
  }
44
 
45
  public function saveadditionalAction()
46
  {
 
47
  $helper = Mage::helper('emaildirect');
48
 
49
  $helper->setLogArea(EmailDirect_Integration_Helper_Data::NEWSLETTER);
62
  $helper->log($odata, 'State Data');
63
 
64
  $active_lists = (TRUE === array_key_exists('list', $odata)) ? $odata['list'] : array();
65
+ $lists = $this->getRequest()->getPost('list', array());
66
 
67
  $helper->log($lists, 'List Selection');
68
 
69
  $customer = Mage::helper('customer')->getCustomer();
70
+ $email = $customer->getEmail();
71
 
72
  $helper->log("Email: {$email}");
73
 
85
 
86
  $new_subscriber = false;
87
 
 
 
 
 
 
88
  if (!$pub_selection)
89
  {
90
  $helper->log("Unsubscribe from All");
171
 
172
  $this->_redirect('*/*/index');
173
  }
174
+ }
app/code/{local → community}/EmailDirect/Integration/controllers/ExportController.php RENAMED
File without changes
app/code/{local → community}/EmailDirect/Integration/etc/adminhtml.xml RENAMED
@@ -1,5 +1,23 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  <acl>
4
  <resources>
5
  <admin>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <config>
3
+ <menu>
4
+ <emaildirect module='emaildirect'>
5
+ <title>EmailDirect</title>
6
+ <sort_order>80</sort_order>
7
+ <children>
8
+ <emaildirect_abandoned module='emaildirect'>
9
+ <title>Abandoned Carts</title>
10
+ <sort_order>100</sort_order>
11
+ <action>emaildirect/admin_abandoned</action>
12
+ </emaildirect_abandoned>
13
+ <emaildirect_config module='emaildirect'>
14
+ <title>Configuration</title>
15
+ <sort_order>1000</sort_order>
16
+ <action>adminhtml/system_config/edit/section/emaildirect</action>
17
+ </emaildirect_config>
18
+ </children>
19
+ </emaildirect>
20
+ </menu>
21
  <acl>
22
  <resources>
23
  <admin>
app/code/{local → community}/EmailDirect/Integration/etc/config.xml RENAMED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <EmailDirect_Integration>
5
- <version>1.5.8</version>
6
  </EmailDirect_Integration>
7
  </modules>
8
  <global>
@@ -14,7 +14,7 @@
14
  <method>handleSubscriber</method>
15
  </emaildirect_subscribe_observer>
16
  </observers>
17
- </newsletter_subscriber_save_before>
18
  <newsletter_subscriber_delete_after>
19
  <observers>
20
  <emaildirect_subscribe_delete_observer>
@@ -30,14 +30,14 @@
30
  <method>updateCustomer</method>
31
  </emaildirect_update_customer>
32
  </observers>
33
- </customer_save_after>
34
  <sales_order_save_after>
35
- <observers>
36
- <emaildirect_order_save_after>
37
- <class>emaildirect/observer</class>
38
- <method>orderSaveAfter</method>
39
- </emaildirect_order_save_after>
40
- </observers>
41
  </sales_order_save_after>
42
  </events>
43
  <models>
@@ -48,7 +48,15 @@
48
  <emaildirect_mysql4>
49
  <class>EmailDirect_Integration_Model_Mysql4</class>
50
  <entities>
51
- <apidebug><table>emaildirect_api_debug</table></apidebug>
 
 
 
 
 
 
 
 
52
  </entities>
53
  </emaildirect_mysql4>
54
  </models>
@@ -82,20 +90,6 @@
82
  <class>EmailDirect_Integration_Helper</class>
83
  </emaildirect>
84
  </helpers>
85
- <!--<template>
86
- <email>
87
- <newsletter_subscription_success_email_template translate="label" module="emaildirect">
88
- <label>Newsletter subscription success</label>
89
- <file>newsletter_subscr_success_emaildirect.html</file>
90
- <type>html</type>
91
- </newsletter_subscription_success_email_template>
92
- <newsletter_subscription_un_email_template translate="label" module="emaildirect">
93
- <label>Newsletter unsubscription success</label>
94
- <file>newsletter_unsub_success_emaildirect.html</file>
95
- <type>html</type>
96
- </newsletter_subscription_un_email_template>
97
- </email>
98
- </template>-->
99
  </global>
100
  <frontend>
101
  <translate>
@@ -123,9 +117,9 @@
123
  </emaildirect>
124
  </updates>
125
  </layout>
126
- <events>
127
- <controller_action_postdispatch_checkout_onepage_saveOrder>
128
- <observers>
129
  <emaildirect_subscribe_checkout>
130
  <class>emaildirect/observer</class>
131
  <method>registerCheckoutSubscribe</method>
@@ -162,30 +156,6 @@
162
  </routers>
163
  </admin>
164
  <adminhtml>
165
- <menu>
166
- <sales>
167
- <children>
168
- <emaildirect_abandoned>
169
- <title>EmailDirect - Abandoned Carts</title>
170
- <sort_order>100</sort_order>
171
- <action>emaildirect/admin_abandoned</action>
172
- </emaildirect_abandoned>
173
- </children>
174
- </sales>
175
- </menu>
176
- <acl>
177
- <resources>
178
- <admin>
179
- <children>
180
- <sales>
181
- <emaildirect_abandoned>
182
- <title>EmailDirect - Abandoned Carts</title>
183
- </emaildirect_abandoned>
184
- </sales>
185
- </children>
186
- </admin>
187
- </resources>
188
- </acl>
189
  <layout>
190
  <updates>
191
  <emaildirect>
@@ -256,14 +226,24 @@
256
  <sendabandoned>0</sendabandoned>
257
  <abandonedsetup>0</abandonedsetup>
258
  <setup>0</setup>
259
- <debug>0</debug>
260
  <save_latest_order>0</save_latest_order>
261
  <product_fields>3</product_fields>
262
  <related_fields>2</related_fields>
263
  <send_states>complete</send_states>
 
264
  <abandonedsequence_options><![CDATA[A
265
  B
266
  C]]></abandonedsequence_options>
 
 
 
 
 
 
 
 
 
267
  </general>
268
  <export>
269
  <include_disabled>1</include_disabled>
@@ -292,6 +272,15 @@ C]]></abandonedsequence_options>
292
  <model>emaildirect/observer::abandonedCartsProcessor</model>
293
  </run>
294
  </emaildirect_integration>
 
 
 
 
 
 
 
 
 
295
  </jobs>
296
  </crontab>
297
- </config>
2
  <config>
3
  <modules>
4
  <EmailDirect_Integration>
5
+ <version>2.0.0</version>
6
  </EmailDirect_Integration>
7
  </modules>
8
  <global>
14
  <method>handleSubscriber</method>
15
  </emaildirect_subscribe_observer>
16
  </observers>
17
+ </newsletter_subscriber_save_before>
18
  <newsletter_subscriber_delete_after>
19
  <observers>
20
  <emaildirect_subscribe_delete_observer>
30
  <method>updateCustomer</method>
31
  </emaildirect_update_customer>
32
  </observers>
33
+ </customer_save_after>
34
  <sales_order_save_after>
35
+ <observers>
36
+ <emaildirect_order_save_after>
37
+ <class>emaildirect/observer</class>
38
+ <method>orderSaveAfter</method>
39
+ </emaildirect_order_save_after>
40
+ </observers>
41
  </sales_order_save_after>
42
  </events>
43
  <models>
48
  <emaildirect_mysql4>
49
  <class>EmailDirect_Integration_Model_Mysql4</class>
50
  <entities>
51
+ <abandoned>
52
+ <table>emaildirect_abandoned_cart</table>
53
+ </abandoned>
54
+ <order>
55
+ <table>emaildirect_order</table>
56
+ </order>
57
+ <session>
58
+ <table>emaildirect_session</table>
59
+ </session>
60
  </entities>
61
  </emaildirect_mysql4>
62
  </models>
90
  <class>EmailDirect_Integration_Helper</class>
91
  </emaildirect>
92
  </helpers>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  </global>
94
  <frontend>
95
  <translate>
117
  </emaildirect>
118
  </updates>
119
  </layout>
120
+ <events>
121
+ <controller_action_postdispatch_checkout_onepage_saveOrder>
122
+ <observers>
123
  <emaildirect_subscribe_checkout>
124
  <class>emaildirect/observer</class>
125
  <method>registerCheckoutSubscribe</method>
156
  </routers>
157
  </admin>
158
  <adminhtml>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  <layout>
160
  <updates>
161
  <emaildirect>
226
  <sendabandoned>0</sendabandoned>
227
  <abandonedsetup>0</abandonedsetup>
228
  <setup>0</setup>
229
+ <debug>0</debug>
230
  <save_latest_order>0</save_latest_order>
231
  <product_fields>3</product_fields>
232
  <related_fields>2</related_fields>
233
  <send_states>complete</send_states>
234
+ <send_statuses>complete</send_statuses>
235
  <abandonedsequence_options><![CDATA[A
236
  B
237
  C]]></abandonedsequence_options>
238
+ <signup_enabled>0</signup_enabled>
239
+ <signup_activated>0</signup_activated>
240
+ <signup_delay>3</signup_delay>
241
+ <signup_opacity>30</signup_opacity>
242
+ <signup_recurrence>1 month</signup_recurrence>
243
+ <signup_width>760</signup_width>
244
+ <signup_height>400</signup_height>
245
+ <batch_size>200</batch_size>
246
+ <batch_date_adjust>-1 week</batch_date_adjust>
247
  </general>
248
  <export>
249
  <include_disabled>1</include_disabled>
272
  <model>emaildirect/observer::abandonedCartsProcessor</model>
273
  </run>
274
  </emaildirect_integration>
275
+ <emaildirect_integration_batch_orders>
276
+ <schedule>
277
+ <cron_expr>30 * * * *</cron_expr>
278
+ <!--<cron_expr>*/5 * * * *</cron_expr>--><!-- every 5 minutes for testing -->
279
+ </schedule>
280
+ <run>
281
+ <model>emaildirect/observer::processBatchOrders</model>
282
+ </run>
283
+ </emaildirect_integration_batch_orders>
284
  </jobs>
285
  </crontab>
286
+ </config>
app/code/{local → community}/EmailDirect/Integration/etc/system.xml RENAMED
@@ -36,12 +36,12 @@
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>1</show_in_website>
44
- <show_in_store>1</show_in_store>
45
  </heading_general>
46
  <active translate="label">
47
  <label>Enabled</label>
@@ -49,7 +49,7 @@
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>1</show_in_website>
53
  <show_in_store>1</show_in_store>
54
  </active>
55
  <apikey translate="label comment">
@@ -64,76 +64,68 @@
64
  <apikey_instructions>
65
  <label>Get your API Key</label>
66
  <frontend_model>emaildirect/adminhtml_system_config_form_field_note</frontend_model>
67
- <text>Testing</text>
68
- <sort_order>21</sort_order>
69
  <show_in_default>1</show_in_default>
70
- <show_in_website>1</show_in_website>
71
  <show_in_store>1</show_in_store>
72
- <!--<depends><setup>0</setup></depends>-->
73
  </apikey_instructions>
 
 
 
 
 
 
 
 
 
 
74
  <publication translate="label comment">
75
  <label>Publication</label>
76
  <frontend_type>select</frontend_type>
77
  <source_model>emaildirect/system_config_source_publication</source_model>
78
- <sort_order>24</sort_order>
79
  <show_in_default>1</show_in_default>
80
  <show_in_website>0</show_in_website>
81
  <show_in_store>1</show_in_store>
82
  <can_be_empty>1</can_be_empty>
83
  <comment>This is the Publication that emails will be subscribed to and is required</comment>
84
-
85
  </publication>
86
  <additional_lists translate="label comment">
87
  <label>Additional Lists</label>
88
  <frontend_type>multiselect</frontend_type>
89
  <source_model>emaildirect/system_config_source_additionallist</source_model>
90
- <sort_order>35</sort_order>
91
  <show_in_default>1</show_in_default>
92
  <show_in_website>0</show_in_website>
93
  <show_in_store>1</show_in_store>
94
  <can_be_empty>1</can_be_empty>
95
  <comment>Choose one or more Lists to allow your subscribers more options when subscribing. Not required</comment>
96
-
97
  </additional_lists>
98
  <source translate="label comment">
99
  <label>Source</label>
100
  <frontend_type>text</frontend_type>
101
- <sort_order>42</sort_order>
102
  <show_in_default>1</show_in_default>
103
  <show_in_website>0</show_in_website>
104
  <show_in_store>1</show_in_store>
105
  <can_be_empty>0</can_be_empty>
106
  <comment><![CDATA[This is the main source used with the Magento General Subscription.<br/> If you leave this field blank <b>Magento</b> is used]]></comment>
107
-
108
  </source>
109
  <override_source translate="label">
110
  <label>Override Source</label>
111
  <frontend_type>select</frontend_type>
112
  <source_model>adminhtml/system_config_source_yesno</source_model>
113
- <sort_order>50</sort_order>
114
  <show_in_default>1</show_in_default>
115
- <show_in_website>1</show_in_website>
116
  <show_in_store>1</show_in_store>
117
  <comment>If set to "Yes", the source will be updated when an existing customer is updated.</comment>
118
-
119
  </override_source>
120
 
121
- <checkout_subscribe translate="label comment">
122
- <label>Subscribe On Checkout</label>
123
- <frontend_type>select</frontend_type>
124
- <source_model>emaildirect/system_config_source_checkoutsubscribe</source_model>
125
- <sort_order>60</sort_order>
126
- <show_in_default>1</show_in_default>
127
- <show_in_website>0</show_in_website>
128
- <show_in_store>1</show_in_store>
129
- <comment>Show Newsletter Subscribe checkbox in the last Checkout Step (Order Review)</comment>
130
-
131
- </checkout_subscribe>
132
-
133
  <heading_mappings translate="label">
134
  <label>Field Mappings</label>
135
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
136
- <sort_order>69</sort_order>
137
  <show_in_default>1</show_in_default>
138
  <show_in_website>0</show_in_website>
139
  <show_in_store>1</show_in_store>
@@ -143,71 +135,120 @@
143
  <label>Address Fields Mapping</label>
144
  <frontend_model>emaildirect/adminhtml_system_config_form_field_addressmapfields</frontend_model>
145
  <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
146
- <sort_order>72</sort_order>
147
  <show_in_default>1</show_in_default>
148
  <show_in_website>0</show_in_website>
149
  <show_in_store>1</show_in_store>
150
-
151
  </address_fields>
152
  <map_fields translate="label comment">
153
  <label>Customer Fields Mapping</label>
154
  <frontend_model>emaildirect/adminhtml_system_config_form_field_mapfields</frontend_model>
155
  <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
156
- <sort_order>70</sort_order>
157
  <show_in_default>1</show_in_default>
158
  <show_in_website>0</show_in_website>
159
  <show_in_store>1</show_in_store>
160
-
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>75</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
-
171
  </shipping_fields>
172
 
173
  <heading_orders translate="label">
174
  <label>Orders</label>
175
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
176
- <sort_order>84</sort_order>
177
  <show_in_default>1</show_in_default>
178
- <show_in_website>1</show_in_website>
179
  <show_in_store>1</show_in_store>
180
  </heading_orders>
181
  <sendorder translate="label">
182
  <label>Send orders to EmailDirect</label>
183
  <frontend_type>select</frontend_type>
184
  <source_model>adminhtml/system_config_source_yesno</source_model>
185
- <sort_order>85</sort_order>
186
  <show_in_default>1</show_in_default>
187
- <show_in_website>1</show_in_website>
188
  <show_in_store>1</show_in_store>
189
  <comment>Sends all completed orders to EmailDirect Purchase Behavior for detailed reporting, filtering and targeting</comment>
190
  </sendorder>
 
 
 
 
 
 
 
 
 
 
191
  <send_states translate="label comment">
192
- <label>Send order on which state(s)</label>
193
  <frontend_type>multiselect</frontend_type>
194
  <source_model>emaildirect/system_config_source_states</source_model>
195
- <sort_order>86</sort_order>
196
  <show_in_default>1</show_in_default>
197
  <show_in_website>0</show_in_website>
198
  <show_in_store>1</show_in_store>
199
-
200
  <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>
201
- <depends><sendorder>1</sendorder></depends>
202
- <!--<validate>required-entry</validate>-->
203
  </send_states>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  <save_latest_order translate="label">
205
  <label>Save Latest Order Information</label>
206
  <frontend_type>select</frontend_type>
207
  <source_model>adminhtml/system_config_source_yesno</source_model>
208
- <sort_order>88</sort_order>
209
  <show_in_default>1</show_in_default>
210
- <show_in_website>1</show_in_website>
211
  <show_in_store>1</show_in_store>
212
  <comment>Save information from the latest order along with the first 3 products from that order</comment>
213
  <depends><sendorder>1</sendorder></depends>
@@ -216,9 +257,9 @@
216
  <heading_abandoned translate="label">
217
  <label>Abandoned Carts</label>
218
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
219
- <sort_order>89</sort_order>
220
  <show_in_default>1</show_in_default>
221
- <show_in_website>1</show_in_website>
222
  <show_in_store>1</show_in_store>
223
  </heading_abandoned>
224
 
@@ -226,20 +267,19 @@
226
  <label>Add Abandoned Carts To EmailDirect</label>
227
  <frontend_type>select</frontend_type>
228
  <source_model>adminhtml/system_config_source_yesno</source_model>
229
- <sort_order>90</sort_order>
230
  <show_in_default>1</show_in_default>
231
- <show_in_website>1</show_in_website>
232
  <show_in_store>1</show_in_store>
233
  <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>
234
-
235
  </sendabandoned>
236
  <abandonedtime translate="label comment">
237
  <label>Abandoned Time</label>
238
  <frontend_type>select</frontend_type>
239
  <source_model>emaildirect/system_config_source_time</source_model>
240
- <sort_order>100</sort_order>
241
  <show_in_default>1</show_in_default>
242
- <show_in_website>1</show_in_website>
243
  <show_in_store>1</show_in_store>
244
  <comment>How long before a cart is considered abandoned?</comment>
245
  <depends><sendabandoned>1</sendabandoned></depends>
@@ -248,9 +288,9 @@
248
  <label>Abandoned Publication</label>
249
  <frontend_type>select</frontend_type>
250
  <source_model>emaildirect/system_config_source_publication</source_model>
251
- <sort_order>110</sort_order>
252
  <show_in_default>1</show_in_default>
253
- <show_in_website>1</show_in_website>
254
  <show_in_store>1</show_in_store>
255
  <can_be_empty>1</can_be_empty>
256
  <comment>This is the Publication that you will put abandoned shoppers into</comment>
@@ -260,31 +300,43 @@
260
  <label>Abandoned List</label>
261
  <frontend_type>select</frontend_type>
262
  <source_model>emaildirect/system_config_source_abandonedlist</source_model>
263
- <sort_order>120</sort_order>
264
  <show_in_default>1</show_in_default>
265
- <show_in_website>1</show_in_website>
266
  <show_in_store>1</show_in_store>
267
  <can_be_empty>1</can_be_empty>
268
  <comment>This is the List that you will put abandoned shoppers into. Not Required.</comment>
269
  <depends><sendabandoned>1</sendabandoned></depends>
270
  </abandonedlist>
 
 
 
 
 
 
 
 
 
 
 
 
271
  <!-- SEQUENCES -->
272
  <heading_sequence translate="label">
273
  <label>Abandoned Cart Sequences</label>
274
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
275
- <sort_order>149</sort_order>
276
  <show_in_default>1</show_in_default>
277
- <show_in_website>1</show_in_website>
278
  <show_in_store>1</show_in_store>
279
  <depends><sendabandoned>1</sendabandoned></depends>
280
- </heading_sequence>
281
  <abandonedsequence_enabled>
282
  <label>Add a sequence value to each abandoned cart?</label>
283
  <frontend_type>select</frontend_type>
284
  <source_model>adminhtml/system_config_source_yesno</source_model>
285
- <sort_order>150</sort_order>
286
  <show_in_default>1</show_in_default>
287
- <show_in_website>1</show_in_website>
288
  <show_in_store>1</show_in_store>
289
  <comment>This will allow you to assign a sequence of values to your subscribers, one for each abandoned cart.</comment>
290
  <depends><sendabandoned>1</sendabandoned></depends>
@@ -293,9 +345,9 @@
293
  <label>Sequence Database Field</label>
294
  <frontend_type>select</frontend_type>
295
  <source_model>emaildirect/system_config_source_sequence</source_model>
296
- <sort_order>160</sort_order>
297
  <show_in_default>1</show_in_default>
298
- <show_in_website>1</show_in_website>
299
  <show_in_store>1</show_in_store>
300
  <can_be_empty>1</can_be_empty>
301
  <comment>This is the database field in EmailDirect that the sequence will be stored in.</comment>
@@ -304,14 +356,115 @@
304
  <abandonedsequence_options translate="label comment">
305
  <label>Sequence Options</label>
306
  <frontend_type>textarea</frontend_type>
307
- <sort_order>170</sort_order>
308
  <show_in_default>1</show_in_default>
309
- <show_in_website>1</show_in_website>
310
  <show_in_store>1</show_in_store>
311
  <can_be_empty>1</can_be_empty>
312
  <comment>Enter one sequence per line to be appended.</comment>
313
  <depends><sendabandoned>1</sendabandoned><abandonedsequence_enabled>1</abandonedsequence_enabled></depends>
314
  </abandonedsequence_options>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  </fields>
316
  </general>
317
  <export translate="label comment">
@@ -319,7 +472,7 @@
319
  <frontend_type>text</frontend_type>
320
  <sort_order>670</sort_order>
321
  <show_in_default>1</show_in_default>
322
- <show_in_website>1</show_in_website>
323
  <show_in_store>1</show_in_store>
324
  <expanded>1</expanded>
325
  <fields>
@@ -328,7 +481,7 @@
328
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
329
  <sort_order>5</sort_order>
330
  <show_in_default>1</show_in_default>
331
- <show_in_website>1</show_in_website>
332
  <show_in_store>1</show_in_store>
333
  </heading_orders>
334
  <include_already_sent translate="label">
@@ -337,7 +490,7 @@
337
  <source_model>adminhtml/system_config_source_yesno</source_model>
338
  <sort_order>5</sort_order>
339
  <show_in_default>1</show_in_default>
340
- <show_in_website>1</show_in_website>
341
  <show_in_store>1</show_in_store>
342
  <comment>This option allows you to include or exclude orders that have been sent directly to EmailDirect through the normal order creation process.</comment>
343
  </include_already_sent>
@@ -346,7 +499,7 @@
346
  <frontend_model>emaildirect/adminhtml_system_config_form_field_export_range</frontend_model>
347
  <sort_order>10</sort_order>
348
  <show_in_default>1</show_in_default>
349
- <show_in_website>1</show_in_website>
350
  <show_in_store>1</show_in_store>
351
  <can_be_empty>1</can_be_empty>
352
  <comment>Only orders within the past year can be exported</comment>
@@ -356,7 +509,7 @@
356
  <frontend_model>emaildirect/adminhtml_system_config_form_field_export_orders</frontend_model>
357
  <sort_order>20</sort_order>
358
  <show_in_default>1</show_in_default>
359
- <show_in_website>1</show_in_website>
360
  <show_in_store>1</show_in_store>
361
  <can_be_empty>1</can_be_empty>
362
  <comment>Export Orders to CSV and send the CSV file to Emaildirect (opens in new window)</comment>
@@ -367,7 +520,7 @@
367
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
368
  <sort_order>30</sort_order>
369
  <show_in_default>1</show_in_default>
370
- <show_in_website>1</show_in_website>
371
  <show_in_store>1</show_in_store>
372
  </heading_products>
373
  <include_disabled translate="label">
@@ -376,7 +529,7 @@
376
  <source_model>adminhtml/system_config_source_yesno</source_model>
377
  <sort_order>40</sort_order>
378
  <show_in_default>1</show_in_default>
379
- <show_in_website>1</show_in_website>
380
  <show_in_store>1</show_in_store>
381
  </include_disabled>
382
  <batch translate="label comment">
@@ -394,7 +547,7 @@
394
  <frontend_model>emaildirect/adminhtml_system_config_form_field_export_products</frontend_model>
395
  <sort_order>60</sort_order>
396
  <show_in_default>1</show_in_default>
397
- <show_in_website>1</show_in_website>
398
  <show_in_store>1</show_in_store>
399
  <can_be_empty>1</can_be_empty>
400
  <comment>Export Products to CSV and send the CSV file to Emaildirect (opens in new window)</comment>
@@ -425,7 +578,7 @@
425
  <frontend_model>emaildirect/adminhtml_system_config_form_field_troubleshooting</frontend_model>
426
  <sort_order>10</sort_order>
427
  <show_in_default>1</show_in_default>
428
- <show_in_website>1</show_in_website>
429
  <show_in_store>1</show_in_store>
430
  <comment></comment>
431
  </enabled>
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>
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">
64
  <apikey_instructions>
65
  <label>Get your API Key</label>
66
  <frontend_model>emaildirect/adminhtml_system_config_form_field_note</frontend_model>
67
+ <sort_order>25</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
  </apikey_instructions>
72
+ <checkout_subscribe translate="label comment">
73
+ <label>Subscribe On Checkout</label>
74
+ <frontend_type>select</frontend_type>
75
+ <source_model>emaildirect/system_config_source_checkoutsubscribe</source_model>
76
+ <sort_order>50</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
+ <comment>Show Newsletter Subscribe checkbox in the last Checkout Step (Order Review)</comment>
81
+ </checkout_subscribe>
82
  <publication translate="label comment">
83
  <label>Publication</label>
84
  <frontend_type>select</frontend_type>
85
  <source_model>emaildirect/system_config_source_publication</source_model>
86
+ <sort_order>60</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
  <can_be_empty>1</can_be_empty>
91
  <comment>This is the Publication that emails will be subscribed to and is required</comment>
 
92
  </publication>
93
  <additional_lists translate="label comment">
94
  <label>Additional Lists</label>
95
  <frontend_type>multiselect</frontend_type>
96
  <source_model>emaildirect/system_config_source_additionallist</source_model>
97
+ <sort_order>70</sort_order>
98
  <show_in_default>1</show_in_default>
99
  <show_in_website>0</show_in_website>
100
  <show_in_store>1</show_in_store>
101
  <can_be_empty>1</can_be_empty>
102
  <comment>Choose one or more Lists to allow your subscribers more options when subscribing. Not required</comment>
 
103
  </additional_lists>
104
  <source translate="label comment">
105
  <label>Source</label>
106
  <frontend_type>text</frontend_type>
107
+ <sort_order>80</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>0</can_be_empty>
112
  <comment><![CDATA[This is the main source used with the Magento General Subscription.<br/> If you leave this field blank <b>Magento</b> is used]]></comment>
 
113
  </source>
114
  <override_source translate="label">
115
  <label>Override Source</label>
116
  <frontend_type>select</frontend_type>
117
  <source_model>adminhtml/system_config_source_yesno</source_model>
118
+ <sort_order>90</sort_order>
119
  <show_in_default>1</show_in_default>
120
+ <show_in_website>0</show_in_website>
121
  <show_in_store>1</show_in_store>
122
  <comment>If set to "Yes", the source will be updated when an existing customer is updated.</comment>
 
123
  </override_source>
124
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  <heading_mappings translate="label">
126
  <label>Field Mappings</label>
127
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
128
+ <sort_order>100</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>
135
  <label>Address Fields Mapping</label>
136
  <frontend_model>emaildirect/adminhtml_system_config_form_field_addressmapfields</frontend_model>
137
  <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
138
+ <sort_order>110</sort_order>
139
  <show_in_default>1</show_in_default>
140
  <show_in_website>0</show_in_website>
141
  <show_in_store>1</show_in_store>
 
142
  </address_fields>
143
  <map_fields translate="label comment">
144
  <label>Customer Fields Mapping</label>
145
  <frontend_model>emaildirect/adminhtml_system_config_form_field_mapfields</frontend_model>
146
  <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
147
+ <sort_order>120</sort_order>
148
  <show_in_default>1</show_in_default>
149
  <show_in_website>0</show_in_website>
150
  <show_in_store>1</show_in_store>
 
151
  </map_fields>
152
  <shipping_fields translate="label comment">
153
  <label>Shipping Fields Mapping</label>
154
  <frontend_model>emaildirect/adminhtml_system_config_form_field_shippingmapfields</frontend_model>
155
  <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
156
+ <sort_order>130</sort_order>
157
  <show_in_default>1</show_in_default>
158
  <show_in_website>0</show_in_website>
159
  <show_in_store>1</show_in_store>
 
160
  </shipping_fields>
161
 
162
  <heading_orders translate="label">
163
  <label>Orders</label>
164
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
165
+ <sort_order>200</sort_order>
166
  <show_in_default>1</show_in_default>
167
+ <show_in_website>0</show_in_website>
168
  <show_in_store>1</show_in_store>
169
  </heading_orders>
170
  <sendorder translate="label">
171
  <label>Send orders to EmailDirect</label>
172
  <frontend_type>select</frontend_type>
173
  <source_model>adminhtml/system_config_source_yesno</source_model>
174
+ <sort_order>210</sort_order>
175
  <show_in_default>1</show_in_default>
176
+ <show_in_website>0</show_in_website>
177
  <show_in_store>1</show_in_store>
178
  <comment>Sends all completed orders to EmailDirect Purchase Behavior for detailed reporting, filtering and targeting</comment>
179
  </sendorder>
180
+ <send_field>
181
+ <label>Send orders based on</label>
182
+ <frontend_type>select</frontend_type>
183
+ <source_model>emaildirect/system_config_source_send_field</source_model>
184
+ <sort_order>212</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
+ <depends><sendorder>1</sendorder></depends>
189
+ </send_field>
190
  <send_states translate="label comment">
191
+ <label>State options</label>
192
  <frontend_type>multiselect</frontend_type>
193
  <source_model>emaildirect/system_config_source_states</source_model>
194
+ <sort_order>220</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
  <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>
199
+ <depends><send_field>state</send_field></depends>
 
200
  </send_states>
201
+ <send_statuses translate="label comment">
202
+ <label>Status options</label>
203
+ <frontend_type>multiselect</frontend_type>
204
+ <source_model>emaildirect/system_config_source_statuses</source_model>
205
+ <sort_order>225</sort_order>
206
+ <show_in_default>1</show_in_default>
207
+ <show_in_website>0</show_in_website>
208
+ <show_in_store>1</show_in_store>
209
+ <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>
210
+ <depends><send_field>status</send_field></depends>
211
+ </send_statuses>
212
+ <batch_enabled>
213
+ <label>Send orders in background?</label>
214
+ <frontend_type>select</frontend_type>
215
+ <source_model>adminhtml/system_config_source_yesno</source_model>
216
+ <sort_order>230</sort_order>
217
+ <show_in_default>1</show_in_default>
218
+ <show_in_website>0</show_in_website>
219
+ <show_in_store>1</show_in_store>
220
+ <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>
221
+ <depends><sendorder>1</sendorder></depends>
222
+ </batch_enabled>
223
+ <batch_size>
224
+ <label>Number of orders to process each time the batch is run</label>
225
+ <frontend_type>text</frontend_type>
226
+ <sort_order>250</sort_order>
227
+ <show_in_default>0</show_in_default>
228
+ <show_in_website>0</show_in_website>
229
+ <show_in_store>0</show_in_store>
230
+ <comment>Leave blank to send all (not recommended).</comment>
231
+ <depends><batch_enabled>1</batch_enabled></depends>
232
+ </batch_size>
233
+ <batch_only>
234
+ <label>Send in background only?</label>
235
+ <frontend_type>select</frontend_type>
236
+ <source_model>adminhtml/system_config_source_yesno</source_model>
237
+ <sort_order>240</sort_order>
238
+ <show_in_default>1</show_in_default>
239
+ <show_in_website>0</show_in_website>
240
+ <show_in_store>1</show_in_store>
241
+ <comment>Orders will only be sent in the background process.</comment>
242
+ <depends><batch_enabled>1</batch_enabled></depends>
243
+ </batch_only>
244
+
245
  <save_latest_order translate="label">
246
  <label>Save Latest Order Information</label>
247
  <frontend_type>select</frontend_type>
248
  <source_model>adminhtml/system_config_source_yesno</source_model>
249
+ <sort_order>230</sort_order>
250
  <show_in_default>1</show_in_default>
251
+ <show_in_website>0</show_in_website>
252
  <show_in_store>1</show_in_store>
253
  <comment>Save information from the latest order along with the first 3 products from that order</comment>
254
  <depends><sendorder>1</sendorder></depends>
257
  <heading_abandoned translate="label">
258
  <label>Abandoned Carts</label>
259
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
260
+ <sort_order>300</sort_order>
261
  <show_in_default>1</show_in_default>
262
+ <show_in_website>0</show_in_website>
263
  <show_in_store>1</show_in_store>
264
  </heading_abandoned>
265
 
267
  <label>Add Abandoned Carts To EmailDirect</label>
268
  <frontend_type>select</frontend_type>
269
  <source_model>adminhtml/system_config_source_yesno</source_model>
270
+ <sort_order>310</sort_order>
271
  <show_in_default>1</show_in_default>
272
+ <show_in_website>0</show_in_website>
273
  <show_in_store>1</show_in_store>
274
  <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>
 
275
  </sendabandoned>
276
  <abandonedtime translate="label comment">
277
  <label>Abandoned Time</label>
278
  <frontend_type>select</frontend_type>
279
  <source_model>emaildirect/system_config_source_time</source_model>
280
+ <sort_order>320</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>How long before a cart is considered abandoned?</comment>
285
  <depends><sendabandoned>1</sendabandoned></depends>
288
  <label>Abandoned Publication</label>
289
  <frontend_type>select</frontend_type>
290
  <source_model>emaildirect/system_config_source_publication</source_model>
291
+ <sort_order>330</sort_order>
292
  <show_in_default>1</show_in_default>
293
+ <show_in_website>0</show_in_website>
294
  <show_in_store>1</show_in_store>
295
  <can_be_empty>1</can_be_empty>
296
  <comment>This is the Publication that you will put abandoned shoppers into</comment>
300
  <label>Abandoned List</label>
301
  <frontend_type>select</frontend_type>
302
  <source_model>emaildirect/system_config_source_abandonedlist</source_model>
303
+ <sort_order>340</sort_order>
304
  <show_in_default>1</show_in_default>
305
+ <show_in_website>0</show_in_website>
306
  <show_in_store>1</show_in_store>
307
  <can_be_empty>1</can_be_empty>
308
  <comment>This is the List that you will put abandoned shoppers into. Not Required.</comment>
309
  <depends><sendabandoned>1</sendabandoned></depends>
310
  </abandonedlist>
311
+ <capture_enabled translate="label">
312
+ <label>Capture guest emails?</label>
313
+ <frontend_type>select</frontend_type>
314
+ <source_model>adminhtml/system_config_source_yesno</source_model>
315
+ <sort_order>350</sort_order>
316
+ <show_in_default>1</show_in_default>
317
+ <show_in_website>0</show_in_website>
318
+ <show_in_store>1</show_in_store>
319
+ <comment>When enabled, this feature will capture guest emails from various forms within the site to be used with abandoned carts.</comment>
320
+ <depends><sendabandoned>1</sendabandoned></depends>
321
+ </capture_enabled>
322
+
323
  <!-- SEQUENCES -->
324
  <heading_sequence translate="label">
325
  <label>Abandoned Cart Sequences</label>
326
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
327
+ <sort_order>360</sort_order>
328
  <show_in_default>1</show_in_default>
329
+ <show_in_website>0</show_in_website>
330
  <show_in_store>1</show_in_store>
331
  <depends><sendabandoned>1</sendabandoned></depends>
332
+ </heading_sequence>
333
  <abandonedsequence_enabled>
334
  <label>Add a sequence value to each abandoned cart?</label>
335
  <frontend_type>select</frontend_type>
336
  <source_model>adminhtml/system_config_source_yesno</source_model>
337
+ <sort_order>370</sort_order>
338
  <show_in_default>1</show_in_default>
339
+ <show_in_website>0</show_in_website>
340
  <show_in_store>1</show_in_store>
341
  <comment>This will allow you to assign a sequence of values to your subscribers, one for each abandoned cart.</comment>
342
  <depends><sendabandoned>1</sendabandoned></depends>
345
  <label>Sequence Database Field</label>
346
  <frontend_type>select</frontend_type>
347
  <source_model>emaildirect/system_config_source_sequence</source_model>
348
+ <sort_order>380</sort_order>
349
  <show_in_default>1</show_in_default>
350
+ <show_in_website>0</show_in_website>
351
  <show_in_store>1</show_in_store>
352
  <can_be_empty>1</can_be_empty>
353
  <comment>This is the database field in EmailDirect that the sequence will be stored in.</comment>
356
  <abandonedsequence_options translate="label comment">
357
  <label>Sequence Options</label>
358
  <frontend_type>textarea</frontend_type>
359
+ <sort_order>390</sort_order>
360
  <show_in_default>1</show_in_default>
361
+ <show_in_website>0</show_in_website>
362
  <show_in_store>1</show_in_store>
363
  <can_be_empty>1</can_be_empty>
364
  <comment>Enter one sequence per line to be appended.</comment>
365
  <depends><sendabandoned>1</sendabandoned><abandonedsequence_enabled>1</abandonedsequence_enabled></depends>
366
  </abandonedsequence_options>
367
+
368
+ <!-- signup -->
369
+ <heading_signup translate="label">
370
+ <label>EmailDirect Signup Form</label>
371
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
372
+ <sort_order>400</sort_order>
373
+ <show_in_default>1</show_in_default>
374
+ <show_in_website>0</show_in_website>
375
+ <show_in_store>1</show_in_store>
376
+ </heading_signup>
377
+ <signup_enabled>
378
+ <label>Show EmailDirect Signup form?</label>
379
+ <frontend_type>select</frontend_type>
380
+ <source_model>adminhtml/system_config_source_yesno</source_model>
381
+ <sort_order>410</sort_order>
382
+ <show_in_default>1</show_in_default>
383
+ <show_in_website>0</show_in_website>
384
+ <show_in_store>1</show_in_store>
385
+ <comment>This will allow you to show an EmailDirect signup form in a popup.</comment>
386
+ </signup_enabled>
387
+ <signup_url>
388
+ <label>URL to Signup Form</label>
389
+ <frontend_type>text</frontend_type>
390
+ <sort_order>420</sort_order>
391
+ <show_in_default>1</show_in_default>
392
+ <show_in_website>0</show_in_website>
393
+ <show_in_store>1</show_in_store>
394
+ <comment>URL to the EmailDirect Signup Form.</comment>
395
+ <depends><signup_enabled>1</signup_enabled></depends>
396
+ </signup_url>
397
+ <signup_delay>
398
+ <label>Delay before showing</label>
399
+ <frontend_type>text</frontend_type>
400
+ <sort_order>430</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
+ <depends><signup_enabled>1</signup_enabled></depends>
405
+ <comment>How many seconds before the signup form is shown</comment>
406
+ </signup_delay>
407
+ <signup_recurrence>
408
+ <label>Recurrence</label>
409
+ <frontend_type>select</frontend_type>
410
+ <source_model>emaildirect/system_config_source_signup_recurrence</source_model>
411
+ <sort_order>440</sort_order>
412
+ <show_in_default>1</show_in_default>
413
+ <show_in_website>0</show_in_website>
414
+ <show_in_store>1</show_in_store>
415
+ <comment>Time until Signup Form displays again, per visitor.</comment>
416
+ <depends><signup_enabled>1</signup_enabled></depends>
417
+ </signup_recurrence>
418
+ <signup_width>
419
+ <label>Width of Form</label>
420
+ <frontend_type>text</frontend_type>
421
+ <sort_order>450</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
+ <depends><signup_enabled>1</signup_enabled></depends>
426
+ </signup_width>
427
+ <signup_height>
428
+ <label>Height of Form</label>
429
+ <frontend_type>text</frontend_type>
430
+ <sort_order>460</sort_order>
431
+ <show_in_default>1</show_in_default>
432
+ <show_in_website>0</show_in_website>
433
+ <show_in_store>1</show_in_store>
434
+ <depends><signup_enabled>1</signup_enabled></depends>
435
+ </signup_height>
436
+ <signup_opacity>
437
+ <label>Opacity of background</label>
438
+ <frontend_type>select</frontend_type>
439
+ <source_model>emaildirect/system_config_source_signup_opacity</source_model>
440
+ <sort_order>470</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_opacity>
446
+ <signup_test_button>
447
+ <label>Test Signup Form</label>
448
+ <frontend_model>emaildirect/adminhtml_system_config_form_field_signup_test</frontend_model>
449
+ <sort_order>480</sort_order>
450
+ <show_in_default>1</show_in_default>
451
+ <show_in_website>0</show_in_website>
452
+ <show_in_store>1</show_in_store>
453
+ <can_be_empty>1</can_be_empty>
454
+ <comment>Test the signup form popup (opens in new window)</comment>
455
+ <depends><signup_enabled>1</signup_enabled></depends>
456
+ </signup_test_button>
457
+ <signup_activated>
458
+ <label>Activate Signup Form?</label>
459
+ <frontend_type>select</frontend_type>
460
+ <source_model>adminhtml/system_config_source_yesno</source_model>
461
+ <sort_order>490</sort_order>
462
+ <show_in_default>1</show_in_default>
463
+ <show_in_website>0</show_in_website>
464
+ <show_in_store>1</show_in_store>
465
+ <comment>Do not activate this form until it has been tested.</comment>
466
+ <depends><signup_enabled>1</signup_enabled></depends>
467
+ </signup_activated>
468
  </fields>
469
  </general>
470
  <export translate="label comment">
472
  <frontend_type>text</frontend_type>
473
  <sort_order>670</sort_order>
474
  <show_in_default>1</show_in_default>
475
+ <show_in_website>0</show_in_website>
476
  <show_in_store>1</show_in_store>
477
  <expanded>1</expanded>
478
  <fields>
481
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
482
  <sort_order>5</sort_order>
483
  <show_in_default>1</show_in_default>
484
+ <show_in_website>0</show_in_website>
485
  <show_in_store>1</show_in_store>
486
  </heading_orders>
487
  <include_already_sent translate="label">
490
  <source_model>adminhtml/system_config_source_yesno</source_model>
491
  <sort_order>5</sort_order>
492
  <show_in_default>1</show_in_default>
493
+ <show_in_website>0</show_in_website>
494
  <show_in_store>1</show_in_store>
495
  <comment>This option allows you to include or exclude orders that have been sent directly to EmailDirect through the normal order creation process.</comment>
496
  </include_already_sent>
499
  <frontend_model>emaildirect/adminhtml_system_config_form_field_export_range</frontend_model>
500
  <sort_order>10</sort_order>
501
  <show_in_default>1</show_in_default>
502
+ <show_in_website>0</show_in_website>
503
  <show_in_store>1</show_in_store>
504
  <can_be_empty>1</can_be_empty>
505
  <comment>Only orders within the past year can be exported</comment>
509
  <frontend_model>emaildirect/adminhtml_system_config_form_field_export_orders</frontend_model>
510
  <sort_order>20</sort_order>
511
  <show_in_default>1</show_in_default>
512
+ <show_in_website>0</show_in_website>
513
  <show_in_store>1</show_in_store>
514
  <can_be_empty>1</can_be_empty>
515
  <comment>Export Orders to CSV and send the CSV file to Emaildirect (opens in new window)</comment>
520
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
521
  <sort_order>30</sort_order>
522
  <show_in_default>1</show_in_default>
523
+ <show_in_website>0</show_in_website>
524
  <show_in_store>1</show_in_store>
525
  </heading_products>
526
  <include_disabled translate="label">
529
  <source_model>adminhtml/system_config_source_yesno</source_model>
530
  <sort_order>40</sort_order>
531
  <show_in_default>1</show_in_default>
532
+ <show_in_website>0</show_in_website>
533
  <show_in_store>1</show_in_store>
534
  </include_disabled>
535
  <batch translate="label comment">
547
  <frontend_model>emaildirect/adminhtml_system_config_form_field_export_products</frontend_model>
548
  <sort_order>60</sort_order>
549
  <show_in_default>1</show_in_default>
550
+ <show_in_website>0</show_in_website>
551
  <show_in_store>1</show_in_store>
552
  <can_be_empty>1</can_be_empty>
553
  <comment>Export Products to CSV and send the CSV file to Emaildirect (opens in new window)</comment>
578
  <frontend_model>emaildirect/adminhtml_system_config_form_field_troubleshooting</frontend_model>
579
  <sort_order>10</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
  <comment></comment>
584
  </enabled>
app/code/community/EmailDirect/Integration/sql/emaildirect_setup/mysql4-install-2.0.0.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try
8
+ {
9
+ $installer->run("
10
+
11
+ DROP TABLE IF EXISTS {$this->getTable('emaildirect/session')};
12
+ CREATE TABLE {$this->getTable('emaildirect/session')} (
13
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
14
+ `customer_id` int(11) DEFAULT NULL,
15
+ `magento_session_id` varchar(255) NOT NULL,
16
+ `email` varchar(255) NULL,
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,
24
+ `session_id` int(11) NOT NULL,
25
+ `date_sent` TIMESTAMP NULL,
26
+ `quote_id` int(11) DEFAULT NULL,
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,
34
+ `date_sent` TIMESTAMP NULL,
35
+ `order_id` int(11) DEFAULT NULL,
36
+ PRIMARY KEY (`id`),
37
+ KEY `idx_order_id` (`order_id`)
38
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
39
+
40
+ ");
41
+ }
42
+ catch (Exception $e)
43
+ {
44
+ Mage::helper('emaildirect/upgrade')->install_log($e->getMessage());
45
+ }
46
+
47
+ $installer->endSetup();
app/code/community/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-1.5.8-2.0.0.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try
8
+ {
9
+ $installer->run("
10
+
11
+ DROP TABLE IF EXISTS {$this->getTable('emaildirect/session')};
12
+ CREATE TABLE {$this->getTable('emaildirect/session')} (
13
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
14
+ `customer_id` int(11) DEFAULT NULL,
15
+ `magento_session_id` varchar(255) NOT NULL,
16
+ `email` varchar(255) NULL,
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,
24
+ `session_id` int(11) NOT NULL,
25
+ `date_sent` TIMESTAMP NULL,
26
+ `quote_id` int(11) DEFAULT NULL,
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,
34
+ `date_sent` TIMESTAMP NULL,
35
+ `order_id` int(11) DEFAULT NULL,
36
+ PRIMARY KEY (`id`),
37
+ KEY `idx_order_id` (`order_id`)
38
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
39
+
40
+ ");
41
+
42
+ // Rename the old local installation so that it doesn't interfere with the new community code
43
+ Mage::helper('emaildirect/upgrade')->renameOld();
44
+ }
45
+ catch (Exception $e)
46
+ {
47
+ Mage::helper('emaildirect/upgrade')->install_log($e->getMessage());
48
+ }
49
+
50
+ $installer->endSetup();
app/code/local/EmailDirect/Integration/Block/Adminhtml/Abandoned.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
-
3
- class EmailDirect_Integration_Block_Adminhtml_Abandoned extends Mage_Adminhtml_Block_Widget_Grid_Container
4
- {
5
- public function __construct()
6
- {
7
- $this->_controller = 'adminhtml_abandoned';
8
- $this->_blockGroup = 'emaildirect';
9
-
10
- if (Mage::helper('emaildirect')->getAbandonedEnabled())
11
- {
12
- $this->_headerText = "Abandoned Carts - Last Run: " . Mage::helper('emaildirect')->getAbandonedLastRunHtml();
13
-
14
- $this->_addButton('run_now', array(
15
- 'label' => Mage::helper('emaildirect')->__('Run Now'),
16
- 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/run', Mage::helper('emaildirect')->getUrlParams()) .'\')',
17
- ));
18
- }
19
- else
20
- $this->_headerText = "Abandoned Carts - <span class='ab_ng'>Disabled</span>";
21
-
22
- parent::__construct();
23
- $this->_removeButton('add');
24
- }
25
-
26
- public function getStoreSwitcherHtml()
27
- {
28
- if (Mage::app()->isSingleStoreMode())
29
- return '';
30
- return $this->getChildHtml('store_switcher');
31
- }
32
-
33
- protected function _prepareLayout()
34
- {
35
- $this->setChild('store_switcher',
36
- $this->getLayout()->createBlock('adminhtml/store_switcher')
37
- ->setUseConfirm(false)
38
- ->setSwitchUrl($this->getUrl('*/*/*', array('store'=>null)))
39
- ->setTemplate('report/store/switcher.phtml')
40
- );
41
-
42
- return parent::_prepareLayout();
43
- }
44
-
45
- public function getGridHtml()
46
- {
47
- return $this->getStoreSwitcherHtml() . parent::getGridHtml();
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/EmailDirect/Integration/Block/Adminhtml/Abandoned/Grid.php DELETED
@@ -1,285 +0,0 @@
1
- <?php
2
-
3
- class EmailDirect_Integration_Block_Adminhtml_Abandoned_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
-
6
- /**
7
- * ids of current stores
8
- */
9
- protected $_storeIds = array();
10
-
11
- /**
12
- * stores current currency code
13
- */
14
- protected $_currentCurrencyCode = null;
15
-
16
- public function __construct()
17
- {
18
- parent::__construct();
19
- $this->setId('abandonedGrid');
20
- $this->setUseAjax(true);
21
- $this->setDefaultSort('updated_at');
22
- $this->setSaveParametersInSession(true);
23
- $this->setPagerVisibility(true);
24
- $this->setTemplate('widget/grid.phtml');
25
- $this->setRowClickCallback('openGridRow');
26
- }
27
-
28
- /**
29
- * Retrieve currency code based on selected store
30
- *
31
- * @return string
32
- */
33
- public function getCurrentCurrencyCode()
34
- {
35
- if (is_null($this->_currentCurrencyCode)) {
36
- reset($this->_storeIds);
37
- $this->_currentCurrencyCode = (count($this->_storeIds) > 0)
38
- ? Mage::app()->getStore(current($this->_storeIds))->getBaseCurrencyCode()
39
- : Mage::app()->getStore()->getBaseCurrencyCode();
40
- }
41
- return $this->_currentCurrencyCode;
42
- }
43
-
44
- /**
45
- * storeIds setter
46
- *
47
- * @param array $storeIds
48
- * @return Mage_Adminhtml_Block_Report_Grid_Shopcart_Abstract
49
- */
50
- public function setStoreIds($storeIds)
51
- {
52
- $this->_storeIds = $storeIds;
53
- return $this;
54
- }
55
-
56
- private function prepareForAbandonedReport($storeIds, $filter = null)
57
- {
58
- $collection = $this->getCollection();
59
-
60
- $collection->addFieldToFilter('items_count', array('neq' => '0'))
61
- ->addFieldToFilter('main_table.is_active', '1')
62
- ->addSubtotal($storeIds, $filter)
63
- ->addFieldToFilter('customer_email',array('notnull'=>1))
64
- ->setOrder('updated_at');
65
- if (is_array($storeIds) && !empty($storeIds))
66
- {
67
- $collection->addFieldToFilter('store_id', array('in' => $storeIds));
68
- }
69
-
70
- return $this;
71
- }
72
-
73
- protected function _prepareCollection()
74
- {
75
- /** @var $collection Mage_Reports_Model_Resource_Quote_Collection */
76
- $collection = Mage::getResourceModel('reports/quote_collection');
77
-
78
- $filter = $this->getParam($this->getVarNameFilter(), array());
79
-
80
- if ($filter)
81
- {
82
- $filter = base64_decode($filter);
83
- parse_str(urldecode($filter), $data);
84
- }
85
-
86
- $this->setCollection($collection);
87
-
88
- if (!empty($data))
89
- $this->prepareForAbandonedReport($this->_storeIds, $data);
90
- else
91
- $this->prepareForAbandonedReport($this->_storeIds);
92
-
93
- return parent::_prepareCollection();
94
- }
95
-
96
- protected function _addColumnFilterToCollection($column)
97
- {
98
- $field = ( $column->getFilterIndex() ) ? $column->getFilterIndex() : $column->getIndex();
99
- $skip = array('subtotal', 'customer_name'/*, 'email', 'created_at', 'updated_at'*/);
100
-
101
- if (in_array($field, $skip))
102
- return $this;
103
-
104
- parent::_addColumnFilterToCollection($column);
105
- return $this;
106
- }
107
-
108
- private function getCustomerGroups($blank = false)
109
- {
110
- $options = array();
111
-
112
- $groups = Mage::Helper('customer')->getGroups();
113
-
114
- if ($blank)
115
- $options[""] = "";
116
-
117
- foreach($groups as $group)
118
- {
119
- $options[$group->getData('customer_group_id')] = Mage::helper('catalog')->__($group->getData('customer_group_code'));
120
- }
121
-
122
- $options[0] = Mage::helper('catalog')->__('NOT LOGGED IN');
123
-
124
- return $options;
125
- }
126
-
127
- protected function _prepareColumns()
128
- {
129
- $this->addColumn('customer_firstname', array(
130
- 'header' =>Mage::helper('reports')->__('Customer First Name'),
131
- 'index' =>'customer_firstname'
132
- ));
133
-
134
- $this->addColumn('customer_lastname', array(
135
- 'header' =>Mage::helper('reports')->__('Last Name'),
136
- 'index' =>'customer_lastname'
137
- ));
138
-
139
- $this->addColumn('email', array(
140
- 'header' =>Mage::helper('reports')->__('Email'),
141
- 'index' =>'customer_email'
142
- ));
143
-
144
- $this->addColumn('customer_group_id', array(
145
- 'header' => Mage::helper('sales')->__('Customer Group'),
146
- 'index' => 'customer_group_id',
147
- //'filter_index' => 'IFNULL(cust.group_id,0)',
148
- 'type' => 'options',
149
- 'width' => 200,
150
- 'options' => $this->getCustomerGroups()
151
- ));
152
-
153
- $this->addColumn('items_count', array(
154
- 'header' =>Mage::helper('reports')->__('Number of Items'),
155
- 'width' =>'80px',
156
- 'align' =>'right',
157
- 'index' =>'items_count',
158
- 'type' =>'number'
159
- ));
160
-
161
- $this->addColumn('items_qty', array(
162
- 'header' =>Mage::helper('reports')->__('Quantity of Items'),
163
- 'width' =>'80px',
164
- 'align' =>'right',
165
- 'index' =>'items_qty',
166
- 'type' =>'number'
167
- ));
168
-
169
- if ($this->getRequest()->getParam('website'))
170
- $storeIds = Mage::app()->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
171
- else if ($this->getRequest()->getParam('group'))
172
- $storeIds = Mage::app()->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
173
- else if ($this->getRequest()->getParam('store'))
174
- $storeIds = array((int)$this->getRequest()->getParam('store'));
175
- else
176
- $storeIds = array();
177
-
178
- $this->setStoreIds($storeIds);
179
- $currencyCode = $this->getCurrentCurrencyCode();
180
-
181
- $this->addColumn('subtotal', array(
182
- 'header' => Mage::helper('reports')->__('Subtotal'),
183
- 'width' => '80px',
184
- 'type' => 'currency',
185
- 'currency_code' => $currencyCode,
186
- 'index' => 'subtotal',
187
- 'renderer' => 'adminhtml/report_grid_column_renderer_currency',
188
- 'rate' => $this->getRate($currencyCode),
189
- ));
190
-
191
- $this->addColumn('updated_at', array(
192
- 'header' =>Mage::helper('reports')->__('Abandoned Date'),
193
- 'width' =>'170px',
194
- 'type' =>'datetime',
195
- 'index' =>'updated_at',
196
- 'filter_index'=>'main_table.updated_at'
197
- ));
198
-
199
- $this->addColumn('abandoned_minutes', array(
200
- 'header' =>Mage::helper('reports')->__('Minutes'),
201
- 'width' =>'100px',
202
- 'renderer' => 'EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_AbandonedMinutes',
203
- 'index' =>'abandoned_minutes',
204
- 'sortable' => false,
205
- 'filter' => false,
206
- 'filter_index'=>'main_table.updated_at'
207
-
208
- ));
209
-
210
- $this->addColumn('remote_ip', array(
211
- 'header' =>Mage::helper('reports')->__('IP Address'),
212
- 'width' =>'80px',
213
- 'index' =>'remote_ip'
214
- ));
215
-
216
- $this->addColumn('emaildirect_abandoned_date', array(
217
- 'header' =>Mage::helper('reports')->__('Date Sent to EmailDirect'),
218
- //'width' =>'80px',
219
- 'index' =>'emaildirect_abandoned_date',
220
- 'type' => 'datetime',
221
-
222
- ));
223
-
224
- if (Mage::helper('emaildirect')->getAbandonedEnabled())
225
- {
226
- $this->addColumn('action',
227
- array(
228
- 'header' => Mage::helper('emaildirect')->__('Action'),
229
- 'width' => '100',
230
- 'type' => 'action',
231
- 'getter' => 'getId',
232
- 'actions' => array(
233
- array(
234
- 'caption' => Mage::helper('emaildirect')->__('Send'),
235
- 'url' => array('base'=> '*/*/send', 'params' => Mage::helper('emaildirect')->getUrlParams()),
236
- 'field' => 'id',
237
- 'sent' => false
238
- ),
239
- array(
240
- 'caption' => Mage::helper('emaildirect')->__('Resend'),
241
- 'url' => array('base'=> '*/*/send', 'params' => Mage::helper('emaildirect')->getUrlParams()),
242
- 'field' => 'id',
243
- 'sent' => true
244
- )
245
- ),
246
- 'filter' => false,
247
- 'sortable' => false,
248
- 'renderer' => 'EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_Action',
249
- 'index' => 'stores',
250
- 'is_system' => true,
251
- ));
252
- }
253
-
254
- //$this->addExportType('*/*/exportAbandonedCsv', Mage::helper('reports')->__('CSV'));
255
- //$this->addExportType('*/*/exportAbandonedExcel', Mage::helper('reports')->__('Excel XML'));
256
-
257
- return parent::_prepareColumns();
258
- }
259
-
260
- protected function _prepareMassaction()
261
- {
262
- if (!Mage::helper('emaildirect')->getAbandonedEnabled())
263
- return $this;
264
-
265
- $this->setMassactionIdField('post_id');
266
- $this->getMassactionBlock()->setFormFieldName('id');
267
-
268
- $this->getMassactionBlock()->addItem('send', array(
269
- 'label' => Mage::helper('emaildirect')->__('Send or Resend'),
270
- 'url' => $this->getUrl('*/*/massSend', Mage::helper('emaildirect')->getUrlParams())
271
- ));
272
-
273
- return $this;
274
- }
275
-
276
- public function getGridUrl()
277
- {
278
- return $this->getUrl('*/*/grid', array('_current'=> true));
279
- }
280
-
281
- public function getRowUrl($row)
282
- {
283
- return $this->getUrl('adminhtml/customer/edit', array('id'=>$row->getCustomerId(), 'active_tab'=>'cart'));
284
- }
285
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/EmailDirect/Integration/Block/Adminhtml/System/Config/Account.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- class EmailDirect_Integration_Block_Adminhtml_System_Config_Account
4
- extends Mage_Adminhtml_Block_System_Config_Form_Field
5
- {
6
- protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
7
- {
8
- $values = $element->getValues();
9
-
10
- $html = '<ul class="checkboxes">';
11
-
12
- foreach($values as $dat)
13
- {
14
- $html .= "<li>{$dat['label']}</li>";
15
- }
16
-
17
- $html .= '</ul>';
18
-
19
- return $html;
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/EmailDirect/Integration/Block/Widget/Grid/Column/Renderer/AbandonedMinutes.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- class EmailDirect_Integration_Block_Widget_Grid_Column_Renderer_AbandonedMinutes extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
3
- {
4
- public function render(Varien_Object $row)
5
- {
6
- $processed_date = $row->getData('emaildirect_abandoned_date');
7
-
8
- if ($processed_date != "")
9
- {
10
- return "";
11
- }
12
- else
13
- {
14
- $abandoned_date = strtotime($row->getData('updated_at'));
15
-
16
- $current_date = Mage::getModel('core/date')->gmtTimestamp();
17
-
18
- $minutes = round(abs($current_date - $abandoned_date) / 60,0);
19
-
20
- $class = 'ab_ok';
21
- if ($minutes > 60)
22
- $class = 'ab_ng';
23
-
24
- return "<span class='{$class}'>{$minutes}</span>";
25
- }
26
-
27
- }
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/EmailDirect/Integration/Model/System/Config/Source/States.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- class EmailDirect_Integration_Model_System_Config_Source_States
4
- {
5
- public function toOptionArray()
6
- {
7
- $states = Mage::getSingleton('sales/order_config')->getStates();
8
-
9
- $options = array();
10
-
11
- foreach($states as $value => $label)
12
- {
13
- $options[] = array(
14
- 'value' => $value,
15
- 'label' => $label);
16
- }
17
- return $options;
18
- }
19
- }
20
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/EmailDirect/Integration/sql/emaildirect_setup/mysql4-install-1.0.0.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- try
8
- {
9
- $installer->run("
10
-
11
- ALTER TABLE `{$this->getTable('sales_flat_quote')}`
12
- add column emaildirect_counter int(5) default '0'
13
- ");
14
- }
15
- catch (Exception $e)
16
- {
17
- // Ignore
18
- }
19
-
20
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-1.0.13-1.0.14.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- $installer = $this;
3
-
4
- $installer->startSetup();
5
-
6
- try
7
- {
8
- $installer->run("
9
- ALTER TABLE {$this->getTable('newsletter_subscriber')}
10
- ADD firstname varchar(255) NOT NULL default '',
11
- ADD lastname varchar(255) NOT NULL default ''
12
- ");
13
- }
14
- catch (Exception $e)
15
- {
16
- // Ignore
17
- }
18
-
19
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-1.0.19-1.2.0.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- try
8
- {
9
- $installer->run("
10
- ALTER TABLE `{$this->getTable('sales_flat_quote')}`
11
- add column emaildirect_abandoned_date TIMESTAMP NULL,
12
- add column emaildirect_abandoned_url Text NULL
13
- ");
14
- }
15
- catch (Exception $e)
16
- {
17
- // Ignore
18
- }
19
-
20
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/EmailDirect/Integration/sql/emaildirect_setup/mysql4-upgrade-1.5.4-1.5.5.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- try
8
- {
9
- $installer->run("
10
- ALTER TABLE `{$this->getTable('sales_flat_order')}`
11
- add column `sent_to_emaildirect` BOOLEAN NULL DEFAULT 0
12
- ");
13
- }
14
- catch (Exception $e)
15
- {
16
- // Ignore
17
- }
18
-
19
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/layout/emaildirect.xml CHANGED
@@ -39,7 +39,7 @@
39
  </block>
40
  </emaildirect_admin_export_orders>
41
 
42
- <emaildirect_admin_troubleshooting_index>
43
  <reference name="head">
44
  <action method="addCss"><stylesheet>emaildirect/emaildirect.css</stylesheet>
45
  </action>
@@ -63,16 +63,15 @@
63
  </reference>
64
  </emaildirect_admin_troubleshooting_index>
65
 
66
- <emaildirect_admin_abandoned_index>
67
- <reference name="head">
68
  <action method="addCss"><stylesheet>emaildirect/emaildirect.css</stylesheet></action>
69
-
70
  </reference>
71
- <reference name="content">
72
- <block type="emaildirect/adminhtml_abandoned" name="abandoned_details" template="report/grid/container.phtml">
73
-
74
- </block>
75
- </reference>
76
- </emaildirect_admin_abandoned_index>
77
-
78
- </layout>
39
  </block>
40
  </emaildirect_admin_export_orders>
41
 
42
+ <emaildirect_admin_troubleshooting_index>
43
  <reference name="head">
44
  <action method="addCss"><stylesheet>emaildirect/emaildirect.css</stylesheet>
45
  </action>
63
  </reference>
64
  </emaildirect_admin_troubleshooting_index>
65
 
66
+ <emaildirect_admin_abandoned_index>
67
+ <reference name="head">
68
  <action method="addCss"><stylesheet>emaildirect/emaildirect.css</stylesheet></action>
 
69
  </reference>
70
+ <reference name="content">
71
+ <block type="emaildirect/adminhtml_abandoned" name="abandoned_details" template="report/grid/container.phtml">
72
+
73
+ <!-- <block type="emaildirect/adminhtml_abandoned_status" name="grid.filter.form" as="grid.filter.form" template="emaildirect/abandoned/status.phtml"/>-->
74
+ </block>
75
+ </reference>
76
+ </emaildirect_admin_abandoned_index>
77
+ </layout>
app/{code/local/EmailDirect/Integration/controllers/Admin/OrderExportController.php → design/adminhtml/default/default/template/emaildirect/abandoned/grid.phtml} RENAMED
File without changes
app/design/adminhtml/default/default/template/emaildirect/abandoned/status.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $status = $this->getAbandonedStatus(); ?>
2
+
3
+ <table class='abandoned_status'>
4
+ <tr>
5
+ <th>Store</th>
6
+ <th>Status</th>
7
+ <th>Last Run</th>
8
+ </tr>
9
+ <?php foreach ($status['stores'] as $state): ?>
10
+ <tr>
11
+ <td><?php echo $state['name']; ?></td>
12
+ <td><?php if ($state['enabled']): ?><span class='ab_ok'>Enabled</span><?php else: ?><span class='ab_ng'>Disabled</span><?php endif; ?></td>
13
+ <td><?php echo $state['last_run']; ?></td>
14
+ <td><?php if ($state['enabled']): ?><button onclick="setLocation('<?php echo $this->getUrl('*/*/run', array('store_id' => $state['id'])); ?>');"><span>Run Now</span></button><?php endif; ?></td>
15
+ </tr>
16
+ <?php endforeach; ?>
17
+ </table>
18
+ <br />
app/design/adminhtml/default/default/template/emaildirect/system/config/fieldset/hint.phtml CHANGED
@@ -1,38 +1,23 @@
1
  <?php
2
 
3
- $failed_columns = $this->checkDatabaseColumns();
 
 
 
 
 
4
 
5
  ?>
6
- <?php if (count($failed_columns) > 0): ?>
7
- <div id="messages">
8
- <ul class="messages">
9
- <li class="error-msg">
10
- <ul>
11
- <li>
12
- <span>Required Database columns are missing! <button onclick="window.location='<?php echo $this->getUrl('emaildirect/admin_troubleshooting/columns'); ?>'; return false;" id="emaildirect_column_fix">Fix this problem</button></span>
13
- <table class='missing_columns'>
14
- <tr><th>Table</th><th>Column</th><th>SQL to Restore Column Manually</th></tr>
15
- <?php foreach ($failed_columns as $column): ?>
16
- <tr><td><?php echo $column['table']; ?></td><td><?php echo $column['column']; ?></td><td><?php echo $column['sql'] ?></td></tr>
17
- <?php endforeach; ?>
18
- </table>
19
- </li>
20
- </ul>
21
- </li>
22
- </ul>
23
- </div>
24
- <?php endif; ?>
25
-
26
  <div class="emaildirect-notice">
27
- <h4>
28
- <div class='abandoned'>Abandoned Cart Processing:
29
- <?php if ($this->getAbandonedEnabled()) : ?><span class='ab_ok'>Enabled</span> - Last Run: <?php echo $this->getAbandonedLastRunHtml() ?> - <button onclick="window.location='<?php echo $this->getUrl('emaildirect/admin_abandoned/index'); ?>'; return false;" id="emaildirect_details">Details</button><?php else: ?><span class='ab_ng'>Disabled</span><?php endif; ?></div>
30
- <strong>EmailDirect Integration v<?php echo $this->getEmaildirectVersion() ?></strong>
31
- </h4>
32
-
33
  </div>
34
  <script type='text/javascript'>
35
- var setup = <?php echo Mage::helper('emaildirect')->config('setup') == 1 ? 'true' : 'false'; ?>;
36
 
37
  document.observe('dom:loaded', function()
38
  {
1
  <?php
2
 
3
+ $setup = Mage::helper('emaildirect')->config('setup') == 1;
4
+ $api_key = Mage::helper('emaildirect')->config('apikey');
5
+ $abandoned_status = Mage::helper('emaildirect')->getAbandonedStatus();
6
+ $ab_enabled = $this->getAbandonedEnabled();
7
+ $last_run = $abandoned_status['cron_last_run'];
8
+ $last_run_label = "Cron Last Run";
9
 
10
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  <div class="emaildirect-notice">
12
+ <h4>
13
+ <?php if (!$this->isWebsiteConfig()): ?>
14
+ <div class='abandoned'>Abandoned Cart Processing: <?php if ($ab_enabled) : ?><span class='ab_ok'>Enabled</span><?php else: ?><span class='ab_ng'>Disabled</span><?php endif; ?> - <?php echo $last_run_label ?>: <?php echo $abandoned_status['cron_last_run'] ?> - <button onclick="window.location='<?php echo $this->getUrl('emaildirect/admin_abandoned/index'); ?>'; return false;" id="emaildirect_details">Details</button></div>
15
+ <?php endif; ?>
16
+ <strong>EmailDirect Integration v<?php echo $this->getEmaildirectVersion() ?><?php if (!$setup && strlen($api_key) > 0): ?> - <span class='ab_ng'>Invalid API Key (Please try saving the configuration again)</span><?php endif; ?></strong>
17
+ </h4>
18
  </div>
19
  <script type='text/javascript'>
20
+ var setup = <?php echo $setup == true ? 'true' : 'false'; ?>;
21
 
22
  document.observe('dom:loaded', function()
23
  {
app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/export/date_range.phtml CHANGED
@@ -10,10 +10,19 @@
10
  <script type='text/javascript'>
11
  var store = <?php echo Mage::helper('emaildirect')->getAdminStore(); ?>;
12
  var start_from = '<?php echo $this->getFromDate() ?>';
13
- var start_to = '<?php echo $this->getFromDate() ?>';
 
14
 
15
  var check_from = parseDate(start_from);
16
 
 
 
 
 
 
 
 
 
17
  function parseDate(date_string)
18
  {
19
  var date_parts = date_string.split('-');
@@ -21,35 +30,35 @@
21
  }
22
 
23
  var calendarSetupObject = {
24
- inputField : "order_export_from",
25
- ifFormat : "%Y-%m-%d",
26
- showTime : "false",
27
- button : "from_trig",
28
- align : "Bl",
29
- singleClick : true,
30
- disableFunc: function(date)
31
  {
32
  if (date < check_from)
33
  return true;
34
  }
35
  }
36
  Calendar.setup(calendarSetupObject);
37
-
38
  var calendarSetupObject2 = {
39
- inputField : "order_export_to",
40
- ifFormat : "%Y-%m-%d",
41
- showTime : "false",
42
- button : "to_trig",
43
- align : "Bl",
44
- singleClick : true,
45
- disableFunc: function(date)
46
  {
47
  if (date < check_from)
48
  return true;
49
  }
50
  }
51
  Calendar.setup(calendarSetupObject2);
52
-
53
  var url = '<?php echo $this->getUrl("emaildirect/admin_export/count/"); ?>';
54
 
55
  $('emaildirect_export_include_already_sent').observe('change', function(event)
@@ -91,7 +100,7 @@ function validateDates()
91
 
92
  if (to < check_from)
93
  {
94
- $('order_export_to').value = start_from;
95
  return false;
96
  }
97
 
@@ -112,21 +121,23 @@ function dateRangeChange()
112
  var to = $('order_export_to').value;
113
  var include = $('emaildirect_export_include_already_sent').value;
114
 
115
- //var include_disabled = form['groups[export][fields][include_disabled][value]'];
116
-
117
  $('orders_found').update("???");
118
 
119
  new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), {
120
  parameters : {from: from, to: to, include: include, store: store},
121
  method : 'post',
122
  loaderArea : false,
123
- onSuccess : function(transport)
124
  {
125
  var response = eval('(' + transport.responseText + ')');
126
-
127
  $('orders_found').update(response);
 
128
  }
129
  });
130
  }
131
 
 
 
 
132
  </script>
10
  <script type='text/javascript'>
11
  var store = <?php echo Mage::helper('emaildirect')->getAdminStore(); ?>;
12
  var start_from = '<?php echo $this->getFromDate() ?>';
13
+ var start_to = '<?php echo $this->getToDate() ?>';
14
+ var orders_count = '<?php echo $this->getOrdersCount(); ?>';
15
 
16
  var check_from = parseDate(start_from);
17
 
18
+ function setButtonState()
19
+ {
20
+ if (orders_count == 0 || orders_count == 'Unknown')
21
+ toggleValueElements({checked:true}, $('emaildirect_export_orders').parentNode);
22
+ else
23
+ toggleValueElements({checked:false}, $('emaildirect_export_orders').parentNode);
24
+ }
25
+
26
  function parseDate(date_string)
27
  {
28
  var date_parts = date_string.split('-');
30
  }
31
 
32
  var calendarSetupObject = {
33
+ inputField : "order_export_from",
34
+ ifFormat : "%Y-%m-%d",
35
+ showTime : "false",
36
+ button : "from_trig",
37
+ align : "Bl",
38
+ singleClick : true,
39
+ disableFunc : function(date)
40
  {
41
  if (date < check_from)
42
  return true;
43
  }
44
  }
45
  Calendar.setup(calendarSetupObject);
46
+
47
  var calendarSetupObject2 = {
48
+ inputField : "order_export_to",
49
+ ifFormat : "%Y-%m-%d",
50
+ showTime : "false",
51
+ button : "to_trig",
52
+ align : "Bl",
53
+ singleClick : true,
54
+ disableFunc : function(date)
55
  {
56
  if (date < check_from)
57
  return true;
58
  }
59
  }
60
  Calendar.setup(calendarSetupObject2);
61
+
62
  var url = '<?php echo $this->getUrl("emaildirect/admin_export/count/"); ?>';
63
 
64
  $('emaildirect_export_include_already_sent').observe('change', function(event)
100
 
101
  if (to < check_from)
102
  {
103
+ $('order_export_to').value = start_to;
104
  return false;
105
  }
106
 
121
  var to = $('order_export_to').value;
122
  var include = $('emaildirect_export_include_already_sent').value;
123
 
 
 
124
  $('orders_found').update("???");
125
 
126
  new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), {
127
  parameters : {from: from, to: to, include: include, store: store},
128
  method : 'post',
129
  loaderArea : false,
130
+ onSuccess : function(transport)
131
  {
132
  var response = eval('(' + transport.responseText + ')');
133
+ orders_count = response;
134
  $('orders_found').update(response);
135
+ setButtonState();
136
  }
137
  });
138
  }
139
 
140
+ document.observe("dom:loaded", function() {
141
+ setButtonState();
142
+ });
143
  </script>
app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/export/orders.phtml CHANGED
@@ -14,4 +14,7 @@ function perform_order_export()
14
 
15
  window.open(url);
16
  }
 
 
 
17
  </script>
14
 
15
  window.open(url);
16
  }
17
+ <?php if ($this->getElement()->getDisabled()):?>
18
+ toggleValueElements({checked:true}, $('emaildirect_export_orders').parentNode);
19
+ <?php endif;?>
20
  </script>
app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/export/products.phtml CHANGED
@@ -6,9 +6,16 @@ function perform_product_export()
6
  var form = $('config_edit_form');
7
  var include_disabled = form['groups[export][fields][include_disabled][value]'];
8
  var url = '<?php echo $this->getUrl("emaildirect/admin_export/products/"); ?>';
 
9
 
10
  url += 'include_disabled/' + $(include_disabled).getValue() + '/';
 
 
11
 
12
  window.open(url);
13
  }
 
 
 
 
14
  </script>
6
  var form = $('config_edit_form');
7
  var include_disabled = form['groups[export][fields][include_disabled][value]'];
8
  var url = '<?php echo $this->getUrl("emaildirect/admin_export/products/"); ?>';
9
+ var store = <?php echo Mage::helper('emaildirect')->getAdminStore() ?>;
10
 
11
  url += 'include_disabled/' + $(include_disabled).getValue() + '/';
12
+ if (store != 0)
13
+ url += 'store/' + store;
14
 
15
  window.open(url);
16
  }
17
+
18
+ <?php if ($this->getElement()->getDisabled()):?>
19
+ toggleValueElements({checked:true}, $('emaildirect_export_products').parentNode);
20
+ <?php endif;?>
21
  </script>
app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/info.phtml CHANGED
@@ -4,5 +4,9 @@
4
  <br />
5
  <p>Download our <a href='http://emaildirect.com/downloads/papers/magentoSetupGuide.pdf'>Magento Setup Guide</a> for detailed information on each feature.</p>
6
  <p>Please contact support (<a href='mailto:support@emaildirect.com'>support@emaildirect.com</a>) with any questions that you have.</p>
7
- <br />
8
- <hr />
 
 
 
 
4
  <br />
5
  <p>Download our <a href='http://emaildirect.com/downloads/papers/magentoSetupGuide.pdf'>Magento Setup Guide</a> for detailed information on each feature.</p>
6
  <p>Please contact support (<a href='mailto:support@emaildirect.com'>support@emaildirect.com</a>) with any questions that you have.</p>
7
+ <br />
8
+ <?php if ($this->isWebsiteConfig()): ?>
9
+ <strong>EmailDirect can only be configured at the Store or Default Level</strong>
10
+ <?php else: ?>
11
+ <hr />
12
+ <?php endif; ?>
app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/signup/test.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="<?php echo $this->getElement()->getHtmlId(); ?>" style='display:none'></div>
2
+ <button id='emaildirect_signup_test' onClick="perform_signup_test(); return false;">Test Signup</button>
3
+ <script type='text/javascript'>
4
+ function perform_signup_test()
5
+ {
6
+ var form = $('config_edit_form');
7
+ var signup_url = form['emaildirect_general_signup_url'];
8
+ var width = form['emaildirect_general_signup_width'];
9
+ var height = form['emaildirect_general_signup_height'];
10
+ var delay = form['emaildirect_general_signup_delay'];
11
+ var opacity = form['emaildirect_general_signup_opacity'];
12
+ var store = <?php echo Mage::helper('emaildirect')->getAdminStore(); ?>;
13
+ var url = '<?php echo Mage::app()->getStore(Mage::helper('emaildirect')->getAdminStore())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>';
14
+
15
+ url += '?signup_test=true&url=' + encodeURIComponent($(signup_url).getValue());
16
+ url += '&width=' + $(width).getValue();
17
+ url += '&height=' + $(height).getValue();
18
+ url += '&delay=' + $(delay).getValue();
19
+ url += '&opacity=' + $(opacity).getValue();
20
+
21
+ window.open(url);
22
+ }
23
+ <?php if ($this->getElement()->getDisabled()):?>
24
+ toggleValueElements({checked:true}, $('emaildirect_signup_test').parentNode);
25
+ <?php endif;?>
26
+ </script>
app/design/adminhtml/default/default/template/emaildirect/system/config/form/field/trouble.phtml CHANGED
@@ -2,61 +2,61 @@
2
  <?php
3
  $element = $this->getElement();
4
 
5
- $enabled = Mage::helper('emaildirect')->isLoggingEnabled();
6
  ?>
7
  <div id="<?php echo $this->getElement()->getHtmlId(); ?>" style='display:none'></div>
8
  <span class='trouble_status'>Status: <strong><?php if ($enabled) echo "Enabled"; else echo "Disabled" ?></strong></span>
9
  <button id='emaildirect_trouble' onClick="toggle_trouble();"><?php if ($enabled) echo "Disable"; else echo "Enable" ?></button>
10
  <input type='hidden' name='<?php echo $this->getElement()->getName() ?>' value='<?php echo $enabled == true ? 1 : 0 ?>'/>
11
 
 
12
  <?php if ($enabled): ?>
13
- <div id='emaildirect_trouble_details'>
14
- <table>
15
- <tr>
16
- <td>Start Date:</td>
17
- <td><?php echo $this->getStartDate() ?></td>
18
- </tr>
19
- <tr>
20
- <td>Log File:</td>
21
- <td><?php echo $this->getLogInfo() ?></td>
22
- </tr>
23
- <tr>
24
- <td>EmailDirect:</td>
25
- <td><?php echo $this->getEDirectInfo() ?></td>
26
- </tr>
27
- <tr>
28
- <td>Abandoned Carts:</td>
29
- <td><?php echo $this->getAbandonedInfo() ?></td>
30
- </tr>
31
- </table>
32
- <p>Now that Troubleshooting is enabled you need to perform the actions that are currently not sending data to EmailDirect.</p>
33
- <p>See the lists below to troubleshoot the areas you are having problems with.</p>
34
- <p>
35
- <strong>Abandoned Carts: </strong>
36
- <ul>
37
- <li>Make sure Abandoned Carts are enabled (see above).</li>
38
- <li>Abandon at least one cart in the front end of your store. You must have a logged in account for a cart to be abandoned.</li>
39
- <li>To test whether cron is working, wait at least one hour for the abandoned process to run before sending the report.</li>
40
- <li>Go to the <a href='<?php echo $this->getUrl('emaildirect/admin_abandoned/index'); ?>'>Abandoned Carts page</a> and click "Run Now" to see if it works without cron.</li>
41
- </ul>
42
- </p>
43
- <p>
44
- <strong>Orders: </strong>
45
- <ul>
46
- <li>Create at least one order and process it in the Admin until it is complete.</li>
47
- <li>To test Shipping Tracking, save a tracking number for a completed order.</li>
48
- </ul>
49
- </p>
50
- <p>
51
- <strong>Customers: </strong>
52
- <ul>
53
- <li>Add a new customer with any additional fields you have mapped.</li>
54
- <li>Update a customers information and subscription preferences.</li>
55
- </ul>
56
- </p>
57
- <button id='emaildirect_send_trouble' onClick="view_details(); return false;">View information to Send to EmailDirect</button>
58
- </div>
59
  <?php endif; ?>
 
 
60
 
61
  <script type='text/javascript'>
62
  function toggle_trouble()
@@ -76,4 +76,8 @@ function view_details()
76
 
77
  window.location = url;
78
  }
 
 
 
 
79
  </script>
2
  <?php
3
  $element = $this->getElement();
4
 
5
+ $enabled = $this->isLoggingEnabled();
6
  ?>
7
  <div id="<?php echo $this->getElement()->getHtmlId(); ?>" style='display:none'></div>
8
  <span class='trouble_status'>Status: <strong><?php if ($enabled) echo "Enabled"; else echo "Disabled" ?></strong></span>
9
  <button id='emaildirect_trouble' onClick="toggle_trouble();"><?php if ($enabled) echo "Disable"; else echo "Enable" ?></button>
10
  <input type='hidden' name='<?php echo $this->getElement()->getName() ?>' value='<?php echo $enabled == true ? 1 : 0 ?>'/>
11
 
12
+ <div id='emaildirect_trouble_details'>
13
  <?php if ($enabled): ?>
14
+ <table>
15
+ <tr>
16
+ <td>Start Date:</td>
17
+ <td><?php echo $this->getStartDate() ?></td>
18
+ </tr>
19
+ <tr>
20
+ <td>Log File:</td>
21
+ <td><?php echo $this->getLogInfo() ?></td>
22
+ </tr>
23
+ <tr>
24
+ <td>EmailDirect:</td>
25
+ <td><?php echo $this->getEDirectInfo() ?></td>
26
+ </tr>
27
+ <tr>
28
+ <td>Abandoned Carts:</td>
29
+ <td><?php echo $this->getAbandonedInfo() ?></td>
30
+ </tr>
31
+ </table>
32
+ <p>Now that Troubleshooting is enabled you need to perform the actions that are currently not sending data to EmailDirect.</p>
33
+ <p>See the lists below to troubleshoot the areas you are having problems with.</p>
34
+ <p>
35
+ <strong>Abandoned Carts: </strong>
36
+ <ul>
37
+ <li>Make sure Abandoned Carts are enabled (see above).</li>
38
+ <li>Abandon at least one cart in the front end of your store. You must have a logged in account for a cart to be abandoned.</li>
39
+ <li>To test whether cron is working, wait at least one hour for the abandoned process to run before sending the report.</li>
40
+ <li>Go to the <a href='<?php echo $this->getUrl('emaildirect/admin_abandoned/index'); ?>'>Abandoned Carts page</a> and click "Run Now" to see if it works without cron.</li>
41
+ </ul>
42
+ </p>
43
+ <p>
44
+ <strong>Orders: </strong>
45
+ <ul>
46
+ <li>Create at least one order and process it in the Admin until it is complete.</li>
47
+ <li>To test Shipping Tracking, save a tracking number for a completed order.</li>
48
+ </ul>
49
+ </p>
50
+ <p>
51
+ <strong>Customers: </strong>
52
+ <ul>
53
+ <li>Add a new customer with any additional fields you have mapped.</li>
54
+ <li>Update a customers information and subscription preferences.</li>
55
+ </ul>
56
+ </p>
 
 
 
57
  <?php endif; ?>
58
+ <button id='emaildirect_send_trouble' onClick="view_details(); return false;">View information to Send to EmailDirect</button>
59
+ </div>
60
 
61
  <script type='text/javascript'>
62
  function toggle_trouble()
76
 
77
  window.location = url;
78
  }
79
+
80
+ <?php if ($this->getElement()->getDisabled()):?>
81
+ toggleValueElements({checked:true}, $('emaildirect_trouble').parentNode);
82
+ <?php endif;?>
83
  </script>
app/design/adminhtml/default/default/template/emaildirect/system/convert/profile/export.phtml CHANGED
@@ -1,4 +1,5 @@
1
-
 
2
  <style type="text/css" >
3
  ul { list-style-type:none; padding:0; margin:0; }
4
  li { margin-left:0; border:1px solid #ccc; margin:2px; padding:2px 2px 2px 2px; font:normal 13px sans-serif; }
@@ -12,14 +13,19 @@
12
  <li>
13
  <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif')?>" class="v-middle" style="margin-right:5px"/>
14
  <?php echo $this->__("Starting EmailDirect Export...");?>
15
- </li>
16
- <li style="background-color:#FFD;">
17
  <img src="<?php echo $this->getSkinUrl('images/fam_bullet_error.gif');?>" class="v-middle" style="margin-right:5px"/>
18
- <?php echo $this->__("Warning: Please do not close the window during export process!");?>
 
 
 
 
 
19
  </li>
20
  </ul>
21
  <ul id="profileRows">
22
- <li id="liFinished" style="display:none;">
23
  <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif');?>" class="v-middle" style="margin-right:5px"/>
24
  <?php echo $this->__("Finished Export!.");?>
25
  <span id='download_link'>
@@ -27,8 +33,6 @@
27
  </span>
28
  </li>
29
  </ul>
30
- <?php $this->getBatchModel() ?>
31
- <?php $importData = $this->getImportData();?>
32
  <script type="text/javascript">
33
  var d = new Date();
34
  var countOfStartedProfiles = 0;
@@ -212,5 +216,6 @@ function addProfileRow(data)
212
  </script>
213
 
214
  <script type="text/javascript">
215
- execImportData();
 
216
  </script>
1
+ <?php $this->getBatchModel() ?>
2
+ <?php $importData = $this->getImportData();?>
3
  <style type="text/css" >
4
  ul { list-style-type:none; padding:0; margin:0; }
5
  li { margin-left:0; border:1px solid #ccc; margin:2px; padding:2px 2px 2px 2px; font:normal 13px sans-serif; }
13
  <li>
14
  <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif')?>" class="v-middle" style="margin-right:5px"/>
15
  <?php echo $this->__("Starting EmailDirect Export...");?>
16
+ </li>
17
+ <li style="background-color:#FFD;">
18
  <img src="<?php echo $this->getSkinUrl('images/fam_bullet_error.gif');?>" class="v-middle" style="margin-right:5px"/>
19
+ <?php
20
+ if (count($importData) == 0)
21
+ echo $this->__("No items found to export!");
22
+ else
23
+ echo $this->__("Warning: Please do not close the window during export process!");
24
+ ?>
25
  </li>
26
  </ul>
27
  <ul id="profileRows">
28
+ <li id="liFinished" style="display: <?php if (count($importData) == 0) echo 'block'; else echo 'none' ?>;">
29
  <img src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif');?>" class="v-middle" style="margin-right:5px"/>
30
  <?php echo $this->__("Finished Export!.");?>
31
  <span id='download_link'>
33
  </span>
34
  </li>
35
  </ul>
 
 
36
  <script type="text/javascript">
37
  var d = new Date();
38
  var countOfStartedProfiles = 0;
216
  </script>
217
 
218
  <script type="text/javascript">
219
+ if (totalRecords > 0)
220
+ execImportData();
221
  </script>
app/design/adminhtml/default/default/template/emaildirect/troubleshooting/view/tab/download.phtml CHANGED
@@ -9,5 +9,4 @@
9
  <button onclick="setLocation('<?php echo $this->getUrl('emaildirect/admin_troubleshooting/download/') ?>'); return false;">Download Report</button>
10
  </div>
11
  </div>
12
- </div>
13
-
9
  <button onclick="setLocation('<?php echo $this->getUrl('emaildirect/admin_troubleshooting/download/') ?>'); return false;">Download Report</button>
10
  </div>
11
  </div>
12
+ </div>
 
app/design/frontend/base/default/layout/emaildirect.xml CHANGED
@@ -1,12 +1,23 @@
1
  <?xml version="1.0"?>
2
 
3
  <layout version="0.1.0">
 
 
 
 
 
 
 
 
 
 
 
4
  <checkout_onepage_review>
5
  <reference name="checkout.onepage.review.info.items.after">
6
  <block type="emaildirect/checkout_subscribe" name="emaildirect.subscribe" template="emaildirect/checkout/subscribe.phtml" />
7
  </reference>
8
  </checkout_onepage_review>
9
-
10
  <!-- Customer -->
11
  <customer_account>
12
  <reference name="head">
@@ -28,7 +39,7 @@
28
  <template>emaildirect/customer/account/dashboard/info.phtml</template>
29
  </action>
30
  </block>
31
- </reference>
32
  </reference>
33
  </customer_account_index>
34
 
1
  <?xml version="1.0"?>
2
 
3
  <layout version="0.1.0">
4
+
5
+ <default>
6
+ <reference name="before_body_end">
7
+ <block type="emaildirect/signup" name="emaildirect_signup" as="emaildirect_signup" template="emaildirect/signup/form.phtml"/>
8
+ <block type="emaildirect/capture" name="emaildirect_capture" as="emaildirect_capture" template="emaildirect/capture/email.phtml"/>
9
+ </reference>
10
+ <reference name="head">
11
+ <action method="addCss"><stylesheet>emaildirect/emaildirect.css</stylesheet></action>
12
+ </reference>
13
+ </default>
14
+
15
  <checkout_onepage_review>
16
  <reference name="checkout.onepage.review.info.items.after">
17
  <block type="emaildirect/checkout_subscribe" name="emaildirect.subscribe" template="emaildirect/checkout/subscribe.phtml" />
18
  </reference>
19
  </checkout_onepage_review>
20
+
21
  <!-- Customer -->
22
  <customer_account>
23
  <reference name="head">
39
  <template>emaildirect/customer/account/dashboard/info.phtml</template>
40
  </action>
41
  </block>
42
+ </reference>
43
  </reference>
44
  </customer_account_index>
45
 
app/design/frontend/base/default/template/emaildirect/capture/email.phtml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type='text/javascript'>
2
+ document.observe("dom:loaded", function()
3
+ {
4
+ <?php foreach ($this->getFields() as $field): ?>
5
+ if ($('<?php echo $field ?>')) Event.observe('<?php echo $field ?>','change', capture);
6
+ <?php endforeach; ?>
7
+ });
8
+
9
+ function capture(event)
10
+ {
11
+ new Ajax.Request('<?php echo $this->getUrl('emaildirect/capture') ?>', { method:'post', parameters: {email: $(this).getValue()} });
12
+ }
13
+ </script>
app/design/frontend/base/default/template/emaildirect/email/order/items.phtml DELETED
@@ -1,23 +0,0 @@
1
- <?php $_quote = $this->getQuote() ?>
2
- <table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
3
- <thead>
4
- <tr>
5
- <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Item') ?></th>
6
- <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
7
- <th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Qty') ?></th>
8
- <th align="right" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Subtotal') ?></th>
9
- </tr>
10
- </thead>
11
-
12
- <?php $i=0; foreach ($_quote->getAllItems() as $_item): ?>
13
- <?php if($_item->getParentItem()) continue; else $i++; ?>
14
- <tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
15
- <?php echo $this->getItemHtml($_item) ?>
16
- </tbody>
17
- <?php endforeach; ?>
18
-
19
- <tbody>
20
- <?php //echo $this->getChildHtml('order_totals') ?>
21
- </tbody>
22
- </table>
23
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/emaildirect/email/order/items/order/default.phtml DELETED
@@ -1,111 +0,0 @@
1
- <?php $_item = $this->getItem() ?>
2
- <?php $_quote = $this->getItem()->getQuote() ?>
3
- <tr>
4
- <td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;">
5
- <strong style="font-size:11px;"><?php echo $this->htmlEscape($_item->getName()) ?></strong>
6
- <?php if ($this->getItemOptions()): ?>
7
- <dl style="margin:0; padding:0;">
8
- <?php foreach ($this->getItemOptions() as $option): ?>
9
- <dt><strong><em><?php echo $option['label'] ?></em></strong></dt>
10
- <dd style="margin:0; padding:0 0 0 9px;">
11
- <?php echo nl2br($this->escapeHtml($option['value'])) ?>
12
- </dd>
13
- <?php endforeach; ?>
14
- </dl>
15
- <?php endif; ?>
16
- <?php $addInfoBlock = $this->getProductAdditionalInformationBlock(); ?>
17
- <?php if ($addInfoBlock) :?>
18
- <?php echo $addInfoBlock->setItem($_item)->toHtml(); ?>
19
- <?php endif; ?>
20
- <?php echo $this->escapeHtml($_item->getDescription()) ?>
21
- </td>
22
- <td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;"><?php echo $this->htmlEscape($this->getSku($_item)) ?></td>
23
- <td align="center" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;"><?php echo $_item->getQtyOrdered()*1 ?></td>
24
- <td align="right" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;">
25
- <?php if ($this->helper('tax')->displaySalesPriceExclTax($_quote->getStoreId()) || $this->helper('tax')->displaySalesBothPrices($_quote->getStore())): ?>
26
- <?php if ($this->helper('tax')->displaySalesBothPrices($_quote->getStoreId())): ?>
27
- <span class="label"><?php echo Mage::helper('tax')->__('Excl. Tax'); ?>:</span>
28
- <?php endif; ?>
29
- <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_quote->getStore())): ?>
30
- <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
31
- <?php //echo $_quote->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
32
- <?php else: ?>
33
- <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($_item->getRowTotal()) ?>
34
- <?php endif; ?>
35
-
36
-
37
- <?php if (Mage::helper('weee')->getApplied($_item)): ?>
38
- <br />
39
- <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_quote->getStore())): ?>
40
- <small>
41
- <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
42
- <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($tax['row_amount'],true,true); ?></span><br />
43
- <?php endforeach; ?>
44
- </small>
45
- <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_quote->getStoreId())): ?>
46
- <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
47
- <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
48
- <?php endforeach; ?>
49
- <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_quote->getStoreId())): ?>
50
- <small>
51
- <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
52
- <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($tax['row_amount_incl_tax'],true,true); ?></span><br />
53
- <?php endforeach; ?>
54
- </small>
55
- <?php endif; ?>
56
-
57
- <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_quote->getStore())): ?>
58
- <br />
59
- <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
60
- <?php endif; ?>
61
- <?php endif; ?>
62
- <?php endif; ?>
63
-
64
-
65
- <?php if ($this->helper('tax')->displaySalesPriceInclTax($_quote->getStoreId()) || $this->helper('tax')->displaySalesBothPrices($_quote->getStoreId())): ?>
66
- <?php if ($this->helper('tax')->displaySalesBothPrices($_quote->getStoreId())): ?>
67
- <br /><span class="label"><?php echo Mage::helper('tax')->__('Incl. Tax'); ?>:</span>
68
- <?php endif; ?>
69
- <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
70
- <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'email', $_quote->getStoreId())): ?>
71
- <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
72
- <?php else: ?>
73
- <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($_incl-$_item->getWeeeTaxRowDisposition()) ?>
74
- <?php endif; ?>
75
- <?php if (Mage::helper('weee')->getApplied($_item)): ?>
76
- <br />
77
- <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'email', $_quote->getStore())): ?>
78
- <small>
79
- <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
80
- <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($tax['row_amount'],true,true); ?></span><br />
81
- <?php endforeach; ?>
82
- </small>
83
- <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_quote->getStoreId())): ?>
84
- <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
85
- <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
86
- <?php endforeach; ?>
87
- <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'email', $_quote->getStoreId())): ?>
88
- <small>
89
- <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
90
- <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($tax['row_amount_incl_tax'],true,true); ?></span><br />
91
- <?php endforeach; ?>
92
- </small>
93
- <?php endif; ?>
94
-
95
- <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'email', $_quote->getStoreId())): ?>
96
- <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo Mage::app()->getLocale()->currency($_quote->getQuoteCurrencyCode())->toCurrency($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
97
- <?php endif; ?>
98
- <?php endif; ?>
99
- <?php endif; ?>
100
- </td>
101
- </tr>
102
- <?php if ($_item->getGiftMessageId() && $_giftMessage = $this->helper('giftmessage/message')->getGiftMessage($_item->getGiftMessageId())): ?>
103
- <tr>
104
- <td colspan="4" style=" border-bottom:2px solid #CCCCCC; padding:3px 9px;">
105
- <strong style="color:#444444; font-size:11px;"><?php echo $this->__('Gift Message') ?></strong>
106
- <?php echo $this->__('From:'); ?> <?php echo $this->htmlEscape($_giftMessage->getSender()) ?><br />
107
- <?php echo $this->__('To:'); ?> <?php echo $this->htmlEscape($_giftMessage->getRecipient()) ?><br />
108
- <strong><?php echo $this->__('Message:'); ?></strong><br /><?php echo $this->htmlEscape($_giftMessage->getMessage()) ?>
109
- </td>
110
- </tr>
111
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/emaildirect/signup/form.phtml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="emaildirect_signup_background" style='display:none;opacity: <?php echo $this->getSignupOpacity(); ?>%;filter:alpha(opacity=<?php echo $this->getSignupOpacity(); ?>);background-color: rgba(0,0,0,0.<?php echo $this->getSignupOpacity(); ?>);'>
2
+ <div id="emaildirect_signup" style='width: <?php echo $this->getSignupWidth() ?>; height: <?php echo $this->getSignupHeight(); ?>;'>
3
+ <a id='emaildirect_signup_close' href="#" onclick='return closeSignup();'></a>
4
+ <iframe src='<?php echo $this->getSignupUrl() ?>' id='ed_form' style='width: <?php echo $this->getSignupFrameWidth() ?>; height: <?php echo $this->getSignupFrameHeight(); ?>;'></iframe>
5
+ </div>
6
+ </div>
7
+ <script type='text/javascript'>
8
+
9
+ function showSignup()
10
+ {
11
+ $$('body')[0].addClassName('emaildirect_signup_open');
12
+ $('emaildirect_signup_background').show();
13
+ }
14
+
15
+ function closeSignup()
16
+ {
17
+ $$('body')[0].removeClassName('emaildirect_signup_open');
18
+ $('emaildirect_signup_background').hide();
19
+
20
+ <?php if (!$this->isSignupTest()): ?>
21
+ var CookieDate = new Date;
22
+
23
+ var CurrentDate = Math.round(+new Date()/1000);
24
+ CookieDate.setFullYear(CookieDate.getFullYear( ) + 5);
25
+ Mage.Cookies.set('ed_signup', CurrentDate, CookieDate);
26
+ <?php endif; ?>
27
+
28
+ return false;
29
+ }
30
+
31
+ document.observe("dom:loaded", function() {
32
+ window.setTimeout("showSignup()",<?php echo $this->getSignupDelay(); ?>);
33
+ });
34
+ </script>
app/etc/modules/EmailDirect_Integration.xml CHANGED
@@ -2,10 +2,10 @@
2
  <modules>
3
  <EmailDirect_Integration>
4
  <active>true</active>
5
- <codePool>local</codePool>
6
  <depends>
7
- <Mage_Newsletter />
8
- </depends>
9
  </EmailDirect_Integration>
10
  </modules>
11
  </config>
2
  <modules>
3
  <EmailDirect_Integration>
4
  <active>true</active>
5
+ <codePool>community</codePool>
6
  <depends>
7
+ <Mage_Newsletter />
8
+ </depends>
9
  </EmailDirect_Integration>
10
  </modules>
11
  </config>
package.xml CHANGED
@@ -1,22 +1,28 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>EmailDirect_Integration</name>
4
- <version>1.5.8</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>Troubleshooting is upgraded to automatically turn off after 10 minutes.&#xD;
12
  &#xD;
13
- Required database fields are checked each time you visit the Configuration Page.&#xD;
14
  &#xD;
15
- Database Fields that are missing may be fixed manually or through the extension.</notes>
 
 
 
 
 
 
16
  <authors><author><name>Kevin Linden</name><user>auto-converted</user><email>Kevin@EmailDirect.com</email></author></authors>
17
- <date>2013-11-25</date>
18
- <time>18:27:46</time>
19
- <contents><target name="magelocal"><dir name="EmailDirect"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Abandoned"><file name="Grid.php" hash="5534349906e67bfd67547ccd3753f184"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="6b1801b68da53b77a205e4b2e1900119"/></dir><dir name="Form"><dir name="Field"><dir name="Export"><file name="Orders.php" hash="ddcfc1c3c579421bc5c8af9173d1cbf2"/><file name="Products.php" hash="0c6a9936ccc806b9e3ddf573d1df1e53"/><file name="Range.php" hash="b29f2227412e1f4fe9ba4c2e6e3b615d"/></dir><file name="Addressmapfields.php" hash="97b75c8340d561e863a3985ad73ce228"/><file name="Common.php" hash="e597ff375c4b46b92d6aa35646e3d8c9"/><file name="Info.php" hash="0fa5f6e12e48708ac1ce6022db1ad2d5"/><file name="Mapfields.php" hash="677ebfd526fba11a1c177c00ae085526"/><file name="Note.php" hash="ef99a474bbc3a828c7a618132a80fe66"/><file name="Shippingmapfields.php" hash="589a74260f394a5eae1b57ca89a74a8b"/><file name="Troubleshooting.php" hash="0b0b0fffd3251a13e0550740df784cb3"/></dir></dir><file name="Account.php" hash="60fa8e43a87e1f2ff71c319c979556b2"/></dir><dir name="Convert"><dir name="Profile"><dir name="Export"><file name="Orders.php" hash="eb9be61e0accdfaf3a2f315eb5eaae5b"/><file name="Products.php" hash="a58d1d192ef82fd6ce032db7455b11b8"/></dir><file name="Export.php" hash="0ac2fa1fefcd4c4a238417175350ad6c"/></dir></dir></dir><dir name="Troubleshooting"><dir name="View"><dir name="Tab"><file name="Download.php" hash="9315a364a46f9e39972bbd0a47152e90"/><file name="Info.php" hash="6714b756a3fa7a5812356e544fe48f1b"/><file name="Log.php" hash="7c3661722d1197cd8a564f76275353c7"/><file name="Submit.php" hash="8831d886858fde08a4323eea66ec76d2"/></dir><file name="Form.php" hash="e527a3a2335b109c48a69f06c1b0d01f"/></dir><file name="Tabs.php" hash="ab1fdbe561e8572c2c50cdbec9573f82"/><file name="View.php" hash="b85696126e6874b0f5a19d0af6183add"/></dir><file name="Abandoned.php" hash="f3be80231c0ed811acd1d63d269394c5"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="ae325e815a54bde93507562cf0d86b8a"/></dir><dir name="Customer"><dir name="Account"><dir name="Dashboard"><file name="Info.php" hash="20e74d9c2b2c02611c8f69b254d81ef5"/></dir><file name="Lists.php" hash="3c3bdb9482ecf4a71740a80395bd5465"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="AbandonedMinutes.php" hash="22e33be85dc8348fce9b49637ead919d"/><file name="Action.php" hash="b85ef0454ab5c65ef0c43c7ef057ecc2"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7d7a6dc9571c653d6031110fb399927b"/><file name="Fields.php" hash="1275a766d979e1ac3efabbf168ac92f5"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Export"><file name="Batch.php" hash="96c51fc5c0b947750be4e612e32c83ab"/></dir><file name="Abandonedlist.php" hash="66386003113d8589c9f3de4f03f538a8"/><file name="Additionallist.php" hash="254081820d07a8754a71743ea58a7af4"/><file name="Checkoutsubscribe.php" hash="fd90252a1f19649a420dae136ad2a2ba"/><file name="List.php" hash="d76e36c0198e509a63c663e827cc7940"/><file name="Publication.php" hash="635fae1c20981c0ca7b90007a00e99a7"/><file name="Sequence.php" hash="ec9718c2b5dc35c559e5c09e345eff88"/><file name="Source.php" hash="f3c246959c74f6d378f3e2d7b8148d7f"/><file name="States.php" hash="82682b97d671eb616649dfc52e202100"/><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="5a339e0a5407cf05b161102fc65595bb"/><file name="Ftp.php" hash="d5335cfb68f99761d6902dd390a3d7a8"/><file name="Lists.php" hash="dff74c445f6a9582b35bb24560582c2b"/><file name="Orders.php" hash="81dbf1045688e932fa6175784c2bf0cb"/><file name="Publications.php" hash="815715549df345ccb5b69ed65589aa53"/><file name="Sources.php" hash="c6caf0274f7d0c50114324bc47a490c4"/><file name="Subscribers.php" hash="064e07d8f2015cf56f7e82844f5df54c"/></dir><file name="Observer.php" hash="0dbb2f0c5bad28b039eb3435425b242f"/></dir><dir name="controllers"><dir name="Admin"><file name="AbandonedController.php" hash="d7cb59c88fcf80737be0ccdad7f4b7d7"/><file name="ExportController.php" hash="f9ceaa6b2fd25c5c283b01dbf182c27e"/><file name="OrderExportController.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="TroubleshootingController.php" hash="806f96d4bd8a70eca4c218ed0ff48fd6"/></dir><dir name="Customer"><file name="AccountController.php" hash="16bfdb6de4804a5d71cb972afbff4537"/></dir><file name="AbandonedController.php" hash="86cb0979c6ea5322bccc33f8600a6f4b"/><file name="ExportController.php" hash="7ca147debc5c1436b3bf2d9501592f33"/></dir><dir name="etc"><file name="adminhtml.xml" hash="896c10d8a3f932346e7d301052b1b6a6"/><file name="config.xml" hash="fdfc45d04ff2e193bf86fb81d480f5c3"/><file name="system.xml" hash="be553328cfdffa5bea0a5d3c5516f4a8"/></dir><dir name="sql"><dir name="emaildirect_setup"><file name="mysql4-install-1.0.0.php" hash="9dc51edb346e9676735e15d3e78fa3eb"/><file name="mysql4-upgrade-1.0.13-1.0.14.php" hash="c42e2677b3960a049d7137b622552084"/><file name="mysql4-upgrade-1.0.19-1.2.0.php" hash="742be042b7f56e7ff2002b0606270ca6"/><file name="mysql4-upgrade-1.5.4-1.5.5.php" hash="560244d63a037f88201a61d7f7482d2c"/></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="2dab687df0c54506ecddc6a34082f2bf"/><file name="emaildirect.js" hash="ce03dd6f51ea529fc4acdc5116f4e030"/><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="bkg_block-title.gif" hash="f8c1f130ad69464fe7aff2f589b2ec75"/><file name="dotted_divider.gif" hash="260ebae91ffb1b7c663906b29a069925"/><file name="emaildirect-tile.png" hash="86a0ed36169ab9691480fc995ab674a8"/><file name="i_block-subscribe.gif" hash="9e5fee06a543742045118a95f2debcb8"/></dir><file name="integration.js" hash="d8c8d5bf0ddb4f6ead23bec8a2814475"/></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="79a7de2366bfcef2df54ffb104de176f"/></dir><dir name="template"><dir name="emaildirect"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="d1cf4d176a7adf4dcb1b3186b70b19d3"/></dir><dir name="form"><dir name="field"><dir name="export"><file name="date_range.phtml" hash="0061fbfbfdba23ce3c4d98e66184c3a2"/><file name="orders.phtml" hash="e8006492a9048c117f2a0a95ed3bf717"/><file name="products.phtml" hash="99b88859146f490f87690cd44cabc999"/></dir><file name="array.phtml" hash="5415eeff311735624354468c886d39b5"/><file name="info.phtml" hash="a11383dd825b695f2fcba0b86f88f94f"/><file name="note.phtml" hash="6625a3771ba10daba5ded5570574716f"/><file name="trouble.phtml" hash="86d486f6c53e8ffae2016a88225223fb"/></dir></dir><file name="setup_check.phtml" hash="1814302f58a15fb1629446e074a7e1e0"/></dir><dir name="convert"><dir name="profile"><file name="export.phtml" hash="9be5cdbc2e46b9fa65950b5d6558dca5"/></dir></dir></dir><dir name="troubleshooting"><dir name="view"><dir name="tab"><file name="download.phtml" hash="78ec34fd9c3c8b660b19f9e799d8e76e"/><file name="info.phtml" hash="bd19bb1072ce1d60a4fb7bda660a0ce7"/><file name="log.phtml" hash="c9e2c9493a2dad579bba4ed53795cf5e"/><file name="submit.phtml" hash="c2269f4a6a52d66bff5eac660d0831bd"/></dir><file name="form.phtml" hash="d2338bfe3598e9315ca8f5ac8d9b5516"/></dir><file name="view.phtml" hash="ee6af3fe79d916af764f41e7e8c5cc37"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="9803fe9024b7eb6415713d81fe27c629"/></dir><dir name="template"><dir name="emaildirect"><dir name="checkout"><file name="subscribe.phtml" hash="351ea790305f0a3ec99c34180bbee235"/></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="4256a03d67ec2a6f97867a87564cff92"/></dir><file name="lists.phtml" hash="4c697dcfa63ece1db7885cadb02982d1"/></dir></dir><dir name="email"><dir name="order"><dir name="items"><dir name="order"><file name="default.phtml" hash="2d65f3d02b9baa08969d68f2a2cca348"/></dir></dir><file name="items.phtml" hash="e6b15e6460010c5acae66017d177bfb9"/></dir></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="2d2666e6d9cd8d40a4974d5e242721d6"/></dir></target></contents>
20
  <compatible/>
21
  <dependencies/>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>EmailDirect_Integration</name>
4
+ <version>2.0.0</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>Moved code from local to community folder and using EmailDirect only tables to store data &#xD;
12
  &#xD;
13
+ Popup/Modal for visitors using an EmailDirect Signup Form (customizable)&#xD;
14
  &#xD;
15
+ Email Capture for guest accounts who abandon their cart&#xD;
16
+ &#xD;
17
+ Updated Abandoned Cart page with more options for multiple stores&#xD;
18
+ &#xD;
19
+ Added ability to use order state or status to determine when to send order&#xD;
20
+ &#xD;
21
+ Orders can now be processed in batches through a cron process</notes>
22
  <authors><author><name>Kevin Linden</name><user>auto-converted</user><email>Kevin@EmailDirect.com</email></author></authors>
23
+ <date>2014-03-12</date>
24
+ <time>06:00:26</time>
25
+ <contents><target name="magecommunity"><dir name="EmailDirect"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Abandoned"><file name="Grid.php" hash="4a3f8d29d3d8feb13ae124297267ae85"/><file name="Status.php" hash="9a740fd8c63148532bbcf07d19f462df"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="d01c241e1c4a42cd08f087ad784ed78e"/></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="Common.php" hash="6a86cce53f6df6857ea79241fa281939"/><file name="Info.php" hash="246de52ea5d2349ecd7f103cbba8cb8f"/><file name="Mapfields.php" hash="16894c5d76df1293e63128e349700e05"/><file name="Note.php" hash="ef99a474bbc3a828c7a618132a80fe66"/><file name="Shippingmapfields.php" hash="589a74260f394a5eae1b57ca89a74a8b"/><file name="Troubleshooting.php" hash="ff6b463004ab037031acea4a6f1d8517"/></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="Info.php" hash="4dad4b18e215d6df8c8e6631b4323b53"/><file name="Log.php" hash="d3dcb67ca284358eaa70db517637da87"/><file name="Submit.php" hash="fe896683680ab10ada6b67e0e803ccce"/></dir><file name="Form.php" hash="e527a3a2335b109c48a69f06c1b0d01f"/></dir><file name="Tabs.php" hash="ab1fdbe561e8572c2c50cdbec9573f82"/><file name="View.php" hash="b2d83536aade45e41039875db85b3018"/></dir><file name="Abandoned.php" hash="515b0c172e093341a2e69cb75570e553"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="ae325e815a54bde93507562cf0d86b8a"/></dir><dir name="Customer"><dir name="Account"><dir name="Dashboard"><file name="Info.php" hash="20e74d9c2b2c02611c8f69b254d81ef5"/></dir><file name="Lists.php" hash="3c3bdb9482ecf4a71740a80395bd5465"/></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="b005beb856451f49178f2a6914fd5ae7"/><file name="Signup.php" hash="511c9376560cdc5f63b7dc00bdc205be"/></dir><dir name="Helper"><file name="Data.php" hash="62c80f136049c64cf970ae304fec29db"/><file name="Fields.php" hash="1275a766d979e1ac3efabbf168ac92f5"/><file name="Upgrade.php" hash="407f12bce2c7c06c73a23d8ed853a038"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Abandoned"><file name="Collection.php" hash="5a64b4e8b672f80b4d9b6cc5a0d231eb"/></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="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="66386003113d8589c9f3de4f03f538a8"/><file name="Additionallist.php" hash="254081820d07a8754a71743ea58a7af4"/><file name="Checkoutsubscribe.php" hash="fd90252a1f19649a420dae136ad2a2ba"/><file name="List.php" hash="d76e36c0198e509a63c663e827cc7940"/><file name="Publication.php" hash="635fae1c20981c0ca7b90007a00e99a7"/><file name="Sequence.php" hash="ec9718c2b5dc35c559e5c09e345eff88"/><file name="Source.php" hash="f3c246959c74f6d378f3e2d7b8148d7f"/><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="5a339e0a5407cf05b161102fc65595bb"/><file name="Ftp.php" hash="d5335cfb68f99761d6902dd390a3d7a8"/><file name="Lists.php" hash="425d64b9256bbdbafa899c4138e78368"/><file name="Orders.php" hash="15db3242ec0cbb8db6a4a6fe6b7ebc84"/><file name="Publications.php" hash="815715549df345ccb5b69ed65589aa53"/><file name="Sources.php" hash="c6caf0274f7d0c50114324bc47a490c4"/><file name="Subscribers.php" hash="21685e41160410b333ac9992ae4fff9d"/></dir><file name="Abandoned.php" hash="93bd43b59b143dec15858a6fba6ae568"/><file name="Observer.php" hash="a22d3137553b5347a0a2167d0207b172"/><file name="Order.php" hash="b21426543cd46f799cd0743525120fb8"/><file name="Session.php" hash="c56ecf779dbfb2dae0030935af31911a"/></dir><dir name="controllers"><dir name="Admin"><file name="AbandonedController.php" hash="2f8a01bad5237d9197dc473db4559364"/><file name="ExportController.php" hash="c53499b00fd806eadec5093b0b99aefe"/><file name="TroubleshootingController.php" hash="3de9950849e08648d8872aea4760c992"/></dir><dir name="Customer"><file name="AccountController.php" hash="ae75c37519f8d9f671509ff9b7fb34a4"/></dir><file name="AbandonedController.php" hash="5a0a85563b15408de91bcdf6263104ca"/><file name="CaptureController.php" hash="89e043bb3864617a062e915d2209dcf4"/><file name="ExportController.php" hash="7ca147debc5c1436b3bf2d9501592f33"/></dir><dir name="etc"><file name="adminhtml.xml" hash="26c4aa6d38306846a585166d6602b305"/><file name="config.xml" hash="13bf41cab9f3db328a5bc5f1e71d1d7b"/><file name="system.xml" hash="115ba31309c00a99a924dc2862ac23f0"/></dir><dir name="sql"><dir name="emaildirect_setup"><file name="mysql4-install-2.0.0.php" hash="2ab06feda5e6ee37e8e5006921852f8f"/><file name="mysql4-upgrade-1.5.8-2.0.0.php" hash="20b98743a4ac747d90fec22ff4fbbe10"/></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="cba2c50e351f973a2463e92a91ec5569"/><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="5b2c8907468d0d5d013e30c6c5c8c9ed"/><file name="integration.js" hash="72ffc0716bc87ac2c92ba47784b5d33b"/></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="9eb6f438b54472e217a9f8e99a8e117c"/></dir><dir name="template"><dir name="emaildirect"><dir name="abandoned"><file name="grid.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="status.phtml" hash="9e7723dc1fe5f8693345db9cc7cda808"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="c71edf8e0e270b4922020c0b010cc4c3"/></dir><dir name="form"><dir name="field"><dir name="export"><file name="date_range.phtml" hash="d2a91e7ba256fed67745ef1c284889cb"/><file name="orders.phtml" hash="7cc302d6bd638c111ca769ce2d23a1e1"/><file name="products.phtml" hash="b3e91d0fb47f26a3cc989f73f25a1e34"/></dir><dir name="signup"><file name="test.phtml" hash="636501cd90c6ab4231bea54efb16b2ff"/></dir><file name="array.phtml" hash="5415eeff311735624354468c886d39b5"/><file name="info.phtml" hash="19921a9ba4d9abd065ba7ab62e9946ce"/><file name="note.phtml" hash="6625a3771ba10daba5ded5570574716f"/><file name="trouble.phtml" hash="a6cbebe7956299a64c2f5ceab0c28651"/></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="41dc4cc22f7a1c6fc9048bf936fb7953"/><file name="info.phtml" hash="bd19bb1072ce1d60a4fb7bda660a0ce7"/><file name="log.phtml" hash="c9e2c9493a2dad579bba4ed53795cf5e"/><file name="submit.phtml" hash="c2269f4a6a52d66bff5eac660d0831bd"/></dir><file name="form.phtml" hash="d2338bfe3598e9315ca8f5ac8d9b5516"/></dir><file name="view.phtml" hash="ee6af3fe79d916af764f41e7e8c5cc37"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="a2541c4b82ef33c791794344893c0f2d"/></dir><dir name="template"><dir name="emaildirect"><dir name="capture"><file name="email.phtml" hash="564c6130cd5f03bcff2ac8580e17bd2a"/></dir><dir name="checkout"><file name="subscribe.phtml" hash="351ea790305f0a3ec99c34180bbee235"/></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="4256a03d67ec2a6f97867a87564cff92"/></dir><file name="lists.phtml" hash="4c697dcfa63ece1db7885cadb02982d1"/></dir></dir><dir name="signup"><file name="form.phtml" hash="4c7633e518f3374f722ccf22b51158da"/></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>
26
  <compatible/>
27
  <dependencies/>
28
  </package>
skin/adminhtml/default/default/emaildirect/emaildirect.css CHANGED
@@ -60,4 +60,8 @@ table.missing_columns { background-color: white; color: black; margin: 10px; bor
60
  table.missing_columns tr td, table.missing_columns tr th { border: solid 1px black; border-collapse: collapse; padding: 4px 10px;}
61
  table.missing_columns tr th { font-weight: bold; color: red; }
62
 
63
- #emaildirect_column_fix { margin-left: 15px; }
 
 
 
 
60
  table.missing_columns tr td, table.missing_columns tr th { border: solid 1px black; border-collapse: collapse; padding: 4px 10px;}
61
  table.missing_columns tr th { font-weight: bold; color: red; }
62
 
63
+ #emaildirect_column_fix { margin-left: 15px; }
64
+
65
+ .abandoned_status tr td { padding-right: 10px; }
66
+
67
+ .head-adminhtml-abandoned { background-image: url("../images/fam_cart.gif"); }
skin/adminhtml/default/default/emaildirect/emaildirect.js DELETED
@@ -1 +0,0 @@
1
- //Place EmailDirect Javascript here
 
skin/frontend/base/default/emaildirect/emaildirect.css ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body.emaildirect_signup_open { overflow: hidden; }
2
+
3
+ #emaildirect_signup_background {
4
+ background-color: black;
5
+ width: 100%;
6
+ min-height: 100%;
7
+ overflow: hidden;
8
+ float: absolute;
9
+ position: fixed;
10
+ z-index: 10000;
11
+ top: 0;
12
+ left: 0;
13
+ color: white;
14
+ }
15
+
16
+ #emaildirect_signup {
17
+ background-color: white;
18
+ color: black;
19
+ font-size: 16px;
20
+ border: 1px solid gray;
21
+ padding: 20px;
22
+ display:block;
23
+ margin: auto;
24
+ width: auto;
25
+ position: absolute;
26
+ top: 0; left: 0; bottom: 0; right: 0;
27
+ border-radius: 15px;
28
+ }
29
+
30
+ #emaildirect_signup iframe
31
+ {
32
+ border: none;
33
+ }
34
+
35
+ #emaildirect_signup_close {
36
+ background: url(images/window_close.png);
37
+ cursor: pointer;
38
+ float: right;
39
+ position: absolute;
40
+ top: 5px;
41
+ right: 5px;
42
+ width: 16px;
43
+ height: 16px;
44
+ }
skin/frontend/base/default/emaildirect/images/bkg_block-title.gif DELETED
Binary file
skin/frontend/base/default/emaildirect/images/dotted_divider.gif DELETED
Binary file
skin/frontend/base/default/emaildirect/images/emaildirect-tile.png DELETED
Binary file
skin/frontend/base/default/emaildirect/images/i_block-subscribe.gif DELETED
Binary file
skin/frontend/base/default/emaildirect/images/window_close.png ADDED
Binary file
skin/frontend/base/default/emaildirect/integration.js CHANGED
@@ -17,4 +17,4 @@ document.observe("dom:loaded", function() {
17
  }
18
  }
19
 
20
- });
17
  }
18
  }
19
 
20
+ });