Version Notes
We improved performance on synchronization.
It should be more efficient and nearly instant on most websites.
Download this release
Release Info
Developer | Sarbacane Software |
Extension | Sarbacane_Mailify |
Version | 1.0.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.0.0.6 to 1.0.0.7
app/code/community/Sarbacane/Mailify/controllers/IndexController.php
CHANGED
@@ -25,8 +25,8 @@ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Actio
|
|
25 |
$sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
|
26 |
$rq_sql = 'DELETE FROM `' . $sarbacanedesktop_users . '` WHERE sd_type=\'sd_id\' AND sd_value=\'' . $sdid . '\' AND list_id=\'' . $list . '\'';
|
27 |
$rq = $db_write->query ( $rq_sql );
|
28 |
-
$rq_sql = '
|
29 |
-
INSERT INTO `' . $sarbacanedesktop_users . '` (`sd_type`, `sd_value`, `list_id`, `last_call_date` ) VALUES
|
30 |
(\'sd_id\', ' . $db_write->quote ( $sdid ) . ', \'' . $list . '\', \'' . date ( 'Y-m-d H:i:s' ) . '\')';
|
31 |
$rq = $db_write->query ( $rq_sql );
|
32 |
return;
|
@@ -62,7 +62,7 @@ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Actio
|
|
62 |
die ( 'FAILED_ID' );
|
63 |
}
|
64 |
} else {
|
65 |
-
if ('
|
66 |
Mage::helper ( 'mailify' )->deleteSdid ( $sd_id );
|
67 |
} else {
|
68 |
$this->getFormattedContentShops ( $sdid );
|
@@ -91,7 +91,7 @@ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Actio
|
|
91 |
$line .= ';date_first_order;date_last_order;amount_min_order;amount_max_order;amount_avg_order;nb_orders;amount_all_orders;most_profitable_category';
|
92 |
}
|
93 |
}
|
94 |
-
$line .= ';action';
|
95 |
echo $line;
|
96 |
$this->processNewUnsubscribers ( $list_type, $store_id, $sd_id, 'display', $last_call_date );
|
97 |
$this->processNewSubscribers ( $list_type, $store_id, $sd_id, 'display', $last_call_date );
|
@@ -129,7 +129,7 @@ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Actio
|
|
129 |
$store_list = "" . $store ['store_id'] . $list ['list_type'] . ';' . $this->dQuote ( $store ['store_name'] ) . ';'; // TEST
|
130 |
$store_list .= $this->listIsResetted ( $store ['store_id'] . $list ['list_type'], $sd_id ) . ';';
|
131 |
$store_list .= $this->listIsUpdated ( $store ['store_id'], $list ['list_type'], $sd_id ) . ';';
|
132 |
-
$store_list .= 'Magento;1.0.0.
|
133 |
echo $store_list;
|
134 |
}
|
135 |
}
|
@@ -139,10 +139,10 @@ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Actio
|
|
139 |
$resource = Mage::getSingleton ( 'core/resource' );
|
140 |
$db_read = $resource->getConnection ( 'core_read' );
|
141 |
$sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
|
142 |
-
$rq_sql = '
|
143 |
-
SELECT count(*) AS `nb_in_table`
|
144 |
-
FROM ' . $sarbacanedesktop_users . '
|
145 |
-
WHERE `sd_type` = "sd_id"
|
146 |
AND `sd_value` = ' . $db_read->quote ( $sd_id ) . ' AND list_id="' . $list_id . '"';
|
147 |
$nb_in_table = $db_read->fetchOne ( $rq_sql );
|
148 |
if ($nb_in_table == 0)
|
@@ -171,9 +171,7 @@ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Actio
|
|
171 |
}
|
172 |
return $value;
|
173 |
}
|
174 |
-
private function processNewSubscribers($list_type, $store_id, $sd_id, $type_action = 'display', $last_call_date) {
|
175 |
-
|
176 |
-
$resource = Mage::getSingleton ( 'core/resource' );
|
177 |
$db_read = $resource->getConnection ( 'core_read' );
|
178 |
$db_write = $resource->getConnection ( 'core_write' );
|
179 |
$sd_updates = $resource->getTableName ( 'sd_updates' );
|
@@ -196,8 +194,6 @@ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Actio
|
|
196 |
LEFT JOIN ' . $customer_entity_varchar . ' AS `firstname` ON firstname.`entity_id` = ns.`customer_id` AND firstname.`attribute_id` = ' . ( int ) $attr_firstname . '
|
197 |
WHERE ns.`subscriber_status` = 1 AND sdu.update_time > "' . $last_call_date . '" AND sdu.list_type="N" AND sdu.action="S"
|
198 |
AND ns.`store_id` = ' . ( int ) $store_id;
|
199 |
-
if ($type_action == 'is_updated')
|
200 |
-
$rq_sql .= ' LIMIT 0, 1 ';
|
201 |
} else {
|
202 |
$rq_sql = '
|
203 |
SELECT ns.`subscriber_email` AS `email`, IFNULL(lastname.`value`, \'\') AS `lastname`, IFNULL(firstname.`value`, \'\') AS `firstname`
|
@@ -206,81 +202,129 @@ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Actio
|
|
206 |
LEFT JOIN ' . $customer_entity_varchar . ' AS `firstname` ON firstname.`entity_id` = ns.`customer_id` AND firstname.`attribute_id` = ' . ( int ) $attr_firstname . '
|
207 |
WHERE ns.`subscriber_status` = 1
|
208 |
AND ns.`store_id` = ' . ( int ) $store_id;
|
209 |
-
if ($type_action == 'is_updated')
|
210 |
-
$rq_sql .= ' LIMIT 0, 1 ';
|
211 |
}
|
212 |
} else if ($list_type == 'C') {
|
213 |
$add_customer_data = $this->checkIfListWithCustomerData ( $list_type, $store_id );
|
214 |
-
$rq_sql = " SELECT t.email, t.lastname, t.firstname ";
|
215 |
-
if ($add_customer_data) {
|
216 |
-
$rq_sql .= " ,t.amount_max_order, t.amount_min_order, t.amount_avg_order, t.date_first_order, t.date_last_order, t.nb_orders, t.amount_all_orders,MAX(ta.amount_for_category), ta.category ";
|
217 |
-
}
|
218 |
-
$rq_sql .= " FROM ( SELECT c.email AS email,cevln.value AS lastname, cevfn.value AS firstname ";
|
219 |
-
if ($add_customer_data) {
|
220 |
-
$rq_sql .= ",MAX(sfo.base_grand_total) AS amount_max_order, MIN(sfo.base_grand_total) AS amount_min_order, AVG(sfo.base_grand_total) AS amount_avg_order, MIN(sfo.created_at) AS date_first_order, MAX(sfo.created_at) AS date_last_order, COUNT(sfo.entity_id) AS nb_orders, SUM(sfo.base_grand_total) AS amount_all_orders";
|
221 |
-
}
|
222 |
-
$rq_sql .= " FROM $customer_entity c LEFT JOIN $customer_entity_varchar cevln ON cevln.entity_id = c.entity_id AND cevln.attribute_id=7
|
223 |
-
LEFT JOIN $customer_entity_varchar cevfn ON cevfn.entity_id = c.entity_id AND cevfn.attribute_id = 5";
|
224 |
if ($add_customer_data) {
|
225 |
-
$rq_sql
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
SELECT
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
-
|
249 |
-
|
250 |
-
$rq_sql .= " LEFT JOIN (SELECT ccev.value AS category, SUM(sfoi.row_total) AS amount_for_category, sfo2.customer_email AS email FROM $sales_flat_order sfo2";
|
251 |
-
$rq_sql .= " LEFT JOIN $sales_flat_order_item sfoi ON sfo2.entity_id = sfoi.order_id";
|
252 |
-
$rq_sql .= " LEFT JOIN $catalog_category_product ccp ON ccp.product_id = sfoi.product_id";
|
253 |
-
$rq_sql .= " LEFT JOIN $catalog_category_entity_varchar ccev ON ccev.entity_id = ccp.category_id AND ccev.attribute_id=41 AND ccev.entity_type_id=3";
|
254 |
-
$rq_sql .= " WHERE sfo2.entity_id = (SELECT MAX(entity_id) FROM $sales_flat_order WHERE customer_email = sfo2.customer_email) ";
|
255 |
-
$rq_sql .= " GROUP BY email,category ";
|
256 |
-
$rq_sql .= " ORDER BY amount_for_category DESC) AS ta ON ta.email = t.email ";
|
257 |
}
|
258 |
-
$rq_sql .= " GROUP BY t.email;";
|
259 |
-
if ($type_action == 'is_updated')
|
260 |
-
$rq_sql .= ' LIMIT 0, 1 ';
|
261 |
} else {
|
262 |
return;
|
263 |
}
|
264 |
-
|
265 |
if ($type_action == 'is_updated') {
|
|
|
266 |
$rq = $db_read->fetchAll ( $rq_sql );
|
267 |
return count ( $rq );
|
268 |
} else {
|
269 |
$rq = $db_read->query ( $rq_sql );
|
270 |
while ( $r = $rq->fetch () ) {
|
271 |
-
$line =
|
272 |
$line .= $this->dQuote ( $r ['lastname'] ) . ';' . $this->dQuote ( $r ['firstname'] );
|
273 |
-
$orders_data = '';
|
274 |
if ($list_type == 'C') {
|
275 |
if ($add_customer_data) {
|
276 |
$line .= ';' . $this->dQuote ( $r ['date_first_order'] ) . ';' . $this->dQuote ( $r ['date_last_order'] );
|
277 |
$line .= ';' . ( float ) $r ['amount_min_order'] . ';' . ( float ) $r ['amount_max_order'] . ';' . ( float ) $r ['amount_avg_order'];
|
278 |
-
$line .= ';' . $r ['nb_orders'] . ';' . ( float ) $r ['amount_all_orders'] . ';'.
|
279 |
-
$orders_data = $r ['amount_min_order'] . $r ['amount_max_order'];
|
280 |
-
$orders_data .= $r ['nb_orders'] . $r ['amount_all_orders'];
|
281 |
}
|
282 |
}
|
283 |
-
$line .= ';S';
|
284 |
echo $line;
|
285 |
}
|
286 |
}
|
@@ -308,10 +352,10 @@ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Actio
|
|
308 |
} else {
|
309 |
$rq = $db_read->query ( $rq_sql );
|
310 |
while ( $r = $rq->fetch () ) {
|
311 |
-
$line =
|
312 |
if ($list_type == 'C') {
|
313 |
if ($this->checkIfListWithCustomerData ( $list_type, $store_id )) {
|
314 |
-
$line .= '
|
315 |
}
|
316 |
}
|
317 |
$line .= ';U' . "\r\n";
|
25 |
$sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
|
26 |
$rq_sql = 'DELETE FROM `' . $sarbacanedesktop_users . '` WHERE sd_type=\'sd_id\' AND sd_value=\'' . $sdid . '\' AND list_id=\'' . $list . '\'';
|
27 |
$rq = $db_write->query ( $rq_sql );
|
28 |
+
$rq_sql = '
|
29 |
+
INSERT INTO `' . $sarbacanedesktop_users . '` (`sd_type`, `sd_value`, `list_id`, `last_call_date` ) VALUES
|
30 |
(\'sd_id\', ' . $db_write->quote ( $sdid ) . ', \'' . $list . '\', \'' . date ( 'Y-m-d H:i:s' ) . '\')';
|
31 |
$rq = $db_write->query ( $rq_sql );
|
32 |
return;
|
62 |
die ( 'FAILED_ID' );
|
63 |
}
|
64 |
} else {
|
65 |
+
if ('reset' == Mage::app ()->getRequest ()->getParam ( 'action' )) {
|
66 |
Mage::helper ( 'mailify' )->deleteSdid ( $sd_id );
|
67 |
} else {
|
68 |
$this->getFormattedContentShops ( $sdid );
|
91 |
$line .= ';date_first_order;date_last_order;amount_min_order;amount_max_order;amount_avg_order;nb_orders;amount_all_orders;most_profitable_category';
|
92 |
}
|
93 |
}
|
94 |
+
$line .= ';action'."\r\n";
|
95 |
echo $line;
|
96 |
$this->processNewUnsubscribers ( $list_type, $store_id, $sd_id, 'display', $last_call_date );
|
97 |
$this->processNewSubscribers ( $list_type, $store_id, $sd_id, 'display', $last_call_date );
|
129 |
$store_list = "" . $store ['store_id'] . $list ['list_type'] . ';' . $this->dQuote ( $store ['store_name'] ) . ';'; // TEST
|
130 |
$store_list .= $this->listIsResetted ( $store ['store_id'] . $list ['list_type'], $sd_id ) . ';';
|
131 |
$store_list .= $this->listIsUpdated ( $store ['store_id'], $list ['list_type'], $sd_id ) . ';';
|
132 |
+
$store_list .= 'Magento;1.0.0.7' . "\r\n";
|
133 |
echo $store_list;
|
134 |
}
|
135 |
}
|
139 |
$resource = Mage::getSingleton ( 'core/resource' );
|
140 |
$db_read = $resource->getConnection ( 'core_read' );
|
141 |
$sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
|
142 |
+
$rq_sql = '
|
143 |
+
SELECT count(*) AS `nb_in_table`
|
144 |
+
FROM ' . $sarbacanedesktop_users . '
|
145 |
+
WHERE `sd_type` = "sd_id"
|
146 |
AND `sd_value` = ' . $db_read->quote ( $sd_id ) . ' AND list_id="' . $list_id . '"';
|
147 |
$nb_in_table = $db_read->fetchOne ( $rq_sql );
|
148 |
if ($nb_in_table == 0)
|
171 |
}
|
172 |
return $value;
|
173 |
}
|
174 |
+
private function processNewSubscribers($list_type, $store_id, $sd_id, $type_action = 'display', $last_call_date) { $resource = Mage::getSingleton ( 'core/resource' );
|
|
|
|
|
175 |
$db_read = $resource->getConnection ( 'core_read' );
|
176 |
$db_write = $resource->getConnection ( 'core_write' );
|
177 |
$sd_updates = $resource->getTableName ( 'sd_updates' );
|
194 |
LEFT JOIN ' . $customer_entity_varchar . ' AS `firstname` ON firstname.`entity_id` = ns.`customer_id` AND firstname.`attribute_id` = ' . ( int ) $attr_firstname . '
|
195 |
WHERE ns.`subscriber_status` = 1 AND sdu.update_time > "' . $last_call_date . '" AND sdu.list_type="N" AND sdu.action="S"
|
196 |
AND ns.`store_id` = ' . ( int ) $store_id;
|
|
|
|
|
197 |
} else {
|
198 |
$rq_sql = '
|
199 |
SELECT ns.`subscriber_email` AS `email`, IFNULL(lastname.`value`, \'\') AS `lastname`, IFNULL(firstname.`value`, \'\') AS `firstname`
|
202 |
LEFT JOIN ' . $customer_entity_varchar . ' AS `firstname` ON firstname.`entity_id` = ns.`customer_id` AND firstname.`attribute_id` = ' . ( int ) $attr_firstname . '
|
203 |
WHERE ns.`subscriber_status` = 1
|
204 |
AND ns.`store_id` = ' . ( int ) $store_id;
|
|
|
|
|
205 |
}
|
206 |
} else if ($list_type == 'C') {
|
207 |
$add_customer_data = $this->checkIfListWithCustomerData ( $list_type, $store_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
if ($add_customer_data) {
|
209 |
+
$rq_sql = "SELECT
|
210 |
+
c.email,
|
211 |
+
cevln.value AS lastname,
|
212 |
+
cevfn.value AS firstname,
|
213 |
+
MAX(sfo.base_grand_total) AS amount_max_order,
|
214 |
+
MIN(sfo.base_grand_total) AS amount_min_order,
|
215 |
+
AVG(sfo.base_grand_total) AS amount_avg_order,
|
216 |
+
MIN(sfo.created_at) AS date_first_order,
|
217 |
+
MAX(sfo.created_at) AS date_last_order,
|
218 |
+
COUNT(sfo.entity_id) AS nb_orders,
|
219 |
+
SUM(sfo.base_grand_total) AS amount_all_orders,
|
220 |
+
(SELECT
|
221 |
+
ccev.value AS category
|
222 |
+
FROM
|
223 |
+
$sales_flat_order AS sfo2
|
224 |
+
LEFT JOIN
|
225 |
+
$sales_flat_order_item AS sfoi ON sfo2.entity_id = sfoi.order_id
|
226 |
+
LEFT JOIN
|
227 |
+
$catalog_category_product AS ccp ON ccp.product_id = sfoi.product_id
|
228 |
+
LEFT JOIN
|
229 |
+
$catalog_category_entity_varchar AS ccev ON ccev.entity_id = ccp.category_id
|
230 |
+
AND ccev.attribute_id = 41
|
231 |
+
AND ccev.entity_type_id = 3
|
232 |
+
WHERE sfo2.customer_id = c.entity_id AND sfo.store_id=$store_id
|
233 |
+
GROUP BY category
|
234 |
+
ORDER BY SUM(sfoi.row_total) DESC
|
235 |
+
LIMIT 1) AS category
|
236 |
+
FROM
|
237 |
+
$customer_entity AS c
|
238 |
+
LEFT JOIN
|
239 |
+
$customer_entity_varchar AS cevfn ON cevfn.entity_id = c.entity_id
|
240 |
+
AND cevfn.attribute_id = 5
|
241 |
+
LEFT JOIN
|
242 |
+
$customer_entity_varchar AS cevln ON cevln.entity_id = c.entity_id
|
243 |
+
AND cevln.attribute_id = 7
|
244 |
+
LEFT JOIN
|
245 |
+
$sales_flat_order AS sfo ON sfo.customer_id = c.entity_id AND c.store_id = sfo.store_id
|
246 |
+
WHERE c.store_id = " . $store_id;
|
247 |
+
if ($last_call_date != null && $last_call_date != '') {
|
248 |
+
$rq_sql .= " AND (c.created_at > '" . $last_call_date . "' OR c.updated_at > '" . $last_call_date . "' ";
|
249 |
+
$rq_sql .= " OR sfo.created_at > '" . $last_call_date . "' OR sfo.updated_at > '" . $last_call_date . "') ";
|
250 |
}
|
251 |
+
$rq_sql .= " GROUP BY c.entity_id ";
|
252 |
+
$rq_sql .= " UNION (
|
253 |
+
|
254 |
+
SELECT
|
255 |
+
sfo.customer_email AS email, sfo.customer_lastname AS lastname,sfo.customer_firstname AS firstname,
|
256 |
+
MAX(sfo.base_grand_total) AS amount_max_order,
|
257 |
+
MIN(sfo.base_grand_total) AS amount_min_order,
|
258 |
+
AVG(sfo.base_grand_total) AS amount_avg_order,
|
259 |
+
MIN(sfo.created_at) AS date_first_order,
|
260 |
+
MAX(sfo.created_at) AS date_last_order,
|
261 |
+
COUNT(sfo.entity_id) AS nb_orders,
|
262 |
+
SUM(sfo.base_grand_total) AS amount_all_orders,
|
263 |
+
(SELECT
|
264 |
+
ccev.value AS category
|
265 |
+
FROM
|
266 |
+
$sales_flat_order AS sfo2
|
267 |
+
LEFT JOIN
|
268 |
+
$sales_flat_order_item AS sfoi ON sfo2.entity_id = sfoi.order_id
|
269 |
+
LEFT JOIN
|
270 |
+
$catalog_category_product AS ccp ON ccp.product_id = sfoi.product_id
|
271 |
+
LEFT JOIN
|
272 |
+
$catalog_category_entity_varchar AS ccev ON ccev.entity_id = ccp.category_id
|
273 |
+
AND ccev.attribute_id = 41
|
274 |
+
AND ccev.entity_type_id = 3
|
275 |
+
WHERE sfo2.customer_email = sfo.customer_email AND sfo2.customer_is_guest = 1 AND sfo2.store_id = sfo.store_id
|
276 |
+
GROUP BY category
|
277 |
+
ORDER BY SUM(sfoi.row_total) DESC
|
278 |
+
LIMIT 1) AS most_profitable_category
|
279 |
+
FROM
|
280 |
+
$sales_flat_order AS sfo
|
281 |
+
WHERE sfo.customer_is_guest = 1 AND sfo.store_id = " . $store_id;
|
282 |
+
if ($last_call_date != null && $last_call_date != '') {
|
283 |
+
$rq_sql .= " AND (sfo.created_at > '" . $last_call_date . "' OR sfo.updated_at > '" . $last_call_date . "') ";
|
284 |
+
}
|
285 |
+
$rq_sql .= " GROUP BY sfo.customer_email)";
|
286 |
+
} else {
|
287 |
+
$rq_sql = " SELECT t.email, t.lastname, t.firstname ";
|
288 |
+
$rq_sql .= " FROM ( SELECT c.email AS email,cevln.value AS lastname, cevfn.value AS firstname ";
|
289 |
+
$rq_sql .= " FROM $customer_entity c LEFT JOIN $customer_entity_varchar cevln ON cevln.entity_id = c.entity_id AND cevln.attribute_id=7
|
290 |
+
LEFT JOIN $customer_entity_varchar cevfn ON cevfn.entity_id = c.entity_id AND cevfn.attribute_id = 5";
|
291 |
+
$rq_sql .= " WHERE c.store_id = " . $store_id;
|
292 |
+
if ($last_call_date != null && $last_call_date != '') {
|
293 |
+
$rq_sql .= " AND (c.created_at > '" . $last_call_date . "' OR c.updated_at > '" . $last_call_date . "')";
|
294 |
+
}
|
295 |
+
$rq_sql .= " GROUP BY c.email
|
296 |
+
UNION
|
297 |
+
SELECT sfo.customer_email AS email ,sfo.customer_lastname as lastname, sfo.customer_firstname as firstname";
|
298 |
+
$rq_sql .= " FROM $sales_flat_order sfo ";
|
299 |
+
$rq_sql .= " WHERE sfo.customer_id IS NULL AND sfo.store_id = " . $store_id;
|
300 |
+
if ($last_call_date != null && $last_call_date != '') {
|
301 |
+
$rq_sql .= " AND (sfo.created_at > '" . $last_call_date . "' OR sfo.updated_at > '" . $last_call_date . "') ";
|
302 |
+
}
|
303 |
+
$rq_sql .= " GROUP BY email ";
|
304 |
|
305 |
+
$rq_sql .= " ) as t ";
|
306 |
+
$rq_sql .= " GROUP BY t.email;";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
}
|
|
|
|
|
|
|
308 |
} else {
|
309 |
return;
|
310 |
}
|
|
|
311 |
if ($type_action == 'is_updated') {
|
312 |
+
$rq_sql .= ' LIMIT 0, 1 ';
|
313 |
$rq = $db_read->fetchAll ( $rq_sql );
|
314 |
return count ( $rq );
|
315 |
} else {
|
316 |
$rq = $db_read->query ( $rq_sql );
|
317 |
while ( $r = $rq->fetch () ) {
|
318 |
+
$line = $this->dQuote ( $r ['email'] ) . ';'; // TEST
|
319 |
$line .= $this->dQuote ( $r ['lastname'] ) . ';' . $this->dQuote ( $r ['firstname'] );
|
|
|
320 |
if ($list_type == 'C') {
|
321 |
if ($add_customer_data) {
|
322 |
$line .= ';' . $this->dQuote ( $r ['date_first_order'] ) . ';' . $this->dQuote ( $r ['date_last_order'] );
|
323 |
$line .= ';' . ( float ) $r ['amount_min_order'] . ';' . ( float ) $r ['amount_max_order'] . ';' . ( float ) $r ['amount_avg_order'];
|
324 |
+
$line .= ';' . $r ['nb_orders'] . ';' . ( float ) $r ['amount_all_orders'] . ';' . $r ['category'];
|
|
|
|
|
325 |
}
|
326 |
}
|
327 |
+
$line .= ';S'."\r\n";
|
328 |
echo $line;
|
329 |
}
|
330 |
}
|
352 |
} else {
|
353 |
$rq = $db_read->query ( $rq_sql );
|
354 |
while ( $r = $rq->fetch () ) {
|
355 |
+
$line = $this->dQuote ( $r ['email'] ) . ';;'; // TEST
|
356 |
if ($list_type == 'C') {
|
357 |
if ($this->checkIfListWithCustomerData ( $list_type, $store_id )) {
|
358 |
+
$line .= ';;;;;;;;';
|
359 |
}
|
360 |
}
|
361 |
$line .= ';U' . "\r\n";
|
app/code/community/Sarbacane/Mailify/etc/config.xml
CHANGED
@@ -23,7 +23,7 @@
|
|
23 |
<config>
|
24 |
<modules>
|
25 |
<Sarbacane_Mailify>
|
26 |
-
<version>1.0.0.
|
27 |
</Sarbacane_Mailify>
|
28 |
</modules>
|
29 |
<frontend>
|
23 |
<config>
|
24 |
<modules>
|
25 |
<Sarbacane_Mailify>
|
26 |
+
<version>1.0.0.7</version>
|
27 |
</Sarbacane_Mailify>
|
28 |
</modules>
|
29 |
<frontend>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sarbacane_Mailify</name>
|
4 |
-
<version>1.0.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/academic.php">AFL</license>
|
7 |
<channel>community</channel>
|
@@ -61,11 +61,12 @@
|
|
61 |
<li>Estadísticas detalladas, geolocalización, detección de aperturas, tiempo de lectura, clics, tipo de mensajería, bajas, direcciones erróneas...</li>
|
62 |
</ul>
|
63 |
<a href="https://es.mailify.com/?utm_source=magento&amp;utm_medium=plugin&amp;utm_campaign=marketplace">es.mailify.com</a></description>
|
64 |
-
<notes>
|
|
|
65 |
<authors><author><name>Sarbacane Software</name><user>egavard</user><email>connectors@sarbacane.com</email></author></authors>
|
66 |
-
<date>2015-
|
67 |
-
<time>
|
68 |
-
<contents><target name="magecommunity"><dir name="Sarbacane"><dir name="Mailify"><dir name="Block"><dir name="Adminhtml"><file name="Mailify.php" hash="f0ad71d64dc619421a67a3af24b23278"/></dir></dir><dir name="Helper"><file name="Data.php" hash="f4abc650d826b085fadb21c0af238021"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailifyController.php" hash="0ae0d6822e9c5169870c0980861935eb"/></dir><file name="IndexController.php" hash="
|
69 |
<compatible/>
|
70 |
-
<dependencies><required><php><min>5.0.0</min><max>5.6.
|
71 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sarbacane_Mailify</name>
|
4 |
+
<version>1.0.0.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/academic.php">AFL</license>
|
7 |
<channel>community</channel>
|
61 |
<li>Estadísticas detalladas, geolocalización, detección de aperturas, tiempo de lectura, clics, tipo de mensajería, bajas, direcciones erróneas...</li>
|
62 |
</ul>
|
63 |
<a href="https://es.mailify.com/?utm_source=magento&amp;utm_medium=plugin&amp;utm_campaign=marketplace">es.mailify.com</a></description>
|
64 |
+
<notes>We improved performance on synchronization.
|
65 |
+
It should be more efficient and nearly instant on most websites.</notes>
|
66 |
<authors><author><name>Sarbacane Software</name><user>egavard</user><email>connectors@sarbacane.com</email></author></authors>
|
67 |
+
<date>2015-12-04</date>
|
68 |
+
<time>11:10:09</time>
|
69 |
+
<contents><target name="magecommunity"><dir name="Sarbacane"><dir name="Mailify"><dir name="Block"><dir name="Adminhtml"><file name="Mailify.php" hash="f0ad71d64dc619421a67a3af24b23278"/></dir></dir><dir name="Helper"><file name="Data.php" hash="f4abc650d826b085fadb21c0af238021"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailifyController.php" hash="0ae0d6822e9c5169870c0980861935eb"/></dir><file name="IndexController.php" hash="748790436427ca843113841891be6579"/></dir><dir name="etc"><file name="config.xml" hash="5dc0ab6c7a34072cfbc89cab44250e9e"/></dir><dir name="sql"><dir name="mailify_setup"><file name="mysql4-install-1.0.0.0.php" hash="82834af7ce95c1bd9d3063ffdf3a11f5"/><file name="mysql4-upgrade-1.0.0.0-1.0.0.1.php" hash="35660ae27bb6ef74c885ad86284f9071"/><file name="mysql4-upgrade-1.0.0.1-1.0.0.2.php" hash="35660ae27bb6ef74c885ad86284f9071"/><file name="mysql4-upgrade-1.0.0.2-1.0.0.3.php" hash="35660ae27bb6ef74c885ad86284f9071"/><file name="mysql4-upgrade-1.0.0.3-1.0.0.4.php" hash="2bd5ea1d79115c1a6ba919a708b1fb4b"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="Sarbacane_Mailify"><file name="mailify.css" hash="6fcee54bdab10db72a361ec5a139cc7c"/></dir></dir><dir name="images"><file name="sd.png" hash="2038d3c503e8f59d14177a131bef7537"/></dir><dir name="js"><dir name="Sarbacane_Mailify"><file name="mailify.js" hash="d38d9ec858dfdce14e0156acc87c1c50"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mailify.xml" hash="2ce0ac9b7cd4ec8adf80494c86aaae10"/></dir><dir name="template"><dir name="mailify"><file name="mailify.phtml" hash="2207e779b2aabba7bf662405250e6c90"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Sarbacane_Mailify.xml" hash="daf2fd2fbde04d804b1fdd7671273c82"/></dir></dir></dir></target><target name="magelocale"><dir name="es_ES"><file name="Sarbacane_Mailify.csv" hash="9b795397896dc1444b6cc072107abaed"/></dir><dir name="en_US"><file name="Sarbacane_Mailify.csv" hash="59f160ee7d95366e2f1202dad25061b5"/></dir></target></contents>
|
70 |
<compatible/>
|
71 |
+
<dependencies><required><php><min>5.0.0</min><max>5.6.15</max></php></required></dependencies>
|
72 |
</package>
|