Version Notes
Refactoring to support newer versions of Magento, layout enhancements
Download this release
Release Info
Developer | Sevenlike |
Extension | MailUp |
Version | 0.3.0 |
Comparing to | |
See all releases |
Code changes from version 0.2.1 to 0.3.0
- app/code/local/SevenLike/MailUp/Block/.DS_Store +0 -0
- app/code/local/SevenLike/MailUp/Helper/.DS_Store +0 -0
- app/code/local/SevenLike/MailUp/Model/Ws.php +321 -345
- app/code/local/SevenLike/MailUp/controllers/.DS_Store +0 -0
- app/code/local/SevenLike/MailUp/controllers/Adminhtml/.DS_Store +0 -0
- app/code/local/SevenLike/MailUp/etc/.DS_Store +0 -0
- app/design/adminhtml/default/default/template/sevenlike/mailup/confirm.phtml +1 -1
- app/design/adminhtml/default/default/template/sevenlike/mailup/filter.phtml +257 -257
- package.xml +47 -40
app/code/local/SevenLike/MailUp/Block/.DS_Store
ADDED
Binary file
|
app/code/local/SevenLike/MailUp/Helper/.DS_Store
ADDED
Binary file
|
app/code/local/SevenLike/MailUp/Model/Ws.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
//ini_set(
|
3 |
|
4 |
class MailUpWsImport {
|
5 |
|
@@ -12,23 +12,15 @@ class MailUpWsImport {
|
|
12 |
private $xmlResponse;
|
13 |
protected $domResult;
|
14 |
|
15 |
-
|
16 |
function __construct() {
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
array("trace" => 1,
|
26 |
-
"exceptions" => 0));
|
27 |
-
|
28 |
-
$this->soapClient->__setSoapHeaders($this->header);
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
}
|
33 |
|
34 |
function __destruct() {
|
@@ -41,15 +33,12 @@ class MailUpWsImport {
|
|
41 |
|
42 |
public function creaGruppo($newGroup) {
|
43 |
try {
|
44 |
-
|
45 |
$this->soapClient->CreateGroup($newGroup);
|
46 |
$this-> printLastRequest();
|
47 |
$this->printLastResponse();
|
48 |
return $this->readReturnCode("CreateGroup","ReturnCode");
|
49 |
-
|
50 |
-
|
51 |
-
} catch (SoapFault $soapFault) {
|
52 |
-
var_dump($soapFault);
|
53 |
}
|
54 |
}
|
55 |
|
@@ -58,9 +47,8 @@ class MailUpWsImport {
|
|
58 |
$this->soapClient->GetNlLists();
|
59 |
$this->printLastRequest();
|
60 |
$this->printLastResponse();
|
61 |
-
|
62 |
-
|
63 |
-
} catch (SoapFault $soapFault) {
|
64 |
var_dump($soapFault);
|
65 |
}
|
66 |
}
|
@@ -78,8 +66,7 @@ class MailUpWsImport {
|
|
78 |
try {
|
79 |
$this->soapClient->StartProcess($processData);
|
80 |
//echo "<br />ReturnCode: ". $this->readReturnCode("StartProcess","ReturnCode")."<br />";
|
81 |
-
|
82 |
-
} catch (SoapFault $soapFault) {
|
83 |
var_dump($soapFault);
|
84 |
}
|
85 |
}
|
@@ -90,8 +77,7 @@ class MailUpWsImport {
|
|
90 |
//echo "<br />ReturnCode: ". $this->readReturnCode("GetProcessDetails","ReturnCode")."<br />";
|
91 |
//echo "<br />IsRunning: ". $this->readReturnCode("GetProcessDetails","IsRunning")."<br />";
|
92 |
//echo "<br />StartDate: ". $this->readReturnCode("GetProcessDetails","StartDate")."<br />";
|
93 |
-
|
94 |
-
} catch (SoapFault $soapFault) {
|
95 |
var_dump($soapFault);
|
96 |
}
|
97 |
}
|
@@ -102,25 +88,24 @@ class MailUpWsImport {
|
|
102 |
$this-> printLastRequest();
|
103 |
$this->printLastResponse();
|
104 |
//echo "<br />ReturnCode: ". $this->readReturnCode("StartImportProcesses","ReturnCode")."<br />";
|
105 |
-
|
106 |
-
} catch (SoapFault $soapFault) {
|
107 |
var_dump($soapFault);
|
108 |
}
|
109 |
}
|
110 |
|
111 |
private function readReturnCode($func, $param) {
|
112 |
-
static $func_in =
|
113 |
if ($func_in != $func) {//(!isset($this->xmlResponse))
|
114 |
$func_in = $func;
|
115 |
-
//prendi l'XML di ritorno se non l'ho
|
116 |
$this->xmlResponse = $this->soapClient->__getLastResponse();
|
117 |
|
118 |
$dom = new DomDocument();
|
119 |
-
$dom->loadXML($this->xmlResponse) or die(
|
120 |
-
$xmlResult = $dom->getElementsByTagName($func.
|
121 |
|
122 |
$this->domResult = new DomDocument();
|
123 |
-
$this->domResult->LoadXML(html_entity_decode($xmlResult->item(0)->nodeValue)) or die(
|
124 |
}
|
125 |
$rCode = $this->domResult->getElementsByTagName($param);
|
126 |
return $rCode->item(0)->nodeValue;
|
@@ -134,8 +119,10 @@ class MailUpWsImport {
|
|
134 |
//echo "<br />XMLResponse: " . $this->soapClient->__getLastResponse() . "<br />";
|
135 |
}
|
136 |
|
137 |
-
public function getCustomersFiltered($request)
|
138 |
-
|
|
|
|
|
139 |
if (!$request->getRequest()->getParam('mailupCustomerFilteredMod')) {
|
140 |
//ottengo la collection con tutti i clienti
|
141 |
$customerCollection = Mage::getModel('customer/customer')
|
@@ -143,409 +130,398 @@ class MailUpWsImport {
|
|
143 |
->addAttributeToSelect('entity_id')
|
144 |
->addAttributeToSelect('group_id')
|
145 |
->addAttributeToSelect('created_at');
|
146 |
-
|
147 |
//inizializzo l'array dei clienti filtrati con tutti i clienti
|
148 |
-
$customersFiltered = array();
|
149 |
foreach ($customerCollection as $customer) {
|
150 |
$customersFiltered[] = $customer->toArray();
|
151 |
}
|
152 |
-
|
153 |
//se richiesto, seleziono solo quelli iscritti alla newsletter di Magento
|
154 |
-
if ($request->getRequest()->getParam('mailupSubscribed') > 0
|
|
|
155 |
foreach ($customersFiltered as $customer) {
|
156 |
$customerItem = Mage::getModel('customer/customer')->load($customer['entity_id']);
|
157 |
-
if (Mage::getModel('newsletter/subscriber')->loadByCustomer($customerItem)->isSubscribed()){
|
158 |
$tempSubscribed[] = $customer;
|
159 |
}
|
160 |
}
|
161 |
-
|
162 |
}
|
163 |
-
|
164 |
//FILTRO 1 ACQUISTATO: in base al fatto se ha effettuato o meno acquisti: 0 = tutti, 1 = chi ha acquistato, 2 = chi non ha mai acquistato
|
165 |
$count = 0;
|
166 |
$result = array();
|
167 |
$tempPurchased = array();
|
168 |
$tempNoPurchased = array();
|
169 |
-
|
170 |
-
if ($request->getRequest()->getParam('mailupCustomers') > 0
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
$
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
elseif ($request->getRequest()->getParam('mailupCustomers') == 2)
|
196 |
-
$customersFiltered = $tempNoPurchased;
|
197 |
-
|
198 |
}
|
199 |
//FINE FILTRO 1 ACQUISTATO: testato OK
|
200 |
-
|
201 |
-
|
202 |
//FILTRO 2 PRODOTTO ACQUISTATO: in base al fatto se ha acquistato un determinato prodotto
|
203 |
$count = 0;
|
204 |
$result = array();
|
205 |
$tempProduct = array();
|
206 |
-
|
207 |
if ($request->getRequest()->getParam('mailupProductSku')) {
|
208 |
foreach ($customersFiltered as $customer) {
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
}
|
247 |
//FINE FILTRO 2 PRODOTTO ACQUISTATO: testato OK
|
248 |
-
|
249 |
-
|
250 |
//FILTRO 3 ACQUISTATO IN CATEGORIA: in base al fatto se ha acquistato almeno un prodotto in una determinata categoria
|
251 |
$count = 0;
|
252 |
$result = array();
|
253 |
$tempCategory = array();
|
254 |
-
|
255 |
-
if ($request->getRequest()->getParam('mailupCategoryId') > 0
|
256 |
foreach ($customersFiltered as $customer) {
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
}
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
}
|
293 |
//FINE FILTRO 3 ACQUISTATO IN CATEGORIA: testato ok
|
294 |
-
|
295 |
-
|
296 |
//FILTRO 4 GRUPPO DI CLIENTI
|
297 |
$count = 0;
|
298 |
$result = array();
|
299 |
$tempGroup = array();
|
300 |
-
|
301 |
-
if ($request->getRequest()->getParam('mailupCustomerGroupId') > 0
|
302 |
-
|
303 |
foreach ($customersFiltered as $customer) {
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
}
|
308 |
-
|
309 |
-
|
310 |
}
|
311 |
//FINE FILTRO 4 GRUPPO DI CLIENTI: testato ok
|
312 |
-
|
313 |
-
|
314 |
//FILTRO 5 PAESE DI PROVENIENZA
|
315 |
$count = 0;
|
316 |
$result = array();
|
317 |
$tempCountry = array();
|
318 |
-
|
319 |
-
if ($request->getRequest()->getParam('mailupCountry') !=
|
320 |
-
|
321 |
foreach ($customersFiltered as $customer) {
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
$tempCountry[] = $customer;
|
331 |
-
|
332 |
-
//unsetto la variabile
|
333 |
-
$customerItem->unsetData();
|
334 |
|
|
|
|
|
335 |
}
|
336 |
-
|
337 |
-
|
338 |
}
|
339 |
//FINE FILTRO 5 PAESE DI PROVENIENZA: testato ok
|
340 |
-
|
341 |
-
|
342 |
//FILTRO 6 CAP DI PROVENIENZA
|
343 |
$count = 0;
|
344 |
$result = array();
|
345 |
$tempPostCode = array();
|
346 |
-
|
347 |
if ($request->getRequest()->getParam('mailupPostCode')) {
|
348 |
-
|
349 |
foreach ($customersFiltered as $customer) {
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
}
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
//FINE FILTRO 6 CAP DI PROVENIENZA: testato ok
|
366 |
-
|
367 |
-
|
368 |
//FILTRO 7 DATA CREAZIONE CLIENTE
|
369 |
$count = 0;
|
370 |
$result = array();
|
371 |
$tempDate = array();
|
372 |
-
|
373 |
if ($request->getRequest()->getParam('mailupCustomerStartDate') || $request->getRequest()->getParam('mailupCustomerEndDate') ) {
|
374 |
-
|
375 |
foreach ($customersFiltered as $customer) {
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
|
|
402 |
}
|
403 |
-
|
404 |
-
|
405 |
}
|
406 |
//FINE FILTRO 7 DATA CREAZIONE CLIENTE: testato ok
|
407 |
-
|
408 |
-
|
409 |
//FILTRO 8 TOTALE ACQUISTATO
|
410 |
$count = 0;
|
411 |
$result = array();
|
412 |
$tempTotal = array();
|
413 |
-
|
414 |
-
if ($request->getRequest()->getParam('mailupTotalAmountValue') > 0
|
415 |
foreach ($customersFiltered as $customer) {
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
|
|
|
|
|
|
440 |
}
|
441 |
-
|
442 |
-
|
443 |
}
|
444 |
//FINE FILTRO 8 TOTALE ACQUISTATO: testato ok
|
445 |
-
|
446 |
-
|
447 |
//FILTRO 9 DATA ACQUISTATO
|
448 |
$count = 0;
|
449 |
$result = array();
|
450 |
$tempOrderedDateYes = array();
|
451 |
$tempOrderedDateNo = array();
|
452 |
-
|
453 |
if ($request->getRequest()->getParam('mailupOrderStartDate') || $request->getRequest()->getParam('mailupOrderEndDate') ) {
|
454 |
foreach ($customersFiltered as $customer) {
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
}
|
499 |
-
|
500 |
-
if ($request->getRequest()->getParam('mailupOrderYesNo') == 'yes')
|
501 |
-
$customersFiltered = $tempOrderedDateYes;
|
502 |
-
else
|
503 |
-
$customersFiltered = $tempOrderedDateNo;
|
504 |
}
|
505 |
//FINE FILTRO 9 DATA ACQUISTATO: testato ok
|
506 |
-
|
507 |
-
|
508 |
-
}
|
509 |
-
|
510 |
-
else {
|
511 |
//GESTISCO LE MODIFICHE MANUALI
|
512 |
$count = 0;
|
513 |
$result = array();
|
514 |
$tempMod = array();
|
515 |
-
|
516 |
$emails = explode('
|
517 |
', $request->getRequest()->getParam('mailupCustomerFilteredMod'));
|
518 |
-
|
519 |
foreach ($emails as $email) {
|
520 |
-
|
521 |
$email = trim($email);
|
522 |
-
|
523 |
if (strstr($email, '@')) {
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
}
|
541 |
}
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
}
|
550 |
-
|
551 |
}
|
1 |
<?php
|
2 |
+
//ini_set('soap.wsdl_cache_enabled', '0');
|
3 |
|
4 |
class MailUpWsImport {
|
5 |
|
12 |
private $xmlResponse;
|
13 |
protected $domResult;
|
14 |
|
|
|
15 |
function __construct() {
|
16 |
+
$urlConsole = Mage::getStoreConfig('newsletter/mailup/url_console');
|
17 |
+
$WSDLUrl = "http://". $urlConsole ."/services/WSMailUpImport.asmx?WSDL";
|
18 |
+
$user = Mage::getStoreConfig('newsletter/mailup/user');
|
19 |
+
$password = Mage::getStoreConfig('newsletter/mailup/password');
|
20 |
+
$headers = array("User" => $user, "Password" => $password);
|
21 |
+
$this->header = new SOAPHeader($this->ns, "Authentication", $headers);
|
22 |
+
$this->soapClient = new SoapClient($WSDLUrl, array("trace" => 1, "exceptions" => 0));
|
23 |
+
$this->soapClient->__setSoapHeaders($this->header);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
25 |
|
26 |
function __destruct() {
|
33 |
|
34 |
public function creaGruppo($newGroup) {
|
35 |
try {
|
|
|
36 |
$this->soapClient->CreateGroup($newGroup);
|
37 |
$this-> printLastRequest();
|
38 |
$this->printLastResponse();
|
39 |
return $this->readReturnCode("CreateGroup","ReturnCode");
|
40 |
+
} catch (SoapFault $soapFault) {
|
41 |
+
var_dump($soapFault);
|
|
|
|
|
42 |
}
|
43 |
}
|
44 |
|
47 |
$this->soapClient->GetNlLists();
|
48 |
$this->printLastRequest();
|
49 |
$this->printLastResponse();
|
50 |
+
return $this->soapClient->__getLastResponse();
|
51 |
+
} catch (SoapFault $soapFault) {
|
|
|
52 |
var_dump($soapFault);
|
53 |
}
|
54 |
}
|
66 |
try {
|
67 |
$this->soapClient->StartProcess($processData);
|
68 |
//echo "<br />ReturnCode: ". $this->readReturnCode("StartProcess","ReturnCode")."<br />";
|
69 |
+
} catch (SoapFault $soapFault) {
|
|
|
70 |
var_dump($soapFault);
|
71 |
}
|
72 |
}
|
77 |
//echo "<br />ReturnCode: ". $this->readReturnCode("GetProcessDetails","ReturnCode")."<br />";
|
78 |
//echo "<br />IsRunning: ". $this->readReturnCode("GetProcessDetails","IsRunning")."<br />";
|
79 |
//echo "<br />StartDate: ". $this->readReturnCode("GetProcessDetails","StartDate")."<br />";
|
80 |
+
} catch (SoapFault $soapFault) {
|
|
|
81 |
var_dump($soapFault);
|
82 |
}
|
83 |
}
|
88 |
$this-> printLastRequest();
|
89 |
$this->printLastResponse();
|
90 |
//echo "<br />ReturnCode: ". $this->readReturnCode("StartImportProcesses","ReturnCode")."<br />";
|
91 |
+
} catch (SoapFault $soapFault) {
|
|
|
92 |
var_dump($soapFault);
|
93 |
}
|
94 |
}
|
95 |
|
96 |
private function readReturnCode($func, $param) {
|
97 |
+
static $func_in = ''; //static variable to test xmlResponse update
|
98 |
if ($func_in != $func) {//(!isset($this->xmlResponse))
|
99 |
$func_in = $func;
|
100 |
+
//prendi l'XML di ritorno se non l'ho già preso
|
101 |
$this->xmlResponse = $this->soapClient->__getLastResponse();
|
102 |
|
103 |
$dom = new DomDocument();
|
104 |
+
$dom->loadXML($this->xmlResponse) or die('File XML non valido!');
|
105 |
+
$xmlResult = $dom->getElementsByTagName($func.'Result');
|
106 |
|
107 |
$this->domResult = new DomDocument();
|
108 |
+
$this->domResult->LoadXML(html_entity_decode($xmlResult->item(0)->nodeValue)) or die('File XML1 non valido!');
|
109 |
}
|
110 |
$rCode = $this->domResult->getElementsByTagName($param);
|
111 |
return $rCode->item(0)->nodeValue;
|
119 |
//echo "<br />XMLResponse: " . $this->soapClient->__getLastResponse() . "<br />";
|
120 |
}
|
121 |
|
122 |
+
public function getCustomersFiltered($request) {
|
123 |
+
//inizializzo l'array dei clienti
|
124 |
+
$customersFiltered = array();
|
125 |
+
|
126 |
if (!$request->getRequest()->getParam('mailupCustomerFilteredMod')) {
|
127 |
//ottengo la collection con tutti i clienti
|
128 |
$customerCollection = Mage::getModel('customer/customer')
|
130 |
->addAttributeToSelect('entity_id')
|
131 |
->addAttributeToSelect('group_id')
|
132 |
->addAttributeToSelect('created_at');
|
133 |
+
|
134 |
//inizializzo l'array dei clienti filtrati con tutti i clienti
|
|
|
135 |
foreach ($customerCollection as $customer) {
|
136 |
$customersFiltered[] = $customer->toArray();
|
137 |
}
|
138 |
+
|
139 |
//se richiesto, seleziono solo quelli iscritti alla newsletter di Magento
|
140 |
+
if ($request->getRequest()->getParam('mailupSubscribed') > 0) {
|
141 |
+
$tempSubscribed = array();
|
142 |
foreach ($customersFiltered as $customer) {
|
143 |
$customerItem = Mage::getModel('customer/customer')->load($customer['entity_id']);
|
144 |
+
if (Mage::getModel('newsletter/subscriber')->loadByCustomer($customerItem)->isSubscribed()) {
|
145 |
$tempSubscribed[] = $customer;
|
146 |
}
|
147 |
}
|
148 |
+
$customersFiltered = array_intersect($tempSubscribed, $customersFiltered);
|
149 |
}
|
150 |
+
|
151 |
//FILTRO 1 ACQUISTATO: in base al fatto se ha effettuato o meno acquisti: 0 = tutti, 1 = chi ha acquistato, 2 = chi non ha mai acquistato
|
152 |
$count = 0;
|
153 |
$result = array();
|
154 |
$tempPurchased = array();
|
155 |
$tempNoPurchased = array();
|
156 |
+
|
157 |
+
if ($request->getRequest()->getParam('mailupCustomers') > 0) {
|
158 |
+
foreach ($customersFiltered as $customer) {
|
159 |
+
$result[] = $customer;
|
160 |
+
|
161 |
+
//filtro gli ordini in base al customer id
|
162 |
+
$orders = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_id', $result[$count]['entity_id']);
|
163 |
+
|
164 |
+
//aggiungo il cliente ad un determinato array in base a se ha ordinato o meno
|
165 |
+
if ($orders->getData()) {
|
166 |
+
$tempPurchased[] = $result[$count];
|
167 |
+
} else {
|
168 |
+
$tempNoPurchased[] = $result[$count];
|
169 |
+
}
|
170 |
+
|
171 |
+
//unsetto la variabile
|
172 |
+
unset($orders); //->unsetData();
|
173 |
+
|
174 |
+
$count++;
|
175 |
+
}
|
176 |
+
|
177 |
+
if ($request->getRequest()->getParam('mailupCustomers') == 1) {
|
178 |
+
$customersFiltered = array_intersect($tempPurchased, $customersFiltered);
|
179 |
+
} elseif ($request->getRequest()->getParam('mailupCustomers') == 2) {
|
180 |
+
$customersFiltered = array_intersect($tempNoPurchased, $customersFiltered);
|
181 |
+
}
|
|
|
|
|
|
|
182 |
}
|
183 |
//FINE FILTRO 1 ACQUISTATO: testato OK
|
184 |
+
|
|
|
185 |
//FILTRO 2 PRODOTTO ACQUISTATO: in base al fatto se ha acquistato un determinato prodotto
|
186 |
$count = 0;
|
187 |
$result = array();
|
188 |
$tempProduct = array();
|
189 |
+
|
190 |
if ($request->getRequest()->getParam('mailupProductSku')) {
|
191 |
foreach ($customersFiltered as $customer) {
|
192 |
+
$result[] = $customer;
|
193 |
+
|
194 |
+
//filtro gli ordini in base al customer id
|
195 |
+
$orders = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_id', $result[$count]['entity_id']);
|
196 |
+
$purchasedProduct = 0;
|
197 |
+
|
198 |
+
$mailupProductId = Mage::getModel('catalog/product')->getIdBySku($request->getRequest()->getParam('mailupProductSku'));
|
199 |
+
|
200 |
+
foreach ($orders->getData() as $order) {
|
201 |
+
$orderIncrementId = $order['increment_id'];
|
202 |
+
|
203 |
+
//carico i dati di ogni ordine
|
204 |
+
$orderData = Mage::getModel('sales/order')->loadByIncrementID($orderIncrementId);
|
205 |
+
$items = $orderData->getAllItems();
|
206 |
+
$ids = array();
|
207 |
+
foreach ($items as $itemId => $item) {
|
208 |
+
$ids[] = $item->getProductId();
|
209 |
+
}
|
210 |
+
|
211 |
+
if (in_array($mailupProductId, $ids)) {
|
212 |
+
$purchasedProduct = 1;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
//aggiungo il cliente ad un determinato array in base a se ha ordinato o meno
|
217 |
+
if ($purchasedProduct == 1) {
|
218 |
+
$tempProduct[] = $result[$count];
|
219 |
+
}
|
220 |
+
|
221 |
+
//unsetto la variabile
|
222 |
+
unset($orders); //->unsetData();
|
223 |
+
|
224 |
+
$count++;
|
225 |
+
}
|
226 |
+
|
227 |
+
$customersFiltered = array_intersect($tempProduct, $customersFiltered);
|
|
|
228 |
}
|
229 |
//FINE FILTRO 2 PRODOTTO ACQUISTATO: testato OK
|
230 |
+
|
231 |
+
|
232 |
//FILTRO 3 ACQUISTATO IN CATEGORIA: in base al fatto se ha acquistato almeno un prodotto in una determinata categoria
|
233 |
$count = 0;
|
234 |
$result = array();
|
235 |
$tempCategory = array();
|
236 |
+
|
237 |
+
if ($request->getRequest()->getParam('mailupCategoryId') > 0) {
|
238 |
foreach ($customersFiltered as $customer) {
|
239 |
+
$result[] = $customer;
|
240 |
+
|
241 |
+
//filtro gli ordini in base al customer id
|
242 |
+
$orders = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_id', $result[$count]['entity_id']);
|
243 |
+
$purchasedCategory = 0;
|
244 |
+
|
245 |
+
foreach ($orders->getData() as $order) {
|
246 |
+
$orderIncrementId = $order['increment_id'];
|
247 |
+
|
248 |
+
//carico i dati di ogni ordine
|
249 |
+
$orderData = Mage::getModel('sales/order')->loadByIncrementID($orderIncrementId);
|
250 |
+
$items = $orderData->getAllItems();
|
251 |
+
$cat_ids = array();
|
252 |
+
foreach ($items as $product) {
|
253 |
+
$cat_ids[] = Mage::getResourceSingleton('catalog/product')->getCategoryIds($product);
|
254 |
+
}
|
255 |
+
|
256 |
+
if (in_array($request->getRequest()->getParam('mailupCategoryId'), $cat_ids)) {
|
257 |
+
$purchasedCategory = 1;
|
258 |
+
}
|
259 |
+
}
|
260 |
+
//aggiungo il cliente ad un determinato array in base a se ha ordinato o meno
|
261 |
+
if ($purchasedCategory == 1) {
|
262 |
+
$tempCategory[] = $result[$count];
|
263 |
+
}
|
264 |
+
|
265 |
+
//unsetto la variabile
|
266 |
+
unset($orders); //->unsetData();
|
267 |
+
|
268 |
+
$count++;
|
269 |
}
|
270 |
+
|
271 |
+
$customersFiltered = array_intersect($tempCategory, $customersFiltered);
|
|
|
|
|
272 |
}
|
273 |
//FINE FILTRO 3 ACQUISTATO IN CATEGORIA: testato ok
|
274 |
+
|
275 |
+
|
276 |
//FILTRO 4 GRUPPO DI CLIENTI
|
277 |
$count = 0;
|
278 |
$result = array();
|
279 |
$tempGroup = array();
|
280 |
+
|
281 |
+
if ($request->getRequest()->getParam('mailupCustomerGroupId') > 0) {
|
|
|
282 |
foreach ($customersFiltered as $customer) {
|
283 |
+
if ($customer['group_id'] == $request->getRequest()->getParam('mailupCustomerGroupId')) {
|
284 |
+
$tempGroup[] = $customer;
|
285 |
+
}
|
286 |
}
|
287 |
+
|
288 |
+
$customersFiltered = array_intersect($tempGroup, $customersFiltered);
|
289 |
}
|
290 |
//FINE FILTRO 4 GRUPPO DI CLIENTI: testato ok
|
291 |
+
|
292 |
+
|
293 |
//FILTRO 5 PAESE DI PROVENIENZA
|
294 |
$count = 0;
|
295 |
$result = array();
|
296 |
$tempCountry = array();
|
297 |
+
|
298 |
+
if ($request->getRequest()->getParam('mailupCountry') != '0') {
|
|
|
299 |
foreach ($customersFiltered as $customer) {
|
300 |
+
//ottengo la nazione del primary billing address
|
301 |
+
$customerItem = Mage::getModel('customer/customer')->load($customer['entity_id']);
|
302 |
+
$customerAddress = $customerItem->getPrimaryBillingAddress();
|
303 |
+
$countryId = $customerAddress['country_id'];
|
304 |
+
|
305 |
+
if ($countryId == $request->getRequest()->getParam('mailupCountry')) {
|
306 |
+
$tempCountry[] = $customer;
|
307 |
+
}
|
|
|
|
|
|
|
|
|
308 |
|
309 |
+
//unsetto la variabile
|
310 |
+
unset($customerItem); //->unsetData();
|
311 |
}
|
312 |
+
|
313 |
+
$customersFiltered = array_intersect($tempCountry, $customersFiltered);
|
314 |
}
|
315 |
//FINE FILTRO 5 PAESE DI PROVENIENZA: testato ok
|
316 |
+
|
317 |
+
|
318 |
//FILTRO 6 CAP DI PROVENIENZA
|
319 |
$count = 0;
|
320 |
$result = array();
|
321 |
$tempPostCode = array();
|
322 |
+
|
323 |
if ($request->getRequest()->getParam('mailupPostCode')) {
|
|
|
324 |
foreach ($customersFiltered as $customer) {
|
325 |
+
//ottengo la nazione del primary billing address
|
326 |
+
$customerItem = Mage::getModel('customer/customer')->load($customer['entity_id']);
|
327 |
+
$customerAddress = $customerItem->getPrimaryBillingAddress();
|
328 |
+
$postCode = $customerAddress['postcode'];
|
329 |
+
|
330 |
+
if ($postCode == $request->getRequest()->getParam('mailupPostCode')) {
|
331 |
+
$tempPostCode[] = $customer;
|
332 |
+
}
|
333 |
+
|
334 |
+
//unsetto la variabile
|
335 |
+
unset($customerItem); //->unsetData();
|
336 |
}
|
337 |
+
|
338 |
+
$customersFiltered = array_intersect($tempPostCode, $customersFiltered);
|
339 |
+
}
|
340 |
//FINE FILTRO 6 CAP DI PROVENIENZA: testato ok
|
341 |
+
|
342 |
+
|
343 |
//FILTRO 7 DATA CREAZIONE CLIENTE
|
344 |
$count = 0;
|
345 |
$result = array();
|
346 |
$tempDate = array();
|
347 |
+
|
348 |
if ($request->getRequest()->getParam('mailupCustomerStartDate') || $request->getRequest()->getParam('mailupCustomerEndDate') ) {
|
|
|
349 |
foreach ($customersFiltered as $customer) {
|
350 |
+
//trasformo tutte le date in aaaammgg
|
351 |
+
$createdAt = substr(str_replace('-', '', $customer['created_at']), 0, 8);
|
352 |
+
$filterStart = '';
|
353 |
+
$filterEnd = '';
|
354 |
+
|
355 |
+
if ($request->getRequest()->getParam('mailupCustomerStartDate')) {
|
356 |
+
$filterStart = substr($request->getRequest()->getParam('mailupCustomerStartDate'), 6, 4).substr($request->getRequest()->getParam('mailupCustomerStartDate'), 3, 2).substr($request->getRequest()->getParam('mailupCustomerStartDate'), 0, 2);
|
357 |
+
}
|
358 |
+
if ($request->getRequest()->getParam('mailupCustomerEndDate')) {
|
359 |
+
$filterEnd = substr($request->getRequest()->getParam('mailupCustomerEndDate'), 6, 4).substr($request->getRequest()->getParam('mailupCustomerEndDate'), 3, 2).substr($request->getRequest()->getParam('mailupCustomerEndDate'), 0, 2);
|
360 |
+
}
|
361 |
+
if ($filterStart && $filterEnd) {
|
362 |
+
//compreso tra start e end date
|
363 |
+
if ($createdAt >= $filterStart && $createdAt <= $filterEnd) {
|
364 |
+
$tempDate[] = $customer;
|
365 |
+
}
|
366 |
+
} elseif ($filterStart) {
|
367 |
+
// >= di start date
|
368 |
+
if ($createdAt >= $filterStart) {
|
369 |
+
$tempDate[] = $customer;
|
370 |
+
}
|
371 |
+
} else {
|
372 |
+
// <= di end date
|
373 |
+
if ($createdAt <= $filterEnd) {
|
374 |
+
$tempDate[] = $customer;
|
375 |
+
}
|
376 |
+
}
|
377 |
}
|
378 |
+
|
379 |
+
$customersFiltered = array_intersect($tempDate, $customersFiltered);
|
380 |
}
|
381 |
//FINE FILTRO 7 DATA CREAZIONE CLIENTE: testato ok
|
382 |
+
|
383 |
+
|
384 |
//FILTRO 8 TOTALE ACQUISTATO
|
385 |
$count = 0;
|
386 |
$result = array();
|
387 |
$tempTotal = array();
|
388 |
+
|
389 |
+
if ($request->getRequest()->getParam('mailupTotalAmountValue') > 0) {
|
390 |
foreach ($customersFiltered as $customer) {
|
391 |
+
$result[] = $customer;
|
392 |
+
|
393 |
+
//filtro gli ordini in base al customer id
|
394 |
+
$orders = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_id', $result[$count]['entity_id']);
|
395 |
+
|
396 |
+
$totalOrdered = 0;
|
397 |
+
|
398 |
+
foreach ($orders->getData() as $order) {
|
399 |
+
$totalOrdered += $order['subtotal'];
|
400 |
+
}
|
401 |
+
|
402 |
+
if ($totalOrdered == $request->getRequest()->getParam('mailupTotalAmountValue') && $request->getRequest()->getParam('mailupTotalAmountCond') == "eq") {
|
403 |
+
$tempTotal[] = $result[$count];
|
404 |
+
}
|
405 |
+
|
406 |
+
if ($totalOrdered > $request->getRequest()->getParam('mailupTotalAmountValue') && $request->getRequest()->getParam('mailupTotalAmountCond') == "gt") {
|
407 |
+
$tempTotal[] = $result[$count];
|
408 |
+
}
|
409 |
+
|
410 |
+
if ($totalOrdered < $request->getRequest()->getParam('mailupTotalAmountValue') && $request->getRequest()->getParam('mailupTotalAmountCond') == "lt" ) {
|
411 |
+
$tempTotal[] = $result[$count];
|
412 |
+
}
|
413 |
+
|
414 |
+
$count++;
|
415 |
+
|
416 |
+
//unsetto la variabile
|
417 |
+
unset($orders); //->unsetData();
|
418 |
}
|
419 |
+
|
420 |
+
$customersFiltered = array_intersect($tempTotal, $customersFiltered);
|
421 |
}
|
422 |
//FINE FILTRO 8 TOTALE ACQUISTATO: testato ok
|
423 |
+
|
424 |
+
|
425 |
//FILTRO 9 DATA ACQUISTATO
|
426 |
$count = 0;
|
427 |
$result = array();
|
428 |
$tempOrderedDateYes = array();
|
429 |
$tempOrderedDateNo = array();
|
430 |
+
|
431 |
if ($request->getRequest()->getParam('mailupOrderStartDate') || $request->getRequest()->getParam('mailupOrderEndDate') ) {
|
432 |
foreach ($customersFiltered as $customer) {
|
433 |
+
$result[] = $customer;
|
434 |
+
|
435 |
+
//filtro gli ordini in base al customer id
|
436 |
+
$orders = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_id', $result[$count]['entity_id']);
|
437 |
+
|
438 |
+
$orderedDate = 0;
|
439 |
+
|
440 |
+
foreach ($orders->getData() as $order) {
|
441 |
+
$createdAt = substr(str_replace('-', '', $order['created_at']), 0, 8);
|
442 |
+
|
443 |
+
$filterStart = '';
|
444 |
+
$filterEnd = '';
|
445 |
+
|
446 |
+
if ($request->getRequest()->getParam('mailupOrderStartDate')) {
|
447 |
+
$filterStart = substr($request->getRequest()->getParam('mailupOrderStartDate'), 6, 4).substr($request->getRequest()->getParam('mailupOrderStartDate'), 3, 2).substr($request->getRequest()->getParam('mailupOrderStartDate'), 0, 2);
|
448 |
+
}
|
449 |
+
if ($request->getRequest()->getParam('mailupOrderEndDate')) {
|
450 |
+
$filterEnd = substr($request->getRequest()->getParam('mailupOrderEndDate'), 6, 4).substr($request->getRequest()->getParam('mailupOrderEndDate'), 3, 2).substr($request->getRequest()->getParam('mailupOrderEndDate'), 0, 2);
|
451 |
+
}
|
452 |
+
if ($filterStart && $filterEnd) {
|
453 |
+
//compreso tra start e end date
|
454 |
+
if ($createdAt >= $filterStart && $createdAt <= $filterEnd) {
|
455 |
+
$orderedDate = 1;
|
456 |
+
}
|
457 |
+
} elseif ($filterStart) {
|
458 |
+
// >= di start date
|
459 |
+
if ($createdAt >= $filterStart) {
|
460 |
+
$orderedDate = 1;
|
461 |
+
}
|
462 |
+
} else {
|
463 |
+
// <= di end date
|
464 |
+
if ($createdAt <= $filterEnd) {
|
465 |
+
$orderedDate = 1;
|
466 |
+
}
|
467 |
+
}
|
468 |
+
|
469 |
+
//unsetto la variabile
|
470 |
+
unset($orders); //->unsetData();
|
471 |
+
}
|
472 |
+
|
473 |
+
if ($orderedDate == 1) {
|
474 |
+
$tempOrderedDateYes[] = $result[$count];
|
475 |
+
} else {
|
476 |
+
$tempOrderedDateNo[] = $result[$count];
|
477 |
+
}
|
478 |
+
|
479 |
+
$count++;
|
480 |
+
}
|
481 |
+
|
482 |
+
if ($request->getRequest()->getParam('mailupOrderYesNo') == 'yes') {
|
483 |
+
$customersFiltered = array_intersect($tempOrderedDateYes, $customersFiltered);
|
484 |
+
} else {
|
485 |
+
$customersFiltered = array_intersect($tempOrderedDateNo, $customersFiltered);
|
486 |
}
|
|
|
|
|
|
|
|
|
|
|
487 |
}
|
488 |
//FINE FILTRO 9 DATA ACQUISTATO: testato ok
|
489 |
+
|
490 |
+
} else {
|
|
|
|
|
|
|
491 |
//GESTISCO LE MODIFICHE MANUALI
|
492 |
$count = 0;
|
493 |
$result = array();
|
494 |
$tempMod = array();
|
495 |
+
|
496 |
$emails = explode('
|
497 |
', $request->getRequest()->getParam('mailupCustomerFilteredMod'));
|
498 |
+
|
499 |
foreach ($emails as $email) {
|
|
|
500 |
$email = trim($email);
|
501 |
+
|
502 |
if (strstr($email, '@')) {
|
503 |
+
$customerModCollection = Mage::getModel('customer/customer')
|
504 |
+
->getCollection()
|
505 |
+
->addAttributeToSelect('email')
|
506 |
+
->addAttributeToFilter('email', $email);
|
507 |
+
|
508 |
+
$added = 0;
|
509 |
+
|
510 |
+
foreach ($customerModCollection as $customerMod) {
|
511 |
+
$tempMod[] = $customerMod->toArray();
|
512 |
+
$added = 1;
|
513 |
+
}
|
514 |
+
|
515 |
+
if ($added == 0) {
|
516 |
+
$tempMod[] = array('entity_id'=>0, 'firstname'=>'', 'lastname'=>'', 'email'=>$email);
|
517 |
+
}
|
|
|
518 |
}
|
519 |
}
|
520 |
+
|
521 |
+
$customersFiltered = array_intersect($tempMod, $customersFiltered);
|
522 |
+
}
|
523 |
+
//FINE GESTISCO LE MODIFICHE MANUALI
|
524 |
+
|
525 |
+
return $customersFiltered;
|
|
|
526 |
}
|
|
|
527 |
}
|
app/code/local/SevenLike/MailUp/controllers/.DS_Store
ADDED
Binary file
|
app/code/local/SevenLike/MailUp/controllers/Adminhtml/.DS_Store
ADDED
Binary file
|
app/code/local/SevenLike/MailUp/etc/.DS_Store
ADDED
Binary file
|
app/design/adminhtml/default/default/template/sevenlike/mailup/confirm.phtml
CHANGED
@@ -40,7 +40,7 @@ $xml = simplexml_load_string($xmlLists);
|
|
40 |
<input type="hidden" name="mailupOrderStartDate" value="<?php echo $this->getRequest()->getParam('mailupOrderStartDate'); ?>" />
|
41 |
<input type="hidden" name="mailupOrderEndDate" value="<?php echo $this->getRequest()->getParam('mailupOrderEndDate'); ?>" />
|
42 |
<input type="hidden" name="mailupOrderYesNo" value="<?php echo $this->getRequest()->getParam('mailupOrderYesNo'); ?>" />
|
43 |
-
<input type="hidden" name="
|
44 |
</form>
|
45 |
|
46 |
<form id="csv_form" name="csv_form" method="post" action="<?php echo $this->getUrl('*/*/csv'); ?>">
|
40 |
<input type="hidden" name="mailupOrderStartDate" value="<?php echo $this->getRequest()->getParam('mailupOrderStartDate'); ?>" />
|
41 |
<input type="hidden" name="mailupOrderEndDate" value="<?php echo $this->getRequest()->getParam('mailupOrderEndDate'); ?>" />
|
42 |
<input type="hidden" name="mailupOrderYesNo" value="<?php echo $this->getRequest()->getParam('mailupOrderYesNo'); ?>" />
|
43 |
+
<input type="hidden" name="mailupSubscribed" value="<?php echo $this->getRequest()->getParam('mailupSubscribed'); ?>" />
|
44 |
</form>
|
45 |
|
46 |
<form id="csv_form" name="csv_form" method="post" action="<?php echo $this->getUrl('*/*/csv'); ?>">
|
app/design/adminhtml/default/default/template/sevenlike/mailup/filter.phtml
CHANGED
@@ -28,7 +28,7 @@ if ($loginTest > 0){
|
|
28 |
if ($login > 0 || strlen(Mage::getStoreConfig('newsletter/mailup/list')) < 2) {
|
29 |
echo $this->__('WARNING: before proceeding you must correctly configure the settings of MailUp access in System->Configuration->Newsletter->MailUp');
|
30 |
} else {
|
31 |
-
//controllo se la lista
|
32 |
$MailUpWsImport = Mage::getModel('mailup/ws');
|
33 |
$wsImport = new MailUpWsImport();
|
34 |
$mailupLists = $wsImport->GetNlList();
|
@@ -52,9 +52,9 @@ if ($login > 0 || strlen(Mage::getStoreConfig('newsletter/mailup/list')) < 2) {
|
|
52 |
$mailupOrderEndDate = $this->getRequest()->getParam('mailupOrderEndDate');
|
53 |
$mailupOrderYesNo = $this->getRequest()->getParam('mailupOrderYesNo');
|
54 |
$mailupSubscribed = $this->getRequest()->getParam('mailupSubscribed');
|
55 |
-
|
56 |
|
57 |
-
|
58 |
<table cellspacing="0" class="grid-header">
|
59 |
<tr>
|
60 |
<td><h3><?=$this->__('MailUp')?></h3></td>
|
@@ -63,9 +63,9 @@ if ($login > 0 || strlen(Mage::getStoreConfig('newsletter/mailup/list')) < 2) {
|
|
63 |
</td>
|
64 |
</tr>
|
65 |
</table>
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
<form id="edit_form" name="edit_form" method="post" action="<?=$this->getUrl('*/*/confirm')?>">
|
70 |
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
71 |
<h4><span id="spantitle2"><?=$this->__('Filter customers')?></span><span id="spansugger"><a href="#ottsugg"><?=$this->__('Get hints')?> ⇒</a></span></h4>
|
@@ -73,326 +73,326 @@ if ($login > 0 || strlen(Mage::getStoreConfig('newsletter/mailup/list')) < 2) {
|
|
73 |
<fieldset id="my-fieldset">
|
74 |
<table cellspacing="0" class="form-list">
|
75 |
<tr>
|
76 |
-
|
77 |
</tr>
|
78 |
<tr>
|
79 |
-
|
80 |
</tr>
|
81 |
<tr>
|
82 |
<td colspan="3">
|
83 |
-
|
84 |
-
|
85 |
-
</strong></td>
|
86 |
</tr>
|
|
|
87 |
<?php //imposto il filtro per clienti: 0 = tutti, 1 = che hanno acquistato, 2 = che non hanno mai acquistato ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
<tr>
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
<?=$this->__('All customers')?>
|
93 |
-
</td>
|
94 |
-
|
95 |
-
<td class="input-ele spdnpg1">
|
96 |
-
<input type="radio" name="mailupCustomers" value="1" onclick="makeEnable('mailupProductId','mailupCategoryId','mailupTotalAmountCond','mailupTotalAmountValue')" <?php if($mailupCustomers == 1) echo 'checked="checked"'; ?> />
|
97 |
-
<?=$this->__('Customers who have purchased')?>
|
98 |
-
</td>
|
99 |
-
|
100 |
-
<td class="input-ele spdnpg1">
|
101 |
-
<input type="radio" name="mailupCustomers" value="2" onclick="makeDisable('mailupProductId','mailupCategoryId','mailupTotalAmountCond','mailupTotalAmountValue')" <?php if($mailupCustomers == 2) echo 'checked="checked"'; ?> />
|
102 |
-
<?=$this->__("Customers who haven't purchased yet")?>
|
103 |
-
</td>
|
104 |
</tr>
|
105 |
-
|
106 |
-
|
107 |
</table>
|
108 |
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
<tr>
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
</td>
|
117 |
</tr>
|
118 |
-
<?php //select con tutte le categorie ?>
|
119 |
<tr>
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
<?php
|
145 |
-
foreach ($categoriesCollection as $category) {
|
146 |
-
//var_dump($product);
|
147 |
-
if ($category->getLevel() == 2):
|
148 |
-
echo '<option value="'.$category->getData('entity_id').'">'.($category->getData('name')).'</option>';
|
149 |
-
endif;
|
150 |
-
}
|
151 |
-
?>
|
152 |
-
</select>
|
153 |
-
</td>
|
154 |
</tr>
|
155 |
|
156 |
<tr>
|
157 |
<td colspan="2">
|
158 |
-
|
159 |
-
|
160 |
-
</strong></td>
|
161 |
</tr>
|
162 |
<tr>
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
|
|
177 |
|
178 |
-
|
179 |
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
</tr>
|
188 |
-
|
189 |
<tr>
|
190 |
-
<td
|
191 |
-
<
|
192 |
-
|
193 |
-
</
|
194 |
</tr>
|
|
|
|
|
|
|
195 |
<tr>
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
foreach ($countries as $country){
|
209 |
-
if ($country['value'] == $mailupCountry)
|
210 |
-
echo '<option value="'.$country['value'].'">'.$country['label'].'</option>';
|
211 |
-
}
|
212 |
-
|
213 |
-
}
|
214 |
-
?>
|
215 |
-
|
216 |
-
<option value="0">-- <?=$this->__('Any')?> --</option>
|
217 |
-
|
218 |
-
<?php
|
219 |
-
foreach ($countries as $country){
|
220 |
-
echo '<option value="'.$country['value'].'">'.$country['label'].'</option>';
|
221 |
-
}
|
222 |
-
?>
|
223 |
-
</select>
|
224 |
-
</td>
|
225 |
</tr>
|
|
|
226 |
<tr>
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
</tr>
|
232 |
|
233 |
<tr>
|
234 |
<td colspan="2">
|
235 |
-
|
236 |
-
|
237 |
-
</strong></td>
|
238 |
</tr>
|
239 |
<tr>
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
</tr>
|
245 |
<tr>
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
</tr>
|
251 |
-
|
252 |
<tr>
|
253 |
<td colspan="2">
|
254 |
-
|
255 |
-
|
256 |
-
</strong></td>
|
257 |
</tr>
|
258 |
<tr>
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
|
|
278 |
</tr>
|
279 |
|
280 |
<tr>
|
281 |
<td colspan="2">
|
282 |
-
|
283 |
-
|
284 |
-
</strong></td>
|
285 |
</tr>
|
286 |
|
287 |
<tr>
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
</tr>
|
301 |
<tr>
|
302 |
-
|
303 |
</tr>
|
304 |
|
305 |
<tr>
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
</tr>
|
311 |
<tr>
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
</tr>
|
317 |
-
|
318 |
-
|
319 |
-
</fieldset>
|
320 |
</form>
|
321 |
|
322 |
<!-- Secondo blocco -->
|
323 |
<h4><span id="spantitle1"><a name="ottsugg"><?=$this->__('Filter hints')?></a></span></h4>
|
324 |
-
<fieldset id="my-
|
325 |
<table cellspacing="0" class="form-list">
|
326 |
<tr>
|
327 |
-
|
328 |
</tr>
|
329 |
<tr>
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
</tr>
|
342 |
<tr>
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
</tr>
|
356 |
<tr>
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
</tr>
|
370 |
</table>
|
371 |
</fieldset>
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
<?php } ?>
|
28 |
if ($login > 0 || strlen(Mage::getStoreConfig('newsletter/mailup/list')) < 2) {
|
29 |
echo $this->__('WARNING: before proceeding you must correctly configure the settings of MailUp access in System->Configuration->Newsletter->MailUp');
|
30 |
} else {
|
31 |
+
//controllo se la lista e' stata selezionata correttamente
|
32 |
$MailUpWsImport = Mage::getModel('mailup/ws');
|
33 |
$wsImport = new MailUpWsImport();
|
34 |
$mailupLists = $wsImport->GetNlList();
|
52 |
$mailupOrderEndDate = $this->getRequest()->getParam('mailupOrderEndDate');
|
53 |
$mailupOrderYesNo = $this->getRequest()->getParam('mailupOrderYesNo');
|
54 |
$mailupSubscribed = $this->getRequest()->getParam('mailupSubscribed');
|
55 |
+
?>
|
56 |
|
57 |
+
<div class="content-header">
|
58 |
<table cellspacing="0" class="grid-header">
|
59 |
<tr>
|
60 |
<td><h3><?=$this->__('MailUp')?></h3></td>
|
63 |
</td>
|
64 |
</tr>
|
65 |
</table>
|
66 |
+
</div>
|
67 |
+
|
68 |
+
<div class="entry-edit">
|
69 |
<form id="edit_form" name="edit_form" method="post" action="<?=$this->getUrl('*/*/confirm')?>">
|
70 |
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
71 |
<h4><span id="spantitle2"><?=$this->__('Filter customers')?></span><span id="spansugger"><a href="#ottsugg"><?=$this->__('Get hints')?> ⇒</a></span></h4>
|
73 |
<fieldset id="my-fieldset">
|
74 |
<table cellspacing="0" class="form-list">
|
75 |
<tr>
|
76 |
+
<td colspan="3"><?=$this->__('By this plugin you can import contacts registered in your eCommerce in the MailUp platform.')?></td>
|
77 |
</tr>
|
78 |
<tr>
|
79 |
+
<td colspan="3"> </td>
|
80 |
</tr>
|
81 |
<tr>
|
82 |
<td colspan="3">
|
83 |
+
<strong><?=$this->__('Sold products')?></strong>
|
84 |
+
</td>
|
|
|
85 |
</tr>
|
86 |
+
|
87 |
<?php //imposto il filtro per clienti: 0 = tutti, 1 = che hanno acquistato, 2 = che non hanno mai acquistato ?>
|
88 |
+
<tr>
|
89 |
+
<td class="input-ele spdnpg1">
|
90 |
+
<input type="radio" name="mailupCustomers" id="mailupCustomersAll" value="0" <?php if (isset($mailupCustomers) && $mailupCustomers == 0) { echo 'checked="checked"'; } ?> onclick="customerDependentFilters(false);" /> <label for="mailupCustomersAll"><?=$this->__('All customers')?></label>
|
91 |
+
</td>
|
92 |
+
|
93 |
+
<td class="input-ele spdnpg1">
|
94 |
+
<input type="radio" name="mailupCustomers" id="mailupCustomersWhoHaveBought" value="1" <?php if (isset($mailupCustomers) && $mailupCustomers == 1) { echo 'checked="checked"'; } ?> onclick="customerDependentFilters(false);" /> <label for="mailupCustomersWhoHaveBought"><?=$this->__('Customers who have purchased')?></label>
|
95 |
+
</td>
|
96 |
+
|
97 |
+
<td class="input-ele spdnpg1">
|
98 |
+
<input type="radio" name="mailupCustomers" id="mailupCustomersWhoHaventBought" value="2" <?php if (isset($mailupCustomers) && $mailupCustomers == 2) { echo 'checked="checked"'; } ?> onclick="customerDependentFilters(true);" /> <label for="mailupCustomersWhoHaventBought"><?=$this->__("Customers who haven't purchased yet")?></label>
|
99 |
+
</td>
|
100 |
+
</tr>
|
101 |
<tr>
|
102 |
+
<td colspan="3">
|
103 |
+
<input type="checkbox" name="mailupSubscribed" id="mailupSubscribed" value="1" <?php if (isset($mailupSubscribed) && $mailupSubscribed == 1) { echo 'checked="checked"'; } ?> /> <label for="mailupSubscribed"><?php echo $this->__("Subscribed to Newsletter"); ?></label>
|
104 |
+
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
</tr>
|
|
|
|
|
106 |
</table>
|
107 |
|
108 |
+
<br /><br />
|
109 |
+
|
110 |
+
<table cellspacing="0" class="form-list">
|
111 |
<tr>
|
112 |
+
<td colspan="2">
|
113 |
+
<strong><?=$this->__('Groups')?></strong>
|
114 |
+
</td>
|
|
|
115 |
</tr>
|
|
|
116 |
<tr>
|
117 |
+
<td class="labelpg1"><?=$this->__('Select customer group')?></td>
|
118 |
+
<td class="input-ele">
|
119 |
+
<select name="mailupCustomerGroupId" class="slctpg1">
|
120 |
+
<?php
|
121 |
+
$customerGroups = Mage::helper('customer')->getGroups()->toOptionArray();
|
122 |
+
|
123 |
+
if ($mailupCustomerGroupId) {
|
124 |
+
foreach ($customerGroups as $customerGroup) {
|
125 |
+
if ($mailupCustomerGroupId == $customerGroup['value']) {
|
126 |
+
echo '<option value="'.$customerGroup['value'].'">'.$customerGroup['label'].'</option>';
|
127 |
+
}
|
128 |
+
}
|
129 |
+
}
|
130 |
+
?>
|
131 |
+
|
132 |
+
<option value="0">-- <?=$this->__('Any')?> --</option>
|
133 |
+
|
134 |
+
<?php
|
135 |
+
foreach ($customerGroups as $customerGroup) {
|
136 |
+
echo '<option value="'.$customerGroup['value'].'">'.$customerGroup['label'].'</option>';
|
137 |
+
}
|
138 |
+
?>
|
139 |
+
</select>
|
140 |
+
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
</tr>
|
142 |
|
143 |
<tr>
|
144 |
<td colspan="2">
|
145 |
+
<br /><br /><strong><?=$this->__('Country')?></strong>
|
146 |
+
</td>
|
|
|
147 |
</tr>
|
148 |
<tr>
|
149 |
+
<td class="labelpg1"><?=$this->__('Select country')?></td>
|
150 |
+
<td class="input-ele">
|
151 |
+
<select name="mailupCountry" class="slctpg1">
|
152 |
+
<?php
|
153 |
+
$countries = Mage::getResourceModel('directory/country_collection')
|
154 |
+
->loadData()
|
155 |
+
->toOptionArray(false);
|
156 |
+
|
157 |
+
if ($mailupCountry) {
|
158 |
+
foreach ($countries as $country){
|
159 |
+
if ($country['value'] == $mailupCountry)
|
160 |
+
echo '<option value="'.$country['value'].'">'.$country['label'].'</option>';
|
161 |
+
}
|
162 |
+
}
|
163 |
+
?>
|
164 |
|
165 |
+
<option value="0">-- <?=$this->__('Any')?> --</option>
|
166 |
|
167 |
+
<?php
|
168 |
+
foreach ($countries as $country) {
|
169 |
+
echo '<option value="'.$country['value'].'">'.$country['label'].'</option>';
|
170 |
+
}
|
171 |
+
?>
|
172 |
+
</select>
|
173 |
+
</td>
|
174 |
</tr>
|
|
|
175 |
<tr>
|
176 |
+
<td class="labelpg1"><?=$this->__('Zip code')?></td>
|
177 |
+
<td class="input-ele">
|
178 |
+
<input type="text" class="inptptx1" name="mailupPostCode" size="10" value="<?php echo $mailupPostCode; ?>" />
|
179 |
+
</td>
|
180 |
</tr>
|
181 |
+
</table>
|
182 |
+
|
183 |
+
<table cellspacing="0" class="form-list" id="customerDependentContainer">
|
184 |
<tr>
|
185 |
+
<td colspan="2">
|
186 |
+
<br /><br /><strong><?=$this->__('Prodotti e categorie')?></strong>
|
187 |
+
</td>
|
188 |
+
</tr>
|
189 |
+
|
190 |
+
<?php //select con tutti i prodotti ?>
|
191 |
+
<tr>
|
192 |
+
<td class="labelpg1"><?=$this->__('Insert product SKU')?></td>
|
193 |
+
<td class="input-ele">
|
194 |
+
<input type="text" class="inptptx1 customerDependent" name="mailupProductSku" size="30" value="<?php echo $mailupProductSku; ?>" />
|
195 |
+
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
</tr>
|
197 |
+
<?php //select con tutte le categorie ?>
|
198 |
<tr>
|
199 |
+
<td class="labelpg1"><?=$this->__('Select category')?></td>
|
200 |
+
<td class="input-ele">
|
201 |
+
<?php
|
202 |
+
$categoriesCollection = Mage::getModel('catalog/category')->getCollection();
|
203 |
+
$categoriesCollection->addAttributeToSelect('name');
|
204 |
+
$categoriesCollection->addAttributeToSelect('entity_id');
|
205 |
+
?>
|
206 |
+
<select id="mailupCategoryId" name="mailupCategoryId" class="slctpg1 customerDependent">
|
207 |
+
<?php
|
208 |
+
if ($mailupCategoryId) {
|
209 |
+
$category = Mage::getModel('catalog/category')->load($mailupCategoryId);
|
210 |
+
echo '<option value="'.$mailupCategoryId.'">'.$category->getData('name').'</option>';
|
211 |
+
}
|
212 |
+
?>
|
213 |
+
|
214 |
+
<option value="0">-- <?=$this->__('Any')?> --</option>
|
215 |
+
|
216 |
+
<?php
|
217 |
+
foreach ($categoriesCollection as $category) {
|
218 |
+
if ($category->getLevel() == 2) {
|
219 |
+
echo '<option value="'.$category->getData('entity_id').'">'.($category->getData('name')).'</option>';
|
220 |
+
}
|
221 |
+
}
|
222 |
+
?>
|
223 |
+
</select>
|
224 |
+
</td>
|
225 |
</tr>
|
226 |
|
227 |
<tr>
|
228 |
<td colspan="2">
|
229 |
+
<br /><br /><strong><?=$this->__('Data di iscrizione')?></strong>
|
230 |
+
</td>
|
|
|
231 |
</tr>
|
232 |
<tr>
|
233 |
+
<td class="labelpg1"><?=$this->__('From')?></td>
|
234 |
+
<td class="input-ele">
|
235 |
+
<input type="text" class="inptptx1 customerDependent" name="mailupCustomerStartDate" size="20" value="<?php echo $mailupCustomerStartDate; ?>" /> (dd/mm/yyyy)
|
236 |
+
</td>
|
237 |
</tr>
|
238 |
<tr>
|
239 |
+
<td class="labelpg1"><?=$this->__('To')?></td>
|
240 |
+
<td class="input-ele">
|
241 |
+
<input type="text" class="inptptx1 customerDependent" name="mailupCustomerEndDate" size="20" value="<?php echo $mailupCustomerEndDate; ?>" /> (dd/mm/yyyy)
|
242 |
+
</td>
|
243 |
</tr>
|
|
|
244 |
<tr>
|
245 |
<td colspan="2">
|
246 |
+
<br /><br /><strong><?=$this->__('Total purchased amount')?></strong>
|
247 |
+
</td>
|
|
|
248 |
</tr>
|
249 |
<tr>
|
250 |
+
<td class="labelpg1"><?=$this->__('Order total')?></td>
|
251 |
+
<td class="input-ele">
|
252 |
+
<select id="mailupTotalAmountCond" name="mailupTotalAmountCond" class="slctpg2 customerDependent">
|
253 |
+
<?php
|
254 |
+
if ($mailupTotalAmountCond && $mailupTotalAmountCond != 'gt') {
|
255 |
+
if ($mailupTotalAmountCond == 'lt') {
|
256 |
+
echo '<option value="lt"> '.$this->__('less than').' </option>';
|
257 |
+
} elseif ($mailupTotalAmountCond == 'eq') {
|
258 |
+
echo '<option value="eq"> '.$this->__('same as').' </option>';
|
259 |
+
}
|
260 |
+
}
|
261 |
+
?>
|
262 |
+
<option value="gt"> <?=$this->__('more than')?> </option>
|
263 |
+
<option value="lt"> <?=$this->__('less than')?> </option>
|
264 |
+
<option value="eq"> <?=$this->__('same as')?> </option>
|
265 |
+
</select>
|
266 |
+
|
267 |
+
<label for="mailupTotalAmountValue" class="lbl1"><?=$this->__('Specify amount')?></label>
|
268 |
+
<input type="text" class="inptptx1 customerDependent" id="mailupTotalAmountValue" name="mailupTotalAmountValue" size="20" value="<?php echo $mailupTotalAmountValue; ?>" />
|
269 |
+
</td>
|
270 |
</tr>
|
271 |
|
272 |
<tr>
|
273 |
<td colspan="2">
|
274 |
+
<br /><br /><strong><?=$this->__('Date of purchase')?></strong>
|
275 |
+
</td>
|
|
|
276 |
</tr>
|
277 |
|
278 |
<tr>
|
279 |
+
<td><?=$this->__('Show customers who'); ?></td>
|
280 |
+
<td>
|
281 |
+
<select name="mailupOrderYesNo" class="slctpg2 customerDependent">
|
282 |
+
<?php
|
283 |
+
if ($mailupOrderYesNo == 'no') {
|
284 |
+
echo '<option value="no">'.$this->__("Haven't purchased").'</option>';
|
285 |
+
}
|
286 |
+
?>
|
287 |
+
<option value="yes"> <?=$this->__('Have purchased'); ?> </option>
|
288 |
+
<option value="no"> <?=$this->__("Haven't purchased"); ?> </option>
|
289 |
+
</select>
|
290 |
+
</td>
|
291 |
</tr>
|
292 |
<tr>
|
293 |
+
<td colspan="2"><?=$this->__('In this period'); ?>:</td>
|
294 |
</tr>
|
295 |
|
296 |
<tr>
|
297 |
+
<td class="labelpg1"><?=$this->__('From')?></td>
|
298 |
+
<td class="input-ele">
|
299 |
+
<input type="text" class="inptptx1 customerDependent" name="mailupOrderStartDate" size="20" value="<?php echo $mailupOrderStartDate; ?>" /> (dd/mm/yyyy)
|
300 |
+
</td>
|
301 |
</tr>
|
302 |
<tr>
|
303 |
+
<td class="labelpg1"><?=$this->__('To')?></td>
|
304 |
+
<td class="input-ele">
|
305 |
+
<input type="text" class="inptptx1 customerDependent" name="mailupOrderEndDate" size="20" value="<?php echo $mailupOrderEndDate; ?>" /> (dd/mm/yyyy)
|
306 |
+
</td>
|
307 |
</tr>
|
308 |
+
</table>
|
309 |
+
</fieldset>
|
|
|
310 |
</form>
|
311 |
|
312 |
<!-- Secondo blocco -->
|
313 |
<h4><span id="spantitle1"><a name="ottsugg"><?=$this->__('Filter hints')?></a></span></h4>
|
314 |
+
<fieldset id="my-fieldset2">
|
315 |
<table cellspacing="0" class="form-list">
|
316 |
<tr>
|
317 |
+
<td><?=$this->__('Set and customize one of the following filters:')?></td>
|
318 |
</tr>
|
319 |
<tr>
|
320 |
+
<td>
|
321 |
+
<form action="*/*/" id="filtro1" name="filtro1" method="post">
|
322 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
323 |
+
<input name="mailupCustomers" type="hidden" value="2" />
|
324 |
+
<input name="mailupCustomerGroupId" type="hidden" value="2" />
|
325 |
+
<p class="parscefil"><?=$this->__("All wholesale customers who haven't purchased yet")?> »</p>
|
326 |
+
<input type="submit" value="<?=$this->__('Set filter')?>" />
|
327 |
+
<!-- <button onclick="filtro1.submit()" class="scalable save" type="button"><span><?=$this->__('Set filter')?></span></button>
|
328 |
+
<input type="submit" value="Imposta filtro" /> -->
|
329 |
+
</form>
|
330 |
+
</td>
|
331 |
</tr>
|
332 |
<tr>
|
333 |
+
<td>
|
334 |
+
<form action="*/*/" id="filtro2" name="filtro2" method="post">
|
335 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
336 |
+
<input name="mailupCustomers" type="hidden" value="1" />
|
337 |
+
<input name="mailupTotalAmountCond" type="hidden" value="gt" />
|
338 |
+
<input name="mailupTotalAmountValue" type="hidden" value="50" />
|
339 |
+
<p class="parscefil"><?=$this->__('More than 50 Euros orders')?> »</p>
|
340 |
+
<input type="submit" value="<?=$this->__('Set filter')?>" />
|
341 |
+
<!-- <button onclick="filtro2.submit()" class="scalable save" type="button"><span><?=$this->__('Set filter')?></span></button>
|
342 |
+
<input type="submit" value="Imposta filtro" /> -->
|
343 |
+
</form>
|
344 |
+
</td>
|
345 |
</tr>
|
346 |
<tr>
|
347 |
+
<td>
|
348 |
+
<form action="*/*/" id="filtro3" name="filtro2" method="post">
|
349 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
350 |
+
<input name="mailupCustomers" type="hidden" value="0" />
|
351 |
+
<input name="mailupOrderYesNo" type="hidden" value="no" />
|
352 |
+
<input name="mailupOrderStartDate" type="hidden" value="01/01/<?php echo date('Y'); ?>" />
|
353 |
+
<p class="parscefil"><?=$this->__('Members with no purchase in')?> <?php echo date('Y'); ?> »</p>
|
354 |
+
<input type="submit" value="<?=$this->__('Set filter')?>" />
|
355 |
+
<!-- <button onclick="filtro3.submit()" class="scalable save" type="button"><span><?=$this->__('Set filter')?></span></button>
|
356 |
+
<input type="submit" value="Imposta filtro" /> -->
|
357 |
+
</form>
|
358 |
+
</td>
|
359 |
</tr>
|
360 |
</table>
|
361 |
</fieldset>
|
362 |
+
</div>
|
363 |
+
<script type="text/javascript">
|
364 |
+
var editForm = new varienForm('edit_form');
|
365 |
+
</script>
|
366 |
+
<script type="text/javascript">
|
367 |
+
document.getElementsByClassName = function(className) {
|
368 |
+
var retnode = [];
|
369 |
+
var myclass = new RegExp('\\b'+className+'\\b');
|
370 |
+
var elements = this.getElementsByTagName('*');
|
371 |
+
var elementsLength = elements.length;
|
372 |
+
var element = null;
|
373 |
+
for (var i = 0; i < elementsLength; i++) {
|
374 |
+
element = elements[i];
|
375 |
+
if (myclass.test(element.className)) {
|
376 |
+
retnode.push(element);
|
377 |
+
}
|
378 |
+
}
|
379 |
+
return retnode;
|
380 |
+
};
|
381 |
+
|
382 |
+
function customerDependentFilters(isDisabled) {
|
383 |
+
document.getElementById('customerDependentContainer').style.display = (isDisabled) ? 'none' : 'block';
|
384 |
+
|
385 |
+
var elements = document.getElementsByClassName('customerDependent');
|
386 |
+
|
387 |
+
var elementsLength = elements.length;
|
388 |
+
for (var i=0; i < elementsLength; i++) {
|
389 |
+
elements[i].disabled = isDisabled;
|
390 |
+
}
|
391 |
+
}
|
392 |
+
|
393 |
+
window.onload = function() {
|
394 |
+
var isDisabled = document.getElementById('mailupCustomersWhoHaventBought').checked;
|
395 |
+
customerDependentFilters(isDisabled);
|
396 |
+
}
|
397 |
+
</script>
|
398 |
<?php } ?>
|
package.xml
CHANGED
@@ -1,48 +1,55 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>MailUp</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
-
<license>AFL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
<compatible/>
|
47 |
-
<dependencies
|
48 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>MailUp</name>
|
4 |
+
<version>0.3.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Filter customers based on profile and sales history, and send them targeted messages. Support automatic messages too.</summary>
|
10 |
+
<description><p>MailUp is a multi-channel marketing platform, used by thousands of companies around the world to send targeted email and text messages.</p>
|
11 |
+
<p>Robust and scalable, MailUp can handles large volumes and has long-term relationships with all the major international ISPs, including automatic Feedback Loop management and support for List-Unsubscribe. Over 10 billion messages were sent with MailUp in 2010.</p>
|
12 |
+
<p>Using MailUp with your Magento store ensures a high level of deliverability for your emails.</p>
|
13 |
+
<p>Once you install the MailUp extension, you will be able to run professional email marketing campaigns by easily filtering customers and seemlessly passing the data to MailUp, which will handle the sending and tracking of the messages.</p>
|
14 |
+
<p>The MailUp extension requires a MailUp account. If you are not already a customer, setup a free trial to check it out!</p>
|
15 |
+

|
16 |
+
<p>For more advanced marketing campaigns, leverage MailUp’s optional Marketing+ feature. It allows you to create “event-based” messages that are sent automatically when a certain condition occurs (e.g. automatically send a discount to your customers on their birthday). Features include:</p>
|
17 |
+
<ul>
|
18 |
+
<li>create unlimited “event-based” messages</li>
|
19 |
+
<li>easily turn them on/off</li>
|
20 |
+
<li>specify how often the system will check for the condition to occur (e.g. daily, monthly, annually, one-time)</li>
|
21 |
+
<li>combine multiple filters to define the condition that will trigger the message (e.g. send a second “Welcome” message N days after the customer subscribed)</li>
|
22 |
+
<li>send a message to a specific group or any subscriber</li>
|
23 |
+
<li>create conditions that are based on customer behavior (e.g. whether a previous message was opened or not)</li>
|
24 |
+
<li>use ecommerce data to as a condition to trigger messages (e.g. total amount purchased; days since last purchase; etc.)</li>
|
25 |
+
<li>use the same feature to send text messages (SMS) too!</li>
|
26 |
+
</ul>
|
27 |
+
<p>For example, store the date of the last order in a MailUp custom field, then send a discount to promote a new purchase 60 days after that last order was placed.</p>
|
28 |
+

|
29 |
+
<p>===========================================================</p>
|
30 |
+

|
31 |
+
<p>MailUp &egrave; un servizio nato nel 2002, totalmente "web based" , che consente l'invio di e-mail, newsletter, sms, fax, lettere cartacee e messaggi vocali pre-registrati.</p>
|
32 |
+
<p>La soluzione &egrave; studiata appositamente per la gestione professionale e l'invio di elevati quantitativi di messaggi, con gestione della banda, invii di test e gestione delle code di uscita.</p>
|
33 |
+
<p>Le e-mail vengono inviate dai server di MailUp, questo garantisce elevati tassi di deliverability, evitando che le mail vengano bloccate dai filtri antispam.</p>
|
34 |
+
<p>Installando questo Plugin per Magento potrete importare nella piattaforma MailUP i nominativi registrati nel vostro eCommerce.</p>
|
35 |
+
<p>Prova gratuitamente MailUp per 30 giorni</p>
|
36 |
+

|
37 |
+
<p>Con la funzione INVII AUTOMATICI contenuta nel pacchetto opzionale Marketing+ &egrave; possibile inviare in automatico email e sms, a seconda del verificarsi di condizioni o eventi. Si potranno inviare alert, auguri di compleanno, reminder, solleciti tramite email e/o sms in base a regole predefinite, per esempio in prossimit&agrave; della scadenza di un contratto o un anniversario.<br /><br />Tramite l'opzione INVII AUTOMATICI, &egrave; possibile</p>
|
38 |
+
<ul>
|
39 |
+
<li>creare infiniti messaggi email o sms;</li>
|
40 |
+
<li>stabilire il periodo in cui devono essere abilitati o meno;</li>
|
41 |
+
<li>la frequenza di invio (es. giornaliera, mensile o annuale);</li>
|
42 |
+
<li>stabilire le condizioni tramite l'utilizzo dei filtri anagrafica (es. compleanno, campi vuoti) o attivit&agrave; (es. iscrizione oppure se un utente non ha aperto il messaggio si pu&ograve; programmare un invio automatico di un secondo messaggio)</li>
|
43 |
+
<li>stabilire se inviare ad un gruppo specifico di utenti o a tutto il mio database</li>
|
44 |
+
<li>alimentare la banca dati tramite API o web service o procedure batch ftp notturne;</li>
|
45 |
+
<li>gestire e configurare automatismi tramite una intuitiva interfaccia web.</li>
|
46 |
+
</ul>
|
47 |
+
<p><br />Ad esempio un sito di ecommerce potrebbe alimentare il DB di MailUp con informazioni sugli acquisti e MailUp potr&agrave; quindi inviare, ad esempio dopo 7 giorni dall'acquisto, un messaggio di costumer satisfaction oppure l'invito ad acquistare un prodotto correlato.</p></description>
|
48 |
+
<notes>Refactoring to support newer versions of Magento, layout enhancements</notes>
|
49 |
+
<authors><author><name>Sevenlike</name><user>sevenlike</user><email>moduli-magento@sevenlike.com</email></author></authors>
|
50 |
+
<date>2012-01-25</date>
|
51 |
+
<time>2012-01-25</time>
|
52 |
+
<contents><target name="magelocal"><dir name="SevenLike"><dir name="MailUp"><dir name="Block"><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="15b30e8e02a50054be62bb6ee2458ac5"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Model"><file name="Cron.php" hash="ca450afd264de7a840d4f2c8f4916697"/><file name="Lists.php" hash="1a4c1bf8ca0135bfe48e8243b7c57070"/><file name="MailUp.php" hash="2829fb8a8ad6317ce5b2a28a2fe0149d"/><dir name="Mysql14"><dir name="MailUp"><file name="Collection.php" hash="1435c91e677f7b668079373599aae3eb"/></dir><file name="MailUp.php" hash="4e6e23f0eccdfe35776d1e8eab68692a"/></dir><file name="Ws.php" hash="cda8d8609e9f823afc273fc7b69d7183"/><file name="Wssend.php" hash="2d9d936bd9dad015e4ce143c1e7653de"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FilterController.php" hash="fc75d411d37752139ad111e7595c35c9"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="config.xml" hash="1f2dd623f0486599874b9d54ed09d857"/><file name="system.xml" hash="27b5a26b450b8bdd8b4b46900f38af45"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="sql"><dir name="mailup_setup"><file name="mysql4-install-0.1.0.php" hash="022c3ba8a7d802aba927353096c826fc"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="sevenlike"><dir name="mailup"><file name="confirm.phtml" hash="d1cd6978de19c79a114ee7dc6afc3268"/><file name="filter.phtml" hash="8c69f953b3fc6b02abd33fa1b4596e62"/></dir></dir></dir><dir name="layout"><file name="mailup.xml" hash="eda776bc6cd233c52ef06f2046969665"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SevenLike_MailUp.xml" hash="8377b55193e7524ca9572ed4dc2dca62"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="sevenlike"><dir name="mailup"><dir name="images"><file name="titoli.png" hash="95a7996cd77d3413fd048018095aec6e"/></dir><file name="mailup.css" hash="4f935afe2e7b1c9de7c47795bca1f206"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="SevenLike_MailUp.csv" hash="e870074bec24801c911e62e4e70b61e9"/></dir><dir name="it_IT"><file name="SevenLike_MailUp.csv" hash="dd3bc84f1c4273b6683a640027aa78d9"/></dir></target></contents>
|
53 |
<compatible/>
|
54 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
55 |
</package>
|