Evalor_Evconnector - Version 1.0.0

Version Notes

Stable release

Download this release

Release Info

Developer Magento Core Team
Extension Evalor_Evconnector
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Evalor/Evconnector/Helper/Data.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Evalor
4
+ * http://www.Evalor.es
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Evalor
17
+ * @package Evalor_Evconnector
18
+ * @author Evalor <info@evalor.es>
19
+ * @copyright Copyright (c) 2014 (http://www.Evalor.es)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Evalor_Evconnector_Helper_Data extends Mage_Core_Helper_Abstract {
24
+
25
+ }
app/code/local/Evalor/Evconnector/Model/Observer.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Evalor
4
+ * http://www.Evalor.es
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Evalor
17
+ * @package Evalor_Evconnector
18
+ * @author Evalor <info@evalor.es>
19
+ * @copyright Copyright (c) 2014 (http://www.Evalor.es)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ *
22
+ */
23
+
24
+ class Evalor_Evconnector_Model_Observer {
25
+
26
+ public function sendInvitation($order) {
27
+
28
+ // Get all order details
29
+ $order_id = $order->getIncrementId();
30
+ $webstore_id = Mage::getStoreConfig('evconnector/api/webstore_id', $order->getStoreId());
31
+ $api_key = Mage::getStoreConfig('evconnector/api/api_key', $order->getStoreId());
32
+ $delay = Mage::getStoreConfig('evconnector/invitation/delay', $order->getStoreId());
33
+ $email = $order->getCustomerEmail();
34
+ $api_url = 'http://www.evalor.es/api.php?id=' . $webstore_id . '&password=' . $api_key . '&email=' . $email . '&order=' . $order_id . '&delay=' . $delay;
35
+
36
+ // Connect to API
37
+ $winkelconnect = curl_init($api_url);
38
+ curl_setopt($winkelconnect, CURLOPT_VERBOSE, 1);
39
+ curl_setopt($winkelconnect, CURLOPT_FAILONERROR, false);
40
+ curl_setopt($winkelconnect, CURLOPT_HEADER, 0);
41
+ curl_setopt($winkelconnect, CURLOPT_FOLLOWLOCATION, 1);
42
+ curl_setopt($winkelconnect, CURLOPT_RETURNTRANSFER, 1);
43
+ curl_setopt($winkelconnect, CURLOPT_SSL_VERIFYPEER, false);
44
+ $repsonse = curl_exec($winkelconnect);
45
+ curl_close($winkelconnect);
46
+
47
+ // Write to Magento log
48
+ if(Mage::getStoreConfig('evconnector/invitation/debug')):
49
+ Mage::log('========');
50
+ Mage::log('Evalor - ' . $api_url);
51
+ Mage::log('Evalor - ' . $repsonse);
52
+ Mage::log('========');
53
+ endif;
54
+
55
+ }
56
+
57
+ public function processInvitationAfterShipment($observer) {
58
+
59
+ $shipment = $observer->getEvent()->getShipment();
60
+ $order = $shipment->getOrder();
61
+ if((Mage::getStoreConfig('evconnector/invitation/enabled', $order->getStoreId())) && (Mage::getStoreConfig('evconnector/api/api_key', $order->getStoreId()))):
62
+ if($order->getStatus() == Mage::getStoreConfig('evconnector/invitation/status', $order->getStoreId())):
63
+ if(Mage::getStoreConfig('evconnector/invitation/backlog', $order->getStoreId()) > 0):
64
+ $date_diff = floor(time() - strtotime($order->getCreatedAt()))/(60*60*24);
65
+ if($date_diff < Mage::getStoreConfig('evconnector/invitation/backlog', $order->getStoreId())):
66
+ $this->sendInvitation($order);
67
+ endif;
68
+ else:
69
+ $this->sendInvitation($order);
70
+ endif;
71
+ endif;
72
+ endif;
73
+
74
+ }
75
+
76
+ public function processInvitation($observer) {
77
+
78
+ $order = $observer->getEvent()->getOrder();
79
+ if((Mage::getStoreConfig('evconnector/invitation/enabled', $order->getStoreId())) && (Mage::getStoreConfig('evconnector/api/api_key', $order->getStoreId()))):
80
+ if($order->getStatus() == Mage::getStoreConfig('evconnector/invitation/status', $order->getStoreId())):
81
+ if(Mage::getStoreConfig('evconnector/invitation/backlog', $order->getStoreId()) > 0):
82
+ $date_diff = floor(time() - strtotime($order->getCreatedAt()))/(60*60*24);
83
+ if($date_diff < Mage::getStoreConfig('evconnector/invitation/backlog', $order->getStoreId())):
84
+ $this->sendInvitation($order);
85
+ endif;
86
+ else:
87
+ $this->sendInvitation($order);
88
+ endif;
89
+ endif;
90
+ endif;
91
+
92
+ }
93
+
94
+ }
app/code/local/Evalor/Evconnector/Model/System/Config/Source/Position.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Evalor
4
+ * http://www.Evalor.es
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Evalor
17
+ * @package Evalor_Evconnector
18
+ * @author Evalor <info@evalor.es>
19
+ * @copyright Copyright (c) 2014 (http://www.Evalor.es)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ *
22
+ **/
23
+
24
+ class Evalor_Evconnector_Model_System_Config_Source_Position {
25
+
26
+ public function toOptionArray()
27
+ {
28
+ $position = array();
29
+ $position[] = array('value'=>'left', 'label'=> Mage::helper('evconnector')->__('Izquierda'));
30
+ $position[] = array('value'=>'right', 'label'=> Mage::helper('evconnector')->__('Derecha'));
31
+ return $position;
32
+ }
33
+
34
+ }
app/code/local/Evalor/Evconnector/Model/System/Config/Source/Status.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Evalor
4
+ * http://www.Evalor.es
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Evalor
17
+ * @package Evalor_Evconnector
18
+ * @author Evalor <info@evalor.es>
19
+ * @copyright Copyright (c) 2014 (http://www.Evalor.es)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ *
22
+ **/
23
+
24
+ class Evalor_Evconnector_Model_System_Config_Source_Status {
25
+
26
+ public function toOptionArray()
27
+ {
28
+ $storeModel = Mage::getSingleton('adminhtml/system_store');
29
+ $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
30
+ $options = array();
31
+
32
+ $this->_options = array(array(
33
+ 'value' => 0,
34
+ 'label' => Mage::helper('evconnector') -> __('-- none'),
35
+ ));
36
+
37
+ foreach($statuses as $k=>$v)
38
+ {
39
+ $options[] = array('label' => $v, 'value' => $k);
40
+ }
41
+ $this->_options = array_merge($this->_options, $options);
42
+ return $this->_options;
43
+ }
44
+
45
+ }
app/code/local/Evalor/Evconnector/etc/adminhtml.xml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Evalor
5
+ * http://www.Evalor.es
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to info@magmodules.eu so we can send you a copy immediately.
16
+ *
17
+ * @category Evalor
18
+ * @package Evalor_Evconnector
19
+ * @author Evalor <info@evalor.es>
20
+ * @copyright Copyright (c) 2014 (http://www.Evalor.es)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <acl>
26
+ <resources>
27
+ <admin>
28
+ <children>
29
+ <system>
30
+ <children>
31
+ <config>
32
+ <children>
33
+ <evconnector translate="title" module="evconnector">
34
+ <title>Evalor Evconnector</title>
35
+ </evconnector>
36
+ </children>
37
+ </config>
38
+ </children>
39
+ </system>
40
+ </children>
41
+ </admin>
42
+ </resources>
43
+ </acl>
44
+ </config>
app/code/local/Evalor/Evconnector/etc/config.xml ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Evalor
5
+ * http://www.Evalor.es
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to info@magmodules.eu so we can send you a copy immediately.
16
+ *
17
+ * @category Evalor
18
+ * @package Evalor_Evconnector
19
+ * @author Evalor <info@evalor.es>
20
+ * @copyright Copyright (c) 2014 (http://www.Evalor.es)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <Evalor_Evconnector>
27
+ <version>1.0.0</version>
28
+ </Evalor_Evconnector>
29
+ </modules>
30
+ <global>
31
+ <blocks>
32
+ <evconnector>
33
+ <class>Evalor_Evconnector_Block</class>
34
+ </evconnector>
35
+ </blocks>
36
+ <models>
37
+ <evconnector>
38
+ <class>Evalor_Evconnector_Model</class>
39
+ </evconnector>
40
+ </models>
41
+ <helpers>
42
+ <evconnector>
43
+ <class>Evalor_Evconnector_Helper</class>
44
+ </evconnector>
45
+ </helpers>
46
+ <events>
47
+ <sales_order_shipment_save_after>
48
+ <observers>
49
+ <evconnector>
50
+ <type>singleton</type>
51
+ <class>evconnector/observer</class>
52
+ <method>processInvitationAfterShipment</method>
53
+ </evconnector>
54
+ </observers>
55
+ </sales_order_shipment_save_after>
56
+ <sales_order_save_commit_after>
57
+ <observers>
58
+ <evconnector>
59
+ <type>singleton</type>
60
+ <class>evconnector/observer</class>
61
+ <method>processInvitation</method>
62
+ </evconnector>
63
+ </observers>
64
+ </sales_order_save_commit_after>
65
+ </events>
66
+ </global>
67
+ <frontend>
68
+ <translate>
69
+ <modules>
70
+ <Evalor_Evconnector>
71
+ <files>
72
+ <default>Evalor_Evconnector.csv</default>
73
+ </files>
74
+ </Evalor_Evconnector>
75
+ </modules>
76
+ </translate>
77
+ <layout>
78
+ <updates>
79
+ <Evalor_Evconnector>
80
+ <file>evalor_evconnector.xml</file>
81
+ </Evalor_Evconnector>
82
+ </updates>
83
+ </layout>
84
+ </frontend>
85
+ <adminhtml>
86
+ <translate>
87
+ <modules>
88
+ <Evalor_Evconnector>
89
+ <files>
90
+ <default>Evalor_Evconnector.csv</default>
91
+ </files>
92
+ </Evalor_Evconnector>
93
+ </modules>
94
+ </translate>
95
+ </adminhtml>
96
+ <default>
97
+ <evconnector>
98
+ <frontend>
99
+ <enabled>0</enabled>
100
+ </frontend>
101
+ <invitation>
102
+ <enabled>0</enabled>
103
+ <delay>14</delay>
104
+ <backlog>30</backlog>
105
+ </invitation>
106
+ </evconnector>
107
+ </default>
108
+ </config>
app/code/local/Evalor/Evconnector/etc/system.xml ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Evalor
5
+ * http://www.Evalor.es
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to info@magmodules.eu so we can send you a copy immediately.
16
+ *
17
+ * @category Evalor
18
+ * @package Evalor_Evconnector
19
+ * @author Evalor <info@evalor.es>
20
+ * @copyright Copyright (c) 2014 (http://www.Evalor.es)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <tabs>
26
+ <evalor translate="label" module="evconnector">
27
+ <label>eValor</label>
28
+ <sort_order>400</sort_order>
29
+ </evalor>
30
+ </tabs>
31
+ <sections>
32
+ <evconnector translate="label" module="evconnector">
33
+ <label>Configuración</label>
34
+ <tab>evalor</tab>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>1</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <groups>
41
+ <api translate="label">
42
+ <label>Detalles Api</label>
43
+ <frontend_type>text</frontend_type>
44
+ <sort_order>1</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ <expanded>1</expanded>
49
+ <fields>
50
+ <webstore_id translate="label">
51
+ <label>ID de la tienda online</label>
52
+ <frontend_type>text</frontend_type>
53
+ <sort_order>1</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>1</show_in_store>
57
+ <comment>Número unico de su tienda online</comment>
58
+ <tooltip>La ID de su tienda online es la misma que su número único. La encontrará al ingresar en eValor.es > Generar sello > API.</tooltip>
59
+ </webstore_id>
60
+ <api_key translate="label">
61
+ <label>Clave API</label>
62
+ <frontend_type>text</frontend_type>
63
+ <sort_order>2</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>1</show_in_store>
67
+ <comment>Solo para el pack eValor PLUS</comment>
68
+ <tooltip>La clave API solo está disponible para socios PLUS. La encontrará al ingresar en eValor.es > Generar sello > API.</tooltip>
69
+ </api_key>
70
+ </fields>
71
+ </api>
72
+ <frontend translate="label">
73
+ <label>Sidebar eValor</label>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>2</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ <expanded>1</expanded>
80
+ <fields>
81
+ <enabled translate="label">
82
+ <label>Integración Javascript</label>
83
+ <frontend_type>select</frontend_type>
84
+ <source_model>adminhtml/system_config_source_yesno</source_model>
85
+ <sort_order>1</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ <comment>Coloque el sidebar interactivo de eValor</comment>
90
+ <tooltip>Colocar el sidebar incrementa la confianza sobre su web. Además los clientes no tendrán que salir de su tienda para comprobar sus datos, esto mejorará la conversión.</tooltip>
91
+ </enabled>
92
+ <sidebar translate="label">
93
+ <label>Mostrar sidebar</label>
94
+ <frontend_type>select</frontend_type>
95
+ <source_model>adminhtml/system_config_source_yesno</source_model>
96
+ <sort_order>2</sort_order>
97
+ <show_in_default>1</show_in_default>
98
+ <show_in_website>1</show_in_website>
99
+ <show_in_store>1</show_in_store>
100
+ <comment>Coloque el sidebar interactivo de eValor</comment>
101
+ <tooltip>Colocar el sidebar incrementa la confianza sobre su web. Además los clientes no tendrán que salir de su tienda para comprobar sus datos, esto mejorará la conversión.</tooltip>
102
+ </sidebar>
103
+ <tooltip translate="label">
104
+ <label>Tooltip</label>
105
+ <frontend_type>select</frontend_type>
106
+ <source_model>adminhtml/system_config_source_yesno</source_model>
107
+ <sort_order>3</sort_order>
108
+ <show_in_default>1</show_in_default>
109
+ <show_in_website>1</show_in_website>
110
+ <show_in_store>1</show_in_store>
111
+ </tooltip>
112
+ <sidebar_position translate="label">
113
+ <label>Posición sidebar</label>
114
+ <frontend_type>select</frontend_type>
115
+ <source_model>evconnector/system_config_source_position</source_model>
116
+ <sort_order>4</sort_order>
117
+ <show_in_default>1</show_in_default>
118
+ <show_in_website>1</show_in_website>
119
+ <show_in_store>1</show_in_store>
120
+ <comment>La posición del sidebar</comment>
121
+ </sidebar_position>
122
+ <sidebar_height translate="label">
123
+ <label>Altura sidebar</label>
124
+ <frontend_type>text</frontend_type>
125
+ <sort_order>5</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>1</show_in_website>
128
+ <show_in_store>1</show_in_store>
129
+ <comment>La altura del sidebar</comment>
130
+ </sidebar_height>
131
+ </fields>
132
+ </frontend>
133
+ <invitation translate="label">
134
+ <label>Invitación a compartir opiniones de clientes</label>
135
+ <frontend_type>text</frontend_type>
136
+ <sort_order>3</sort_order>
137
+ <show_in_default>1</show_in_default>
138
+ <show_in_website>1</show_in_website>
139
+ <show_in_store>1</show_in_store>
140
+ <expanded>1</expanded>
141
+ <fields>
142
+ <enabled translate="label">
143
+ <label>Activar</label>
144
+ <frontend_type>select</frontend_type>
145
+ <source_model>adminhtml/system_config_source_yesno</source_model>
146
+ <sort_order>1</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>1</show_in_store>
150
+ <comment>Enviar invitaciones</comment>
151
+ <tooltip>Envie de forma automática a sus clientes una invitación a compartir sus experiencias. Esta opción solo está disponible para socios PLUS.</tooltip>
152
+ </enabled>
153
+ <status>
154
+ <label>Pedido completado, su estado es</label>
155
+ <frontend_type>select</frontend_type>
156
+ <source_model>evconnector/system_config_source_status</source_model>
157
+ <sort_order>2</sort_order>
158
+ <show_in_default>1</show_in_default>
159
+ <show_in_website>1</show_in_website>
160
+ <show_in_store>1</show_in_store>
161
+ <can_be_empty>1</can_be_empty>
162
+ <comment>La invitación será enviada cuando el pedido se encuentre en este estado</comment>
163
+ <tooltip>Configure con que estado de su pedido quiere enviar la invitación. Por defecto el estado es "Completado"</tooltip>
164
+ <depends><enabled>1</enabled></depends>
165
+ </status>
166
+ <delay translate="label">
167
+ <label>Plazo</label>
168
+ <frontend_type>text</frontend_type>
169
+ <sort_order>3</sort_order>
170
+ <show_in_default>1</show_in_default>
171
+ <show_in_website>1</show_in_website>
172
+ <show_in_store>1</show_in_store>
173
+ <comment>Envíe la invitación x días después de que el pedido se haya completado</comment>
174
+ <tooltip>Gracias a esto se asegurará que el cliente reciba la invitación poco después de haber recibido el producto, en vez de antes. Esto hará más probable que quiera compartir su opinión.</tooltip>
175
+ <depends><enabled>1</enabled></depends>
176
+ </delay>
177
+ <backlog translate="label">
178
+ <label>Plazo máximo</label>
179
+ <frontend_type>text</frontend_type>
180
+ <sort_order>4</sort_order>
181
+ <show_in_default>1</show_in_default>
182
+ <show_in_website>1</show_in_website>
183
+ <show_in_store>1</show_in_store>
184
+ <comment>Solo cambiar en caso de necesidad</comment>
185
+ <tooltip>Indique la cantidad máxima de días que puede tardar un pedido en completarse, si tarda más días la invitación no será enviada. Para más información consulte eValor.es</tooltip>
186
+ <depends><enabled>1</enabled></depends>
187
+ </backlog>
188
+ <debug translate="label">
189
+ <label>Debug</label>
190
+ <frontend_type>select</frontend_type>
191
+ <source_model>adminhtml/system_config_source_yesno</source_model>
192
+ <sort_order>5</sort_order>
193
+ <show_in_default>1</show_in_default>
194
+ <show_in_website>1</show_in_website>
195
+ <show_in_store>1</show_in_store>
196
+ <comment>Active la opción debug</comment>
197
+ <tooltip>Las conexiones API se archivan en el log.</tooltip>
198
+ <depends><enabled>1</enabled></depends>
199
+ </debug>
200
+ </fields>
201
+ </invitation>
202
+ </groups>
203
+ </evconnector>
204
+ </sections>
205
+ </config>
app/design/frontend/base/default/layout/evalor_evconnector.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="before_body_end">
5
+ <block type="core/template" name="evconnector_js" as="evconnector_js" template="evalor/sidebar.phtml" />
6
+ </reference>
7
+ </default>
8
+ </layout>
app/design/frontend/base/default/template/evalor/sidebar.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Evalor
4
+ * http://www.Evalor.es
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Evalor
17
+ * @package Evalor_Evconnector
18
+ * @author Evalor <info@evalor.es>
19
+ * @copyright Copyright (c) 2014 (http://www.Evalor.es)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ *
22
+ */
23
+ $webwinkelkeur_id = (int)Mage::getStoreConfig('evconnector/api/webstore_id');
24
+ $enabled = Mage::getStoreConfig('evconnector/frontend/enabled');
25
+ $sidebar = (Mage::getStoreConfig('evconnector/frontend/sidebar') ? 'true' : 'false');
26
+ $tooltip = (Mage::getStoreConfig('evconnector/frontend/tooltip') ? 'true' : 'false');
27
+ $sidebar_position = Mage::getStoreConfig('evconnector/frontend/sidebar_position');
28
+ $sidebar_top = Mage::getStoreConfig('evconnector/frontend/sidebar_height');
29
+ ?>
30
+
31
+ <?php if($webwinkelkeur_id && $enabled): ?>
32
+ <script type="text/javascript">
33
+ (function() {
34
+ _webwinkelkeur_id = <?php echo $webwinkelkeur_id; ?>;
35
+ _webwinkelkeur_sidebar = <?php echo $sidebar; ?>;
36
+ _webwinkelkeur_tooltip = <?php echo $tooltip; ?>;
37
+ _webwinkelkeur_sidebar_position = '<?php echo $sidebar_position; ?>';
38
+ _webwinkelkeur_sidebar_top = '<?php echo $sidebar_top; ?>';
39
+ var js = document.createElement("script");
40
+ js.type = "text/javascript";
41
+ js.async = true;
42
+ js.src = "//www.evalor.es/js/sidebar.js";
43
+ var s = document.getElementsByTagName("script")[0];
44
+ s.parentNode.insertBefore(js, s);
45
+ })();
46
+ </script>
47
+ <?php endif; ?>
app/etc/modules/Evalor_Evconnector.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Evalor_Evconnector>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Evalor_Evconnector>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Evalor_Evconnector</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license/>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Add the Evalor sidebar widget and inviting of customers to share a review.</summary>
10
+ <description>Add the Evalor sidebar widget and inviting of customers to share a review.</description>
11
+ <notes>Stable release</notes>
12
+ <authors><author><name>WebwinkelKeur</name><user>auto-converted</user><email>info@webwinkelkeur.nl</email></author></authors>
13
+ <date>2014-03-07</date>
14
+ <time>12:01:40</time>
15
+ <contents><target name="magelocal"><dir name="Evalor"><dir name="Evconnector"><dir name="Helper"><file name="Data.php" hash="423664ca33907a3d59cad77011071f42"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Position.php" hash="159623e4b57a40b6376d0754b8ace3cb"/><file name="Status.php" hash="565635aa25dce6a209325427ae642011"/></dir></dir></dir><file name="Observer.php" hash="b7cbee9fcc87507e34c2d79605438640"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d3f9a9e817fe99c1d18527bd9723121b"/><file name="config.xml" hash="eb9133db6f86f6bb8695e9991dc3ee64"/><file name="system.xml" hash="710e2022bc2a2d5942ba6bbf5ceb444b"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="evalor_evconnector.xml" hash="69a52c7d28f195648812e82e89e6f39d"/></dir><dir name="template"><dir name="evalor"><file name="sidebar.phtml" hash="5d7869cdc6b7f044cd6b1e1176e9211a"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Evalor_Evconnector.xml" hash="d5470a6cba38705c7cf1a476a754c69e"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>