Ydral_Yupick - Version 0.6.0

Version Notes

- Compatibilidad con módulo OneStepCheckOut.com

- Implementada funcionalidad puntos Yupick en la opción Reorder del BackOffice.

- Al enviar la confirmación por correo, se incluyen los datos del Punto Yupick! seleccionado.

Download this release

Release Info

Developer Ydral
Extension Ydral_Yupick
Version 0.6.0
Comparing to
See all releases


Code changes from version 0.5.0 to 0.6.0

app/code/local/Ydral/Yupick/Block/Email.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ydral_Yupick_Block_Email extends Mage_Core_Block_Template
3
+ {
4
+ protected function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->setTemplate('yupick/email.phtml');
8
+ }
9
+
10
+ }
app/code/local/Ydral/Yupick/Helper/Data.php CHANGED
@@ -45,6 +45,34 @@ class Ydral_Yupick_Helper_Data extends Mage_Core_Helper_Abstract
45
  }
46
 
47
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
 
50
  public function getUrlRequest($section)
45
  }
46
 
47
  }
48
+
49
+
50
+
51
+ public function setOficinaYupickRecogidaOrderAdminhtml($observer)
52
+ {
53
+
54
+ $order = $observer->getOrder();
55
+ $idQuote = $order->getQuoteId();
56
+ $idOrder = $order->getIncrementId();
57
+
58
+
59
+ $idSelector = trim(strip_tags($this->_getRequest()->getPost('oficinas_yupick')));
60
+ $nombrePunto = $this->_getRequest()->getPost('oficinas_yupick_data');
61
+
62
+ $_tipoAviso = $this->_getRequest()->getPost('yupick_type_alert');
63
+ $_tipoAvisoSms = $this->_getRequest()->getPost('yupick_type_alert_phone');
64
+ $_tipoAvisoEmail = $this->_getRequest()->getPost('yupick_type_alert_email');
65
+
66
+ if (!empty($idSelector))
67
+ {
68
+ Mage::getModel('yupick/ydral_recogeroficina')->saveCheckoutData('quote', $idQuote, $idSelector, $nombrePunto, $_tipoAviso, $_tipoAvisoSms, $_tipoAvisoEmail);
69
+ Mage::getModel('yupick/ydral_recogeroficina')->saveOrderData($idQuote, $idOrder);
70
+ }
71
+
72
+ }
73
+
74
+
75
+
76
 
77
 
78
  public function getUrlRequest($section)
app/code/local/Ydral/Yupick/Model/Ydral/Recogeroficina.php CHANGED
@@ -190,6 +190,7 @@ class Ydral_Yupick_Model_Ydral_Recogeroficina extends Mage_Shipping_Model_Carrie
190
  // reparamos los datos para sacar un xml bien formado
191
  $result = str_replace("<?xml version='1.0' encoding='ISO-8859-1'?><puntoentrega>", "<?xml version='1.0' encoding='ISO-8859-1'?><puntos><puntoentrega>", $result . '</puntos>');
192
  //$result = iconv("UTF-8", "ISO-8859-1//IGNORE", utf8_decode(trim($result)));
 
193
  $result = preg_replace('/<tarjetacredito>([A-Za-z]*)<tarjetacredito>/e', "'<tarjetacredito>'.strtolower('\\1').'</tarjetacredito>'",$result);
194
  $result = preg_replace('/<poslongitud>([A-Za-z0-9\.-]*)<poslongitud>/e', "'<poslongitud>' . strtolower('\\1') . '</poslongitud>'",$result);
195
  $result = str_replace('</puntos>', '', $result);
190
  // reparamos los datos para sacar un xml bien formado
191
  $result = str_replace("<?xml version='1.0' encoding='ISO-8859-1'?><puntoentrega>", "<?xml version='1.0' encoding='ISO-8859-1'?><puntos><puntoentrega>", $result . '</puntos>');
192
  //$result = iconv("UTF-8", "ISO-8859-1//IGNORE", utf8_decode(trim($result)));
193
+ $result = utf8_decode($result);
194
  $result = preg_replace('/<tarjetacredito>([A-Za-z]*)<tarjetacredito>/e', "'<tarjetacredito>'.strtolower('\\1').'</tarjetacredito>'",$result);
195
  $result = preg_replace('/<poslongitud>([A-Za-z0-9\.-]*)<poslongitud>/e', "'<poslongitud>' . strtolower('\\1') . '</poslongitud>'",$result);
196
  $result = str_replace('</puntos>', '', $result);
app/code/local/Ydral/Yupick/etc/config.xml CHANGED
@@ -1,181 +1,193 @@
1
- <?xml version="1.0"?>
2
-
3
- <config>
4
- <modules>
5
- <Ydral_Yupick>
6
- <version>0.5.0</version>
7
- </Ydral_Yupick>
8
- </modules>
9
- <global>
10
-
11
- <blocks>
12
- <yupick>
13
- <class>Ydral_Yupick_Block</class>
14
- </yupick>
15
- <checkout>
16
- <rewrite>
17
- <onepage_shipping_method_available>Ydral_Yupick_Block_Checkout_Onepage_Shipping_Method_Available</onepage_shipping_method_available>
18
- </rewrite>
19
- </checkout>
20
- </blocks>
21
-
22
- <helpers>
23
- <!-- Mage::helper('yupick') -->
24
- <yupick>
25
- <class>Ydral_Yupick_Helper</class>
26
- </yupick>
27
- </helpers>
28
-
29
- <models>
30
- <!-- Mage::getModel('yupick/yupick') -->
31
- <yupick>
32
- <class>Ydral_Yupick_Model</class>
33
- </yupick>
34
- <sales>
35
- <rewrite>
36
- <order_shipment>Ydral_Yupick_Model_Ydral_Shipment</order_shipment>
37
- </rewrite>
38
- </sales>
39
-
40
- <checkout>
41
- <rewrite>
42
- <type_onepage>Ydral_Yupick_Model_Type_Onepage</type_onepage>
43
- </rewrite>
44
- </checkout>
45
-
46
- </models>
47
-
48
- <resources>
49
- <!-- Mage::getResourceModel('yupick/yupick') or Mage::getResourceSingleton('yupick/yupick') -->
50
- <yupick_setup>
51
- <setup>
52
- <module>Ydral_Yupick</module>
53
- </setup>
54
- <connection>
55
- <use>core_setup</use>
56
- </connection>
57
- </yupick_setup>
58
- <yupick_read>
59
- <connection>
60
- <use>core_read</use>
61
- </connection>
62
- </yupick_read>
63
- <yupick_write>
64
- <connection>
65
- <use>core_write</use>
66
- </connection>
67
- </yupick_write>
68
- </resources>
69
-
70
- </global>
71
-
72
- <frontend>
73
- <routers>
74
- <yupick>
75
- <use>standard</use>
76
- <args>
77
- <module>Ydral_Yupick</module>
78
- <frontName>yupick</frontName>
79
- </args>
80
- </yupick>
81
- </routers>
82
- <layout>
83
- <updates>
84
- <Yupick>
85
- <file>yupick.xml</file>
86
- </Yupick>
87
- </updates>
88
- </layout>
89
- <events>
90
- <checkout_controller_onepage_save_shipping_method>
91
- <observers>
92
- <ydral_yupick_shipping_observer>
93
- <type>model</type>
94
- <class>Ydral_Yupick_Helper_Data</class>
95
- <method>setOficinaYupickRecogida</method>
96
- </ydral_yupick_shipping_observer>
97
- </observers>
98
- </checkout_controller_onepage_save_shipping_method>
99
- <checkout_onepage_controller_success_action>
100
- <observers>
101
- <ydral_yupick_order_observer>
102
- <type>model</type>
103
- <class>Ydral_Yupick_Helper_Data</class>
104
- <method>setOficinaYupickRecogidaOrder</method>
105
- </ydral_yupick_order_observer>
106
- </observers>
107
- </checkout_onepage_controller_success_action>
108
- </events>
109
- </frontend>
110
- <adminhtml>
111
- <layout>
112
- <updates>
113
- <yupick>
114
- <file>yupick.xml</file>
115
- </yupick>
116
- </updates>
117
- </layout>
118
- <acl>
119
- <resources>
120
- <admin>
121
- <children>
122
- <system>
123
- <children>
124
- <config>
125
- <children>
126
- <yupick translate="title" module="yupick">
127
- <title><![CDATA[Yupick Configuraci&oacute;n]]></title>
128
- </yupick>
129
- </children>
130
- </config>
131
- </children>
132
- </system>
133
- </children>
134
- </admin>
135
- </resources>
136
- </acl>
137
- </adminhtml>
138
- <admin>
139
- <routers>
140
- <yupick>
141
- <use>admin</use>
142
- <args>
143
- <module>Ydral_Yupick</module>
144
- <frontName>yupick</frontName>
145
- </args>
146
- </yupick>
147
- <adminhtml>
148
- <args>
149
- <modules>
150
- <ydral_yupick before="Mage_Adminhtml">Ydral_Yupick_Registro</ydral_yupick>
151
- </modules>
152
- </args>
153
- </adminhtml>
154
- </routers>
155
- </admin>
156
- <default>
157
- <yupick>
158
- <general>
159
- <active>0</active>
160
- <etiquetador>76Hv8rzPr9tm8x78vsHkfd3hu</etiquetador>
161
- <entrega_url>http://www.yupick.es/yupick.clientes/webservice/WSEntregas.php?wsdl</entrega_url>
162
- <etiqueta_url>http://www.yupick.es/yupick.clientes/webservice/etiquetaslaser.php</etiqueta_url>
163
- <situacion_url>http://www.yupick.es/yupick.clientes/webservice/WSsituacionactual.php?wsdl</situacion_url>
164
- <trazabilidad_url>http://www.yupick.es/yupick.clientes/webservice/WStrazabilidad.php?wsdl</trazabilidad_url>
165
- <entrega_url_pre>http://82.223.239.219/yupick.clientes/webservice/WSEntregas.php?wsdl</entrega_url_pre>
166
- <etiqueta_url_pre>http://82.223.239.219/yupick.clientes/webservice/etiquetaslaser.php</etiqueta_url_pre>
167
- <situacion_url_pre>http://82.223.239.219/yupick.clientes/webservice/WSsituacionactual.php?wsdl</situacion_url_pre>
168
- <trazabilidad_url_pre>http://82.223.239.219/yupick.clientes/webservice/WStrazabilidad.php?wsdl</trazabilidad_url_pre>
169
- </general>
170
- </yupick>
171
- <carriers>
172
- <yupick>
173
- <active>0</active>
174
- <title><![CDATA[Recoger paquete en tu punto Yupick!]]></title>
175
- <model>yupick/ydral_recogeroficina</model>
176
- <gateway_url>http://www.yupick.es/yupick.clientes/webservice/WSpuntoentrega.php?wsdl</gateway_url>
177
- <gateway_url_pre>http://82.223.239.219/yupick.clientes/webservice/WSpuntoentrega.php?wsdl</gateway_url_pre>
178
- </yupick>
179
- </carriers>
180
- </default>
 
 
 
 
 
 
 
 
 
 
 
 
181
  </config>
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Ydral_Yupick>
6
+ <version>0.5.1</version>
7
+ </Ydral_Yupick>
8
+ </modules>
9
+ <global>
10
+
11
+ <blocks>
12
+ <yupick>
13
+ <class>Ydral_Yupick_Block</class>
14
+ </yupick>
15
+ <checkout>
16
+ <rewrite>
17
+ <onepage_shipping_method_available>Ydral_Yupick_Block_Checkout_Onepage_Shipping_Method_Available</onepage_shipping_method_available>
18
+ </rewrite>
19
+ </checkout>
20
+ </blocks>
21
+
22
+ <helpers>
23
+ <!-- Mage::helper('yupick') -->
24
+ <yupick>
25
+ <class>Ydral_Yupick_Helper</class>
26
+ </yupick>
27
+ </helpers>
28
+
29
+ <models>
30
+ <!-- Mage::getModel('yupick/yupick') -->
31
+ <yupick>
32
+ <class>Ydral_Yupick_Model</class>
33
+ </yupick>
34
+ <sales>
35
+ <rewrite>
36
+ <order_shipment>Ydral_Yupick_Model_Ydral_Shipment</order_shipment>
37
+ </rewrite>
38
+ </sales>
39
+
40
+ <checkout>
41
+ <rewrite>
42
+ <type_onepage>Ydral_Yupick_Model_Type_Onepage</type_onepage>
43
+ </rewrite>
44
+ </checkout>
45
+
46
+ </models>
47
+
48
+ <resources>
49
+ <!-- Mage::getResourceModel('yupick/yupick') or Mage::getResourceSingleton('yupick/yupick') -->
50
+ <yupick_setup>
51
+ <setup>
52
+ <module>Ydral_Yupick</module>
53
+ </setup>
54
+ <connection>
55
+ <use>core_setup</use>
56
+ </connection>
57
+ </yupick_setup>
58
+ <yupick_read>
59
+ <connection>
60
+ <use>core_read</use>
61
+ </connection>
62
+ </yupick_read>
63
+ <yupick_write>
64
+ <connection>
65
+ <use>core_write</use>
66
+ </connection>
67
+ </yupick_write>
68
+ </resources>
69
+
70
+ </global>
71
+
72
+ <frontend>
73
+ <routers>
74
+ <yupick>
75
+ <use>standard</use>
76
+ <args>
77
+ <module>Ydral_Yupick</module>
78
+ <frontName>yupick</frontName>
79
+ </args>
80
+ </yupick>
81
+ </routers>
82
+ <layout>
83
+ <updates>
84
+ <Yupick>
85
+ <file>yupick.xml</file>
86
+ </Yupick>
87
+ </updates>
88
+ </layout>
89
+ <events>
90
+ <checkout_controller_onepage_save_shipping_method>
91
+ <observers>
92
+ <ydral_yupick_shipping_observer>
93
+ <type>model</type>
94
+ <class>Ydral_Yupick_Helper_Data</class>
95
+ <method>setOficinaYupickRecogida</method>
96
+ </ydral_yupick_shipping_observer>
97
+ </observers>
98
+ </checkout_controller_onepage_save_shipping_method>
99
+ <checkout_onepage_controller_success_action>
100
+ <observers>
101
+ <ydral_yupick_order_observer>
102
+ <type>model</type>
103
+ <class>Ydral_Yupick_Helper_Data</class>
104
+ <method>setOficinaYupickRecogidaOrder</method>
105
+ </ydral_yupick_order_observer>
106
+ </observers>
107
+ </checkout_onepage_controller_success_action>
108
+ </events>
109
+ </frontend>
110
+ <adminhtml>
111
+ <layout>
112
+ <updates>
113
+ <yupick>
114
+ <file>yupick.xml</file>
115
+ </yupick>
116
+ </updates>
117
+ </layout>
118
+ <events>
119
+ <checkout_submit_all_after>
120
+ <observers>
121
+ <ydral_yupick_adminhtml_observer>
122
+ <type>model</type>
123
+ <class>Ydral_Yupick_Helper_Data</class>
124
+ <method>setOficinaYupickRecogidaOrderAdminhtml</method>
125
+ </ydral_yupick_adminhtml_observer>
126
+ </observers>
127
+ </checkout_submit_all_after>
128
+ </events>
129
+ <acl>
130
+ <resources>
131
+ <admin>
132
+ <children>
133
+ <system>
134
+ <children>
135
+ <config>
136
+ <children>
137
+ <yupick translate="title" module="yupick">
138
+ <title><![CDATA[Yupick Configuraci&oacute;n]]></title>
139
+ </yupick>
140
+ </children>
141
+ </config>
142
+ </children>
143
+ </system>
144
+ </children>
145
+ </admin>
146
+ </resources>
147
+ </acl>
148
+ </adminhtml>
149
+ <admin>
150
+ <routers>
151
+ <yupick>
152
+ <use>admin</use>
153
+ <args>
154
+ <module>Ydral_Yupick</module>
155
+ <frontName>yupick</frontName>
156
+ </args>
157
+ </yupick>
158
+ <adminhtml>
159
+ <args>
160
+ <modules>
161
+ <ydral_yupick before="Mage_Adminhtml">Ydral_Yupick_Registro</ydral_yupick>
162
+ <!-- <ydral_yupick before="Mage_Adminhtml">Ydral_Yupick</ydral_yupick> -->
163
+ </modules>
164
+ </args>
165
+ </adminhtml>
166
+ </routers>
167
+ </admin>
168
+ <default>
169
+ <yupick>
170
+ <general>
171
+ <active>0</active>
172
+ <etiquetador>76Hv8rzPr9tm8x78vsHkfd3hu</etiquetador>
173
+ <entrega_url>http://www.yupick.es/yupick.clientes/webservice/WSEntregas.php?wsdl</entrega_url>
174
+ <etiqueta_url>http://www.yupick.es/yupick.clientes/webservice/etiquetaslaser.php</etiqueta_url>
175
+ <situacion_url>http://www.yupick.es/yupick.clientes/webservice/WSsituacionactual.php?wsdl</situacion_url>
176
+ <trazabilidad_url>http://www.yupick.es/yupick.clientes/webservice/WStrazabilidad.php?wsdl</trazabilidad_url>
177
+ <entrega_url_pre>http://82.223.239.219/yupick.clientes/webservice/WSEntregas.php?wsdl</entrega_url_pre>
178
+ <etiqueta_url_pre>http://82.223.239.219/yupick.clientes/webservice/etiquetaslaser.php</etiqueta_url_pre>
179
+ <situacion_url_pre>http://82.223.239.219/yupick.clientes/webservice/WSsituacionactual.php?wsdl</situacion_url_pre>
180
+ <trazabilidad_url_pre>http://82.223.239.219/yupick.clientes/webservice/WStrazabilidad.php?wsdl</trazabilidad_url_pre>
181
+ </general>
182
+ </yupick>
183
+ <carriers>
184
+ <yupick>
185
+ <active>0</active>
186
+ <title><![CDATA[Recoger paquete en tu punto Yupick!]]></title>
187
+ <model>yupick/ydral_recogeroficina</model>
188
+ <gateway_url>http://www.yupick.es/yupick.clientes/webservice/WSpuntoentrega.php?wsdl</gateway_url>
189
+ <gateway_url_pre>http://82.223.239.219/yupick.clientes/webservice/WSpuntoentrega.php?wsdl</gateway_url_pre>
190
+ </yupick>
191
+ </carriers>
192
+ </default>
193
  </config>
app/code/local/Ydral/Yupick/sql/yupick_setup/mysql4-upgrade-0.4.0-0.5.0.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ $installer = $this;
app/code/local/Ydral/Yupick/sql/yupick_setup/mysql4-upgrade-0.5.0-0.6.0.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ $installer = $this;
app/design/adminhtml/default/default/layout/yupick.xml CHANGED
@@ -1,10 +1,37 @@
1
- <?xml version="1.0"?>
2
- <layout>
3
- <adminhtml_sales_order_view>
4
- <reference name="order_tab_info">
5
- <action method="setTemplate" ifconfig="carriers/yupick/active">
6
- <template>yupick/tab_info.phtml</template>
7
- </action>
8
- </reference>
9
- </adminhtml_sales_order_view>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  </layout>
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <adminhtml_sales_order_view>
4
+ <reference name="order_tab_info">
5
+ <action method="setTemplate" ifconfig="carriers/yupick/active">
6
+ <template>yupick/tab_info.phtml</template>
7
+ </action>
8
+ </reference>
9
+ </adminhtml_sales_order_view>
10
+
11
+
12
+ <adminhtml_sales_order_create_index>
13
+ <reference name="head" ifconfig="carriers/yupick/active">
14
+ <action method="addCss"><stylesheet>yupick.css</stylesheet></action>
15
+ <action method="addJs"><file>yupick.js</file></action>
16
+ </reference>
17
+ <reference name="js">
18
+ <block type="adminhtml/template" template="yupick/linksmaps.phtml" name="maps" />
19
+ </reference>
20
+ <reference name="shipping_method" ifconfig="carriers/yupick/active">
21
+ <block type="adminhtml/sales_order_create_shipping_method_form" template="yupick/form.phtml" name="form" />
22
+ </reference>
23
+ </adminhtml_sales_order_create_index>
24
+
25
+ <adminhtml_sales_order_create_load_block_data>
26
+ <reference name="shipping_method" ifconfig="carriers/yupick/active">
27
+ <block type="adminhtml/sales_order_create_shipping_method_form" template="yupick/form.phtml" name="form" />
28
+ </reference>
29
+ </adminhtml_sales_order_create_load_block_data>
30
+
31
+ <adminhtml_sales_order_create_load_block_shipping_method>
32
+ <reference name="shipping_method" ifconfig="carriers/yupick/active">
33
+ <block type="adminhtml/sales_order_create_shipping_method_form" template="yupick/form.phtml" name="form" />
34
+ </reference>
35
+ </adminhtml_sales_order_create_load_block_shipping_method>
36
+
37
  </layout>
app/design/adminhtml/default/default/template/yupick/form.phtml ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if($_shippingRateGroups = $this->getShippingRates()): ?>
28
+ <div id="order-shipping-method-choose" style="display:none">
29
+ <dl class="shipment-methods">
30
+ <?php foreach ($_shippingRateGroups as $code => $_rates): ?>
31
+ <dt><strong><?php echo $this->getCarrierName($code) ?></strong></dt>
32
+ <dd>
33
+ <ul>
34
+ <?php foreach ($_rates as $_rate): ?>
35
+ <?php $_radioProperty = 'name="order[shipping_method]" type="radio" onclick="order.setShippingMethod(this.value)"' ?>
36
+ <?php $_code=$_rate->getCode() ?>
37
+ <li>
38
+ <?php if ($_rate->getErrorMessage()): ?>
39
+ <ul class="messages">
40
+ <li class="error-msg"><?php echo $_rate->getErrorMessage() ?></li>
41
+ </ul>
42
+ <?php else: ?>
43
+ <?php $_checked = $this->isMethodActive($_code) ? 'checked="checked"' : '' ?>
44
+ <input <?php echo $_radioProperty ?> value="<?php echo $_code ?>" id="s_method_<?php echo $_code ?>" <?php echo $_checked ?>/>
45
+ <label class="normal" for="s_method_<?php echo $_code ?>">
46
+ <?php echo $_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription()?> -
47
+ <strong>
48
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
49
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
50
+
51
+ <?php echo $_excl; ?>
52
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
53
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
54
+ <?php endif; ?>
55
+ </strong>
56
+
57
+
58
+ <?php /* Yupick! */ ?>
59
+ <?php if ($_rate->getCode() === 'yupick_yupick'): ?>
60
+ <img src="<?php echo($this->getSkinUrl('images/yupick/logo_small.gif')) ?>" alt="<?php echo Mage::helper('yupick')->__('Yupick') ?>" class="yupick-icon-checkout v-middle" />
61
+ <?php endif; ?>
62
+ <?php /* End Yupick! */ ?>
63
+
64
+
65
+ </label>
66
+
67
+
68
+
69
+ <?php
70
+ /**
71
+ * Opciones:
72
+ * + Parking
73
+ * + Wi-Fi
74
+ * + Alimentacion
75
+ * + Prensa/Revistas
76
+ * + Tarjeta de Credito
77
+ * + Abierto mas de las 20h
78
+ * + Abierto sabados tarde
79
+ * + Abierto domingos
80
+ */
81
+ if ($_rate->getCode() === 'yupick_yupick'):
82
+ ?>
83
+ <br />
84
+ <?php /* <form id="yupick_options" name="yupick_options" action=""> */ ?>
85
+ <!-- OJO cambios -->
86
+ <!-- <input type="hidden" id="codigoPostal" name="codigoPostal" value="<?php echo $this->getQuote()->getShippingAddress()->getPostcode(); ?>" />-->
87
+
88
+ <!-- no funciona en https <input type="hidden" id="checkUrl" name="checkUrl" value="<?php echo Mage::getUrl("yupick/index/getdata"); ?>" /> -->
89
+ <input type="hidden" id="checkUrl" name="checkUrl" value="<?php echo Mage::getUrl("yupick/index/getdata", array('_secure' => true)); ?>" />
90
+ <input type="hidden" id="skinPath" name="skinPath" value="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>" />
91
+
92
+ <div id="yupick_carrier_principal" class="yupick_carrier_principal" style="display: none; ">
93
+ <!-- OJO cambios -->
94
+ Calle: <input type="text" id="direccion" name="direccion" size="50" value="<?php echo $this->getQuote()->getShippingAddress()->getStreetFull() . ', ' . $this->getQuote()->getShippingAddress()->getCity() . ', ' . $this->getQuote()->getShippingAddress()->getRegion();?>" />
95
+ &nbsp;C&oacute;d.Postal:<input type="text" id="codigoPostal" name="codigoPostal" size="10" value="<?php echo $this->getQuote()->getShippingAddress()->getPostcode(); ?>" />
96
+ <br>
97
+ <input id="option_mas20" name="option_mas20" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Est&aacute; abierto m&aacute;s de las 20h.'); ?></label>
98
+ <input id="option_sabados" name="option_sabados" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Abierto los s&aacute;bados tarde.'); ?></label>
99
+ <input id="option_domingos" name="option_domingos" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Abierto los domingos.'); ?></label>
100
+ </div>
101
+ <div id="yupick_carrier_secundario" class="yupick_carrier_secundario" style="display: none; ">
102
+ <input id="option_parking" name="option_parking" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Parking.'); ?></label>
103
+ <input id="option_wifi" name="option_wifi" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Wi-Fi.'); ?></label>
104
+ <input id="option_alimentacion" name="option_alimentacion" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Alimentaci&oacute;n.'); ?></label>
105
+ <input id="option_prensa" name="option_prensa" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Prensa / Revistas.'); ?></label>
106
+ <input id="option_tarjeta" name="option_tarjeta" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Pagar con tarjeta de cr&eacute;dito.'); ?></label>
107
+ </div>
108
+
109
+ <div class="yupick_actions">
110
+ <div class="yupick_button_search">
111
+ <input type="button" value="Buscar" onclick="PuntosYupick.getPuntosYupick(); return false; " />
112
+ </div>
113
+ <div class="yupick_control_options">
114
+ <a href="#" onclick="PuntosYupick.changeYupickOptions(); return false;"><span id="yupick_options_text"><?php echo $this->__('M&aacute;s opciones de b&uacute;squeda') ?></span></a>
115
+ </div>
116
+ </div>
117
+
118
+ <?php /* </form> */ ?>
119
+ <br />
120
+ <div id="oficinas_yupick_content" style="display: none; ">
121
+ <select id="oficinas_yupick" name="oficinas_yupick" onchange="PuntosYupick.yupickInfo();"></select>
122
+ <input type="hidden" id="oficinas_yupick_data" name="oficinas_yupick_data" value="" />
123
+ </div>
124
+
125
+ <div class="yclear"></div>
126
+ <div id="yupick_info_map" style="display: none; "></div>
127
+ <div id="yupick_info_time" style="display: none; "></div>
128
+ <div class="yclear"></div>
129
+ <div id="yupick_info_user" style="display: none; ">
130
+ <p><?php echo $this->__('&iquest;C&oacute;mo prefiere ser informado de cuando puede recoger su compra?') ?></p>
131
+ <div class="yupick_info_user_col">
132
+ <label><?php echo $this->__('Email') ?></label>
133
+ <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="Email" checked="checked" />
134
+ <input type="text" name="yupick_type_alert_email" id="yupick_type_alert_email" value="<?php echo $this->getQuote()->getShippingAddress()->getEmail(); ?>" style="width: 200px; " />
135
+ </div>
136
+ <div class="yupick_info_user_col">
137
+ <label><?php echo $this->__('SMS - Tel&eacute;fono M&oacute;vil') ?></label>
138
+ <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="SMS" />
139
+ <input type="text" name="yupick_type_alert_phone" id="yupick_type_alert_phone" value="<?php echo $this->getQuote()->getShippingAddress()->getTelephone(); ?>" />
140
+ </div>
141
+ </div>
142
+ <div class="yclear"><br /></div>
143
+
144
+ <div id="loadingmask" style="display: none;">
145
+ <div class="loader" id="loading-mask-loader"><img src="<?php echo($this->getSkinUrl('images/yupick/opc-ajax-loader.gif')) ?>" alt="<?php echo $this->__('Loading...') ?>" /> <?php echo $this->__('Loading...') ?></div>
146
+ <div id="loading-mask"></div>
147
+ </div>
148
+
149
+ <?php endif; ?>
150
+
151
+
152
+ <?php endif ?>
153
+ </li>
154
+ <?php endforeach; ?>
155
+ </ul>
156
+ </dd>
157
+ <?php endforeach; ?>
158
+ </dl>
159
+ </div>
160
+ <?php if ($_rate = $this->getActiveMethodRate()): ?>
161
+ <div id="order-shipping-method-info">
162
+ <strong><?php echo $this->getCarrierName($_rate->getCarrier()) ?></strong><br/>
163
+ <?php echo $_rate->getMethodTitle() ? $_rate->getMethodTitle() : $_rate->getMethodDescription() ?> -
164
+ <strong>
165
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
166
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
167
+
168
+ <?php echo $_excl; ?>
169
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
170
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
171
+ <?php endif; ?>
172
+ </strong>
173
+ <!--input type="text" class="input-text" style="width:70px"/-->
174
+ <br/>
175
+ <a href="#" onclick="$('order-shipping-method-info').hide();$('order-shipping-method-choose').show();return false">
176
+ <?php echo Mage::helper('sales')->__('Click to change shipping method') ?>
177
+ </a>
178
+ </div>
179
+ <?php else: ?>
180
+ <script type="text/javascript">$('order-shipping-method-choose').show();</script>
181
+ <?php endif; ?>
182
+ <?php elseif($this->getIsRateRequest()): ?>
183
+ <strong><?php echo Mage::helper('sales')->__('Sorry, no quotes are available for this order at this time.') ?></strong>
184
+ <?php else: ?>
185
+ <div id="order-shipping-method-summary">
186
+ <a href="#" onclick="order.loadShippingRates();return false">
187
+ <?php echo Mage::helper('sales')->__('Get shipping methods and rates') ?>
188
+ </a>
189
+ <input type="hidden" name="order[has_shipping]" value="" class="required-entry">
190
+ </div>
191
+ <?php endif; ?>
192
+ <div style="display:none;" id="shipping-method-overlay" class="overlay"><span><?php echo $this->__('Shipping method selection is not applicable') ?></span></div>
193
+ <script type="text/javascript">
194
+ order.overlay('shipping-method-overlay', <?php if ($this->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
195
+ order.overlay('address-shipping-overlay', <?php if ($this->getQuote()->isVirtual()): ?>false<?php else: ?>true<?php endif; ?>);
196
+ </script>
app/design/adminhtml/default/default/template/yupick/linksmaps.phtml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ if (Mage::app()->getStore()->isCurrentlySecure()){
3
+ $url = 'https://maps-api-ssl.google.com/maps/api/js?sensor=false';
4
+ } else {
5
+ $url = 'http://maps.google.com/maps/api/js?sensor=false';
6
+ }
7
+ echo '<script type="text/javascript" src="' . $url . '"></script>';
app/design/frontend/base/default/layout/yupick.xml CHANGED
@@ -3,8 +3,9 @@
3
  <checkout_onepage_index>
4
  <reference name="head" ifconfig="carriers/yupick/active">
5
  <action method="addCss"><stylesheet>css/yupick.css</stylesheet></action>
6
- <action method="addItem"><type>skin_js</type><name>js/yupick.js</name></action>
7
  <!-- <block type="core/text" name="gmap.api.js"><action method="setText"><text><![CDATA[<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>]]></text></action></block>-->
 
8
  <block type="core/template" name="maps">
9
  <action method="setTemplate"><template>yupick/linksmaps.phtml</template></action>
10
  </block>
@@ -20,4 +21,23 @@
20
  <action method="setTemplate" ifconfig="yupick/general/active"><template>yupick/info.phtml</template></action>
21
  </reference>
22
  </sales_order_view>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </layout>
3
  <checkout_onepage_index>
4
  <reference name="head" ifconfig="carriers/yupick/active">
5
  <action method="addCss"><stylesheet>css/yupick.css</stylesheet></action>
6
+ <!-- <action method="addItem"><type>skin_js</type><name>js/yupick.js</name></action> -->
7
  <!-- <block type="core/text" name="gmap.api.js"><action method="setText"><text><![CDATA[<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>]]></text></action></block>-->
8
+ <action method="addJs"><file>yupick.js</file></action>
9
  <block type="core/template" name="maps">
10
  <action method="setTemplate"><template>yupick/linksmaps.phtml</template></action>
11
  </block>
21
  <action method="setTemplate" ifconfig="yupick/general/active"><template>yupick/info.phtml</template></action>
22
  </reference>
23
  </sales_order_view>
24
+ <onestepcheckout_index_index>
25
+ <reference name="head" ifconfig="carriers/yupick/active">
26
+ <action method="addCss"><stylesheet>css/yupick.css</stylesheet></action>
27
+ <action method="addItem"><type>skin_js</type><name>js/yupick.js</name></action>
28
+ <!-- <block type="core/text" name="gmap.api.js"><action method="setText"><text><![CDATA[<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>]]></text></action></block>-->
29
+ <block type="core/template" name="maps">
30
+ <action method="setTemplate"><template>yupick/linksmaps.phtml</template></action>
31
+ </block>
32
+ </reference>
33
+ <reference name="choose-shipping-method">
34
+ <action method="setTemplate" ifconfig="carriers/yupick/active"><template>yupick/onestepcheckout_shipping_method.phtml</template></action>
35
+ </reference>
36
+
37
+ </onestepcheckout_index_index>
38
+ <onestepcheckout_ajax_save_billing>
39
+ <reference name="choose-shipping-method">
40
+ <action method="setTemplate" ifconfig="carriers/yupick/active"><template>yupick/onestepcheckout_shipping_method.phtml</template></action>
41
+ </reference>
42
+ </onestepcheckout_ajax_save_billing>
43
  </layout>
app/design/frontend/base/default/template/yupick/email.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $_order = $this->getData('order');
3
+
4
+ if (!$_order)
5
+ {
6
+ $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
7
+ $_order = Mage::getSingleton('sales/order')->load($lastOrderId);
8
+ }
9
+
10
+ $_shippingMethod = $_order->getShippingMethod();
11
+ if ($_shippingMethod == 'yupick_yupick')
12
+ {
13
+
14
+ $_dataRecogida = Mage::getModel('yupick/ydral_recogeroficina')->readCheckoutData('order', $_order->getRealOrderId());
15
+ if (!$_dataRecogida)
16
+ {
17
+ $idQuote = Mage::getSingleton('checkout/session')->getLastQuoteId();
18
+ $_dataRecogida = Mage::getModel('yupick/ydral_recogeroficina')->readCheckoutData('quote', $idQuote);
19
+ }
20
+
21
+ if ($_dataRecogida)
22
+ {
23
+ echo '<br />'.$_dataRecogida['info_oficina'];
24
+ }
25
+
26
+ }
27
+
28
+ ?>
app/design/frontend/base/default/template/yupick/onestepcheckout_shipping_method.phtml ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design_default
22
+ * @package Mage
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php if (!($_shippingRateGroups = $this->getShippingRates())): ?>
29
+ <strong><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></strong>
30
+ <?php else: ?>
31
+ <?php if (count($_shippingRateGroups)=='1' && Mage::getStoreConfig('onestepcheckout/general/hide_shipping_method')):?>
32
+ <dl class="shipment-methods" style="display: none">
33
+ <?php foreach ($_shippingRateGroups as $code => $_rates): ?>
34
+ <dd><?php echo $this->getCarrierName($code) ?></dd>
35
+ <?php foreach ($_rates as $_rate): ?>
36
+ <dt style="margin-bottom: 5px;">
37
+ <?php if ($_rate->getErrorMessage()): ?>
38
+ <ul class="messages"><li class="error-msg"><ul><li><?php echo $_rate->getErrorMessage() ?></li></ul></li></ul>
39
+ <?php else: ?>
40
+ <input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" />
41
+ <label for="s_method_<?php echo $_rate->getCode() ?>"><!--<b><?php echo $this->getCarrierName($code) ?>:</b>--> <?php echo $_rate->getMethodTitle() ?>
42
+ <strong>
43
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
44
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
45
+ <?php echo $_excl; ?>
46
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
47
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
48
+ <?php endif; ?>
49
+ </strong>
50
+ <?php /* Yupick! */ ?>
51
+ <?php if ($_rate->getCode() === 'yupick_yupick'): ?>
52
+ <img src="<?php echo($this->getSkinUrl('images/yupick/logo_small.gif')) ?>" alt="<?php echo Mage::helper('yupick')->__('Yupick') ?>" class="yupick-icon-checkout v-middle" />&nbsp;
53
+ <a href="http://www.yupick.es/quees.html" target="_blank" onclick="nuevaVentana(this.href,'quees','400','480','yes');return false;"><?php echo Mage::helper('yupick')->__('&iquest;Qu&eacute; es Yupick!?') ?></a>
54
+ <?php endif; ?>
55
+ <?php /* End Yupick! */ ?>
56
+ </label>
57
+
58
+
59
+ <?php
60
+ /**
61
+ * Opciones:
62
+ * + Parking
63
+ * + Wi-Fi
64
+ * + Alimentacion
65
+ * + Prensa/Revistas
66
+ * + Tarjeta de Credito
67
+ * + Abierto mas de las 20h
68
+ * + Abierto sabados tarde
69
+ * + Abierto domingos
70
+ */
71
+ if ($_rate->getCode() === 'yupick_yupick'):
72
+ ?>
73
+ <br />
74
+ <?php /* <form id="yupick_options" name="yupick_options" action=""> */ ?>
75
+ <!-- OJO cambios -->
76
+ <!-- <input type="hidden" id="codigoPostal" name="codigoPostal" value="<?php echo $this->getQuote()->getShippingAddress()->getPostcode(); ?>" />-->
77
+
78
+ <!-- no funciona en https <input type="hidden" id="checkUrl" name="checkUrl" value="<?php echo Mage::getUrl("yupick/index/getdata"); ?>" /> -->
79
+ <input type="hidden" id="checkUrl" name="checkUrl" value="<?php echo Mage::getUrl("yupick/index/getdata", array('_secure' => true)); ?>" />
80
+ <input type="hidden" id="skinPath" name="skinPath" value="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>" />
81
+
82
+ <div id="yupick_carrier_principal" class="yupick_carrier_principal" style="display: none; ">
83
+ <!-- OJO cambios -->
84
+ Calle: <input type="text" id="direccion" name="direccion" size="50" value="<?php echo $this->getQuote()->getShippingAddress()->getStreetFull() . ', ' . $this->getQuote()->getShippingAddress()->getCity() . ', ' . $this->getQuote()->getShippingAddress()->getRegion();?>" style="width: 240px; " />
85
+ &nbsp;C&oacute;d.Postal:<input type="text" id="codigoPostal" name="codigoPostal" size="10" value="<?php echo $this->getQuote()->getShippingAddress()->getPostcode(); ?>" />
86
+ <br>
87
+ <input id="option_mas20" name="option_mas20" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Est&aacute; abierto m&aacute;s de las 20h.'); ?></label>
88
+ <input id="option_sabados" name="option_sabados" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Abierto los s&aacute;bados tarde.'); ?></label>
89
+ <input id="option_domingos" name="option_domingos" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Abierto los domingos.'); ?></label>
90
+ </div>
91
+ <div id="yupick_carrier_secundario" class="yupick_carrier_secundario" style="display: none; ">
92
+ <input id="option_parking" name="option_parking" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Parking.'); ?></label>
93
+ <input id="option_wifi" name="option_wifi" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Wi-Fi.'); ?></label>
94
+ <input id="option_alimentacion" name="option_alimentacion" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Alimentaci&oacute;n.'); ?></label>
95
+ <input id="option_prensa" name="option_prensa" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Prensa / Revistas.'); ?></label>
96
+ <input id="option_tarjeta" name="option_tarjeta" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Pagar con tarjeta de cr&eacute;dito.'); ?></label>
97
+ </div>
98
+
99
+ <div class="yupick_actions">
100
+ <div class="yupick_button_search">
101
+ <input type="button" value="Buscar" onclick="PuntosYupick.getPuntosYupick(); return false; " />
102
+ </div>
103
+ <div class="yupick_control_options">
104
+ <a href="#" onclick="PuntosYupick.changeYupickOptions();"><span id="yupick_options_text"><?php echo $this->__('M&aacute;s opciones de b&uacute;squeda') ?></span></a>
105
+ </div>
106
+ </div>
107
+
108
+ <?php /* </form> */ ?>
109
+ <br />
110
+ <div id="oficinas_yupick_content" style="display: none; ">
111
+ <select id="oficinas_yupick" name="oficinas_yupick" onchange="PuntosYupick.yupickInfo();" style="width: 240px; min-width: 240px; "></select>
112
+ <input type="hidden" id="oficinas_yupick_data" name="oficinas_yupick_data" value="" />
113
+ </div>
114
+
115
+ <div class="yclear"></div>
116
+ <div id="yupick_info_map" style="display: none; width: 240px; "></div>
117
+ <div id="yupick_info_time" style="display: none; width: 240px; "></div>
118
+ <div class="yclear"></div>
119
+ <div id="yupick_info_user" style="display: none; margin-left: 0; max-width: 240px; ">
120
+ <p><?php echo $this->__('&iquest;C&oacute;mo prefiere ser informado de cuando puede recoger su compra?') ?></p>
121
+ <div class="yupick_info_user_col">
122
+ <label><?php echo $this->__('Email') ?></label>
123
+ <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="Email" checked="checked" />
124
+ <input type="text" name="yupick_type_alert_email" id="yupick_type_alert_email" value="<?php echo $this->getQuote()->getShippingAddress()->getEmail(); ?>" style="width: 200px; " />
125
+ </div>
126
+ <div class="yupick_info_user_col">
127
+ <label><?php echo $this->__('SMS - Tel&eacute;fono M&oacute;vil') ?></label>
128
+ <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="SMS" />
129
+ <input type="text" name="yupick_type_alert_phone" id="yupick_type_alert_phone" value="<?php echo $this->getQuote()->getShippingAddress()->getTelephone(); ?>" />
130
+ </div>
131
+ </div>
132
+ <div class="yclear"><br /></div>
133
+
134
+ <div id="loadingmask" style="display: none;">
135
+ <div class="loader" id="loading-mask-loader"><img src="<?php echo($this->getSkinUrl('images/yupick/opc-ajax-loader.gif')) ?>" alt="<?php echo $this->__('Loading...') ?>" /> <?php echo $this->__('Loading...') ?></div>
136
+ <div id="loading-mask"></div>
137
+ </div>
138
+
139
+ <?php endif; ?>
140
+
141
+
142
+ <?php endif ?>
143
+ </dt>
144
+ <?php endforeach; ?>
145
+ <?php endforeach; ?>
146
+ </dl>
147
+ <?php else: ?>
148
+ <dl class="shipment-methods">
149
+ <?php foreach ($_shippingRateGroups as $code => $_rates): ?>
150
+ <dd><?php echo $this->getCarrierName($code) ?></dd>
151
+ <?php foreach ($_rates as $_rate): ?>
152
+ <dt style="margin-bottom: 5px;">
153
+ <?php if ($_rate->getErrorMessage()): ?>
154
+ <ul class="messages"><li class="error-msg"><ul><li><?php echo $_rate->getErrorMessage() ?></li></ul></li></ul>
155
+ <?php else: ?>
156
+ <input name="shipping_method" type="radio" class="validate-one-required-by-name" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> />
157
+ <label for="s_method_<?php echo $_rate->getCode() ?>"><!--<b><?php echo $this->getCarrierName($code) ?>:</b>--> <?php echo $_rate->getMethodTitle() ?>
158
+ <strong>
159
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
160
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
161
+
162
+ <?php echo $_excl; ?>
163
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
164
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
165
+ <?php endif; ?>
166
+ </strong>
167
+ <?php /* Yupick! */ ?>
168
+ <?php if ($_rate->getCode() === 'yupick_yupick'): ?>
169
+ <img src="<?php echo($this->getSkinUrl('images/yupick/logo_small.gif')) ?>" alt="<?php echo Mage::helper('yupick')->__('Yupick') ?>" class="yupick-icon-checkout v-middle" />&nbsp;
170
+ <a href="http://www.yupick.es/quees.html" target="_blank" onclick="nuevaVentana(this.href,'quees','400','480','yes');return false;"><?php echo Mage::helper('yupick')->__('&iquest;Qu&eacute; es Yupick!?') ?></a>
171
+ <?php endif; ?>
172
+ <?php /* End Yupick! */ ?>
173
+ </label>
174
+
175
+
176
+ <?php
177
+ /**
178
+ * Opciones:
179
+ * + Parking
180
+ * + Wi-Fi
181
+ * + Alimentacion
182
+ * + Prensa/Revistas
183
+ * + Tarjeta de Credito
184
+ * + Abierto mas de las 20h
185
+ * + Abierto sabados tarde
186
+ * + Abierto domingos
187
+ */
188
+ if ($_rate->getCode() === 'yupick_yupick'):
189
+ ?>
190
+ <br />
191
+ <?php /* <form id="yupick_options" name="yupick_options" action=""> */ ?>
192
+ <!-- OJO cambios -->
193
+ <!-- <input type="hidden" id="codigoPostal" name="codigoPostal" value="<?php echo $this->getQuote()->getShippingAddress()->getPostcode(); ?>" />-->
194
+
195
+ <!-- no funciona en https <input type="hidden" id="checkUrl" name="checkUrl" value="<?php echo Mage::getUrl("yupick/index/getdata"); ?>" /> -->
196
+ <input type="hidden" id="checkUrl" name="checkUrl" value="<?php echo Mage::getUrl("yupick/index/getdata", array('_secure' => true)); ?>" />
197
+ <input type="hidden" id="skinPath" name="skinPath" value="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>" />
198
+
199
+ <div id="yupick_carrier_principal" class="yupick_carrier_principal" style="display: none; ">
200
+ <!-- OJO cambios -->
201
+ Calle: <input type="text" id="direccion" name="direccion" size="50" value="<?php echo $this->getQuote()->getShippingAddress()->getStreetFull() . ', ' . $this->getQuote()->getShippingAddress()->getCity() . ', ' . $this->getQuote()->getShippingAddress()->getRegion();?>" style="width: 240px; "/>
202
+ &nbsp;C&oacute;d.Postal:<input type="text" id="codigoPostal" name="codigoPostal" size="10" value="<?php echo $this->getQuote()->getShippingAddress()->getPostcode(); ?>" />
203
+ <br>
204
+ <input id="option_mas20" name="option_mas20" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Est&aacute; abierto m&aacute;s de las 20h.'); ?></label>
205
+ <input id="option_sabados" name="option_sabados" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Abierto los s&aacute;bados tarde.'); ?></label>
206
+ <input id="option_domingos" name="option_domingos" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Abierto los domingos.'); ?></label>
207
+ </div>
208
+ <div id="yupick_carrier_secundario" class="yupick_carrier_secundario" style="display: none; ">
209
+ <input id="option_parking" name="option_parking" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Parking.'); ?></label>
210
+ <input id="option_wifi" name="option_wifi" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Wi-Fi.'); ?></label>
211
+ <input id="option_alimentacion" name="option_alimentacion" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Alimentaci&oacute;n.'); ?></label>
212
+ <input id="option_prensa" name="option_prensa" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Prensa / Revistas.'); ?></label>
213
+ <input id="option_tarjeta" name="option_tarjeta" type="checkbox" value="on" />&nbsp;<label><?php echo $this->__('Pagar con tarjeta de cr&eacute;dito.'); ?></label>
214
+ </div>
215
+
216
+ <div class="yupick_actions">
217
+ <div class="yupick_button_search">
218
+ <input type="button" value="Buscar" onclick="PuntosYupick.getPuntosYupick(); return false; " />
219
+ </div>
220
+ <div class="yupick_control_options">
221
+ <a href="#" onclick="PuntosYupick.changeYupickOptions();"><span id="yupick_options_text"><?php echo $this->__('M&aacute;s opciones de b&uacute;squeda') ?></span></a>
222
+ </div>
223
+ </div>
224
+
225
+ <?php /* </form> */ ?>
226
+ <br />
227
+ <div id="oficinas_yupick_content" style="display: none; ">
228
+ <select id="oficinas_yupick" name="oficinas_yupick" onchange="PuntosYupick.yupickInfo();" style="width: 240px; min-width: 240px; "></select>
229
+ <input type="hidden" id="oficinas_yupick_data" name="oficinas_yupick_data" value="" />
230
+ </div>
231
+
232
+ <div class="yclear"></div>
233
+ <div id="yupick_info_map" style="display: none; width: 240px; "></div>
234
+ <div id="yupick_info_time" style="display: none; width: 240px; "></div>
235
+ <div class="yclear"></div>
236
+ <div id="yupick_info_user" style="display: none; margin-left: 0; max-width: 240px; ">
237
+ <p><?php echo $this->__('&iquest;C&oacute;mo prefiere ser informado de cuando puede recoger su compra?') ?></p>
238
+ <div class="yupick_info_user_col">
239
+ <label><?php echo $this->__('Email') ?></label>
240
+ <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="Email" checked="checked" />
241
+ <input type="text" name="yupick_type_alert_email" id="yupick_type_alert_email" value="<?php echo $this->getQuote()->getShippingAddress()->getEmail(); ?>" style="width: 200px; " />
242
+ </div>
243
+ <div class="yupick_info_user_col">
244
+ <label><?php echo $this->__('SMS - Tel&eacute;fono M&oacute;vil') ?></label>
245
+ <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="SMS" />
246
+ <input type="text" name="yupick_type_alert_phone" id="yupick_type_alert_phone" value="<?php echo $this->getQuote()->getShippingAddress()->getTelephone(); ?>" />
247
+ </div>
248
+ </div>
249
+ <div class="yclear"><br /></div>
250
+
251
+ <div id="loadingmask" style="display: none;">
252
+ <div class="loader" id="loading-mask-loader"><img src="<?php echo($this->getSkinUrl('images/yupick/opc-ajax-loader.gif')) ?>" alt="<?php echo $this->__('Loading...') ?>" /> <?php echo $this->__('Loading...') ?></div>
253
+ <div id="loading-mask"></div>
254
+ </div>
255
+
256
+ <?php endif; ?>
257
+
258
+
259
+ <?php endif ?>
260
+ </dt>
261
+ <?php endforeach; ?>
262
+ <?php endforeach; ?>
263
+ </dl>
264
+ <?php endif; ?>
265
+ <?php endif; ?>
app/locale/en_US/template/email/sales/order_new_yupick.html ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var store.getFrontendName()}}: New Order # {{var order.increment_id}} @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "var logo_alt":"Email Logo Image Alt",
6
+ "htmlescape var=$order.getCustomerName()":"Customer Name",
7
+ "var store.getFrontendName()":"Store Name",
8
+ "store url=\"customer/account/\"":"Customer Account Url",
9
+ "var order.increment_id":"Order Id",
10
+ "var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
11
+ "var order.getBillingAddress().format('html')":"Billing Address",
12
+ "var payment_html":"Payment Details",
13
+ "var order.getShippingAddress().format('html')":"Shipping Address",
14
+ "var order.getShippingDescription()":"Shipping Description",
15
+ "layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
16
+ "var order.getEmailCustomerNote()":"Email Order Note"}
17
+ @-->
18
+ <!--@styles
19
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
20
+ @-->
21
+
22
+ <style type="text/css">
23
+ .fin {
24
+ color: #333;
25
+ }
26
+ body {
27
+ background-color: #FFF;
28
+ }
29
+ </style>
30
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
31
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
32
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
33
+ <tr>
34
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
35
+ <table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="950" style="border:1px solid #E0E0E0; color: #F30;">
36
+ <!-- [ header starts here] -->
37
+ <tr>
38
+ <td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
39
+ </tr>
40
+ <!-- [ middle starts here] -->
41
+ <tr>
42
+ <td valign="top">
43
+ <h1 class="fin" style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hola, {{htmlescape var=$order.getCustomerName()}}</h1></tr>
44
+ <tr>
45
+ <td>
46
+ <h2 class="fin" style="font-size:18px; font-weight:normal; margin:0;">Su pedido #{{var order.increment_id}} <small>(placed on {{var order.getCreatedAtFormated('long')}})</small></h2>
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td height="292">
51
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
52
+ <thead>
53
+ <tr>
54
+ <th align="left" width="467" bgcolor="#FF3300" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em; color: #FFF;">Factura:</th>
55
+ <th width="10"></th>
56
+ <th align="left" width="451" bgcolor="#FF3300" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em; color: #FFF;">Forma de Pago:</th>
57
+ </tr>
58
+ </thead>
59
+ <tbody>
60
+ <tr>
61
+ <td width="467" height="138" valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
62
+ {{var order.getBillingAddress().format('html')}}
63
+ </td>
64
+ <td>&nbsp;</td>
65
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
66
+ {{var payment_html}}
67
+ </td>
68
+ </tr>
69
+ </tbody>
70
+ </table>
71
+ <br/>
72
+ {{depend order.getIsNotVirtual()}}
73
+ <table cellspacing="0" cellpadding="0" border="0" width="100%">
74
+ <thead>
75
+ <tr>
76
+ <th align="left" width="538" bgcolor="#FF3300" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em; color: #FFF;">Dirección de envío:</th>
77
+ <th width="10"></th>
78
+ <th align="left" width="384" bgcolor="#FF3300" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em; color: #FFF;">Forma de envío o Recogida:</th>
79
+ </tr>
80
+ </thead>
81
+ <tbody>
82
+ <tr>
83
+ <td height="148" valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
84
+ {{var order.getShippingAddress().format('html')}}
85
+ &nbsp;
86
+ </td>
87
+ <td>&nbsp;</td>
88
+ <td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
89
+ {{var order.getShippingDescription()}}
90
+ {{block type='yupick/email' order=$order}}
91
+ &nbsp;
92
+ </td>
93
+ </tr>
94
+ </tbody>
95
+ </table>
96
+ <p> {{/depend}}
97
+ {{layout handle="sales_email_order_items" order=$order}} </p>
98
+ <p class="fin" style="font-size:12px; margin:0 0 10px 0">{{var order.getEmailCustomerNote()}}</p>
99
+ <p class="fin" style="font-size:12px; margin:0 0 10px 0"><strong>MUCHAS GRACIAS POR TU COMPRA.</strong><BR>
100
+ <BR>
101
+ Tu pedido se ha procesado correctamente. <BR>
102
+ Por favor, comprueba que todos los datos son correctos. <BR>
103
+ <BR>
104
+ Esperamos que disfrutes de los productos adquiridos.</p>
105
+ </td>
106
+ </tr>
107
+ <tr>
108
+ <td bgcolor="#FF3300" align="center" style="background:#EAEAEA; text-align:center;"><center>
109
+ <p class="fin" style="font-size:12px; margin:0;">Gracias, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
110
+ </tr>
111
+ </table>
112
+ </td>
113
+ </tr>
114
+ </table>
115
+ </div>
116
+ </body>
js/yupick.js ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ PuntosYupick = Class.create();
3
+ PuntosYupick.prototype = {
4
+
5
+ initialize: function()
6
+ {
7
+ this.yupickResultados = '';
8
+
9
+ Event.observe(window, 'load', function()
10
+ {
11
+
12
+ $$('.main').invoke('observe', 'click', function(e)
13
+ {
14
+ var element = e.element();
15
+ //OJO: prueba error
16
+ if (element.getValue)
17
+ {
18
+ if (element.getValue() == 'yupick_yupick')
19
+ {
20
+ PuntosYupick.getPuntosYupick();
21
+ }
22
+ }
23
+ });
24
+ });
25
+
26
+ },
27
+
28
+ getPuntosYupick:function()
29
+ {
30
+ if ($('direccion').value == ', , ' && $('codigoPostal').value == '') {
31
+ $('direccion').value = '';
32
+ var index = $('billing:region_id').selectedIndex;
33
+ var provincia = index >= 0 ? $('billing:region_id').options[index].innerHTML : '';
34
+ $('direccion').value = $('billing:street1').value + ' ' + $('billing:street2').value
35
+ + ', ' + $('billing:city').value + ', '
36
+ + provincia;
37
+ $('codigoPostal').value = $('billing:postcode').value;
38
+ }
39
+ if ($('direccion').value == '' && $('codigoPostal').value == '') {
40
+ alert('Debe introducir la Calle y/o el Código Postal');
41
+ $('direccion').focus();
42
+ } else {
43
+ this.reloadurl = $('checkUrl').value;
44
+ Element.show('loadingmask');
45
+ if (!$('option_parking').checked) {
46
+ $('option_parking').value = '';
47
+ } else {
48
+ $('option_parking').value = 'on';
49
+ }
50
+ if (!$('option_wifi').checked) {
51
+ $('option_wifi').value = '';
52
+ } else {
53
+ $('option_wifi').value = 'on';
54
+ }
55
+ if (!$('option_alimentacion').checked) {
56
+ $('option_alimentacion').value = '';
57
+ } else {
58
+ $('option_alimentacion').value = 'on';
59
+ }
60
+ if (!$('option_prensa').checked) {
61
+ $('option_prensa').value = '';
62
+ } else {
63
+ $('option_prensa').value = 'on';
64
+ }
65
+ if (!$('option_tarjeta').checked) {
66
+ $('option_tarjeta').value = '';
67
+ } else {
68
+ $('option_tarjeta').value = 'on';
69
+ }
70
+ if (!$('option_mas20').checked) {
71
+ $('option_mas20').value = '';
72
+ } else {
73
+ $('option_mas20').value = 'on';
74
+ }
75
+ if (!$('option_sabados').checked) {
76
+ $('option_sabados').value = '';
77
+ } else {
78
+ $('option_sabados').value = 'on';
79
+ }
80
+ if (!$('option_domingos').checked) {
81
+ $('option_domingos').value = '';
82
+ } else {
83
+ $('option_domingos').value = 'on';
84
+ }
85
+
86
+ new Ajax.Request(this.reloadurl, {
87
+ method: 'post',
88
+ //OJO Cambios
89
+ parameters: {direccion: $('direccion').value,
90
+ codigoPostal: $('codigoPostal').value,
91
+ option_parking: $('option_parking').value,
92
+ option_wifi: $('option_wifi').value,
93
+ option_alimentacion: $('option_alimentacion').value,
94
+ option_prensa: $('option_prensa').value,
95
+ option_tarjeta: $('option_tarjeta').value,
96
+ option_mas20: $('option_mas20').value,
97
+ option_sabados: $('option_sabados').value,
98
+ option_domingos: $('option_domingos').value},
99
+ onComplete: this.reloadChildren.bind(this)
100
+ });
101
+ }
102
+
103
+ },
104
+
105
+ reloadChildren: function(transport){
106
+ Element.hide('loadingmask');
107
+ $('oficinas_yupick_content').setStyle({display: 'block'});
108
+ var jsonResponse=transport.responseText.evalJSON(true);
109
+ this.yupickResultados = jsonResponse;
110
+
111
+ this.fillDropDownYupick ($('oficinas_yupick'), this.yupickResultados.puntoentrega);
112
+ },
113
+
114
+ fillDropDownYupick:function (field, data)
115
+ {
116
+
117
+ for(i=field.options.length-1;i>=0;i--) { field.remove(i); }
118
+
119
+ data.each(
120
+ function(e) {
121
+ field.options.add(new Option(e.nombre+' - '+e.direccion+" - "+e.localidad+' ('+e.provincia+')',e.id));
122
+ }
123
+ );
124
+
125
+ this.yupickInfo()
126
+
127
+ },
128
+
129
+ changeYupickOptions:function ()
130
+ {
131
+ $('yupick_carrier_principal').toggle();
132
+ $('yupick_carrier_secundario').toggle();
133
+ if ($('yupick_carrier_secundario').visible())
134
+ {
135
+ $('yupick_options_text').replace('<span id="yupick_options_text">Menos opciones de b&uacute;squeda</span>');
136
+ } else {
137
+ $('yupick_options_text').replace('<span id="yupick_options_text">M&aacute;s opciones de b&uacute;squeda</span>');
138
+ }
139
+ },
140
+
141
+ yupickInfo:function()
142
+ {
143
+
144
+ var puntoActual = $('oficinas_yupick').value;
145
+ this.yupickResultados.puntoentrega.each(
146
+ function(e) {
147
+ if (e.id == puntoActual)
148
+ {
149
+ $('yupick_info_map').setStyle({display: 'block'});
150
+ $('yupick_info_time').setStyle({display: 'block'});
151
+ $('yupick_info_user').setStyle({display: 'block'});
152
+
153
+ $('oficinas_yupick_data').value = e.nombre+' - '+e.direccion+" - "+e.localidad+' ('+e.provincia+')';
154
+
155
+ // info del punto
156
+ this.infoGoogleMaps(e);
157
+ this.infoHorarios(e);
158
+
159
+ }
160
+ }.bind(this));
161
+
162
+ },
163
+
164
+ infoGoogleMaps:function(e)
165
+ {
166
+ var latlng = new google.maps.LatLng(e.poslatitud, e.poslongitud);
167
+ var myOptions = {
168
+ zoom: 16,
169
+ center: latlng,
170
+ mapTypeId: google.maps.MapTypeId.ROADMAP
171
+ };
172
+
173
+ var imagen = new google.maps.MarkerImage($('skinPath').value + 'frontend/default/default/images/yupick/globo.png', new google.maps.Size(100,47), new google.maps.Point(0,0), new google.maps.Point(50,47));
174
+ var sombra = new google.maps.MarkerImage($('skinPath').value + 'frontend/default/default/images/yupick/globosombra.png', new google.maps.Size(100,19), new google.maps.Point(0,0), new google.maps.Point(31,19));
175
+
176
+ var map = new google.maps.Map(document.getElementById("yupick_info_map"), myOptions);
177
+
178
+ var beachMarker = new google.maps.Marker({
179
+ position: latlng,
180
+ map: map,
181
+ icon: imagen,
182
+ shadow: sombra
183
+ });
184
+
185
+ },
186
+
187
+
188
+ infoHorarios: function (e)
189
+ {
190
+
191
+ var tablaHorarios = '<table><tr><th>&nbsp;</th><th>Ma&ntilde;ana</th><th>Tarde</td></tr>';
192
+ tablaHorarios += '<tr class="odd"><td>Lunes</td><td>'+e.horario.lunes.manana+'</td><td>'+e.horario.lunes.tarde+'</td></tr>';
193
+ tablaHorarios += '<tr class="even"><td>Martes</td><td>'+e.horario.martes.manana+'</td><td>'+e.horario.martes.tarde+'</td></tr>';
194
+ tablaHorarios += '<tr class="odd"><td>Mi&eacute;rcoles</td><td>'+e.horario.miercoles.manana+'</td><td>'+e.horario.miercoles.tarde+'</td></tr>';
195
+ tablaHorarios += '<tr class="even"><td>Jueves</td><td>'+e.horario.jueves.manana+'</td><td>'+e.horario.jueves.tarde+'</td></tr>';
196
+ tablaHorarios += '<tr class="odd"><td>Viernes</td><td>'+e.horario.viernes.manana+'</td><td>'+e.horario.viernes.tarde+'</td></tr>';
197
+ tablaHorarios += '<tr class="even"><td>S&aacute;bado</td><td>'+e.horario.sabado.manana+'</td><td>'+e.horario.sabado.tarde+'</td></tr>';
198
+ tablaHorarios += '<tr class="odd"><td>Domingo</td><td>'+e.horario.domingo.manana+'</td><td>'+e.horario.domingo.tarde+'</td></tr>';
199
+ tablaHorarios += '</table>';
200
+
201
+ $('yupick_info_time').update(tablaHorarios);
202
+
203
+ }
204
+ }
205
+
206
+ var PuntosYupick = new PuntosYupick();
207
+
208
+ var win = null;
209
+
210
+ function nuevaVentana(mypage, myname, w, h, scroll)
211
+ {
212
+ lpos = (screen.width) ? (screen.width-w)/2 : 0;
213
+ tpos = (screen.height) ? (screen.height-h)/2 : 0;
214
+ settings = 'height=' + h + ',width=' + w + ',top=' + tpos + ',left=' + lpos + ',scrollbars=' + scroll + ',resizable';
215
+ //alert(settings);
216
+ win = window.open(mypage,myname,settings);
217
+ }
package.xml CHANGED
@@ -1,20 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ydral_Yupick</name>
4
- <version>0.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>M&#xF3;dulo para Magento para integrar los puntos de recogida de Yupick!</summary>
10
  <description>M&#xF3;dulo para Magento para integrar los puntos de recogida de Yupick!</description>
11
- <notes>- En "M&#xE1;s opciones de b&#xFA;squeda", a&#xF1;adida la Calle y C&#xF3;digo Postal para permitir la b&#xFA;squeda de Puntos Yupick! en direcciones diferentes de la de Facturaci&#xF3;n y Entrega.&#xD;
12
  &#xD;
13
- - Se ha a&#xF1;adido el soporte para que en tiendas seguras (HTTPS), se muestre correctamente la ubicaci&#xF3;n del punto seleccionado.</notes>
 
 
14
  <authors><author><name>Ydral</name><user>Ydral</user><email>webmaster@ydral.com</email></author><author><name>Luis</name><user>Alvarez</user><email>lalvarez@boyaca.es</email></author></authors>
15
- <date>2012-11-30</date>
16
- <time>09:48:42</time>
17
- <contents><target name="magelocal"><dir name="Ydral"><dir name="Yupick"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="1034cd37c90415b735712913a7367521"/></dir></dir></dir></dir><file name="Yupick.php" hash="a44a88ca6668066be57617ef4bc59796"/></dir><dir name="Helper"><file name="Data.php" hash="d161e76c5b5bc5509c29ea72c8018c9c"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Boyaca"><file name="Collection.php" hash="546fd69029d924657d7ce322dbd588c5"/></dir><file name="Yupick.php" hash="3bbbd6befd30bfdf844011407fa4db1b"/></dir><file name="Observer.php" hash="881fb29024fee91bc6bf3ba800b1eeaf"/><dir name="Type"><file name="Onepage.php" hash="e7ba6c24d95bb588bff8e69a79cf71a0"/></dir><dir name="Ydral"><file name="Recogeroficina.php" hash="8d6297d5edbc727282b33491f64e5636"/><file name="Shipment.php" hash="59e8d255241f2261d65df8e6545b06ba"/><dir name="Source"><file name="Method.php" hash="99a702161e108c27f731626d8d1a32db"/></dir></dir><file name="Yupick.php" hash="d87f52757d55a01e5ed3de0952681234"/></dir><dir name="controllers"><file name="IndexController.php" hash="0c18e19eae0e199a7bf6a4802761ea5b"/></dir><dir name="etc"><file name="config.xml" hash="bd95ab43b6a18a9c2653dcd68e2fe6ec"/><file name="system.xml" hash="52213ea9b1f0ea4f1ee1ac09ecda0965"/></dir><dir name="sql"><dir name="yupick_setup"><file name="mysql4-install-0.1.0.php" hash="ad2f5cd741181e0cd71fbab193a80094"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.3.0-0.4.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="yupick.xml" hash="9314d2df7cf57c65074e18b5566b7c97"/></dir><dir name="template"><dir name="yupick"><file name="info.phtml" hash="e0eb4891c623f2042a16ac2b3d0666d2"/><file name="linksmaps.phtml" hash="33ec7673296ffff4418b2a15f676b2a8"/><file name="shipping.phtml" hash="8a2ab4744fc9a4c2a907907b8fdb0771"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="yupick.xml" hash="6cd118000269da3ef390d0c31ddea36d"/></dir><dir name="template"><dir name="yupick"><file name="tab_info.phtml" hash="494f48c9cf084fd08e2b7020513b88b5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ydral_Yupick.xml" hash="f420cc41a8935a25faa4c0df7ef4c1db"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="yupick.css" hash="8b41ae7949b8bde7ab6f0b0b31e48d13"/></dir><dir name="images"><dir name="yupick"><file name="globo.png" hash="d8880a99065ebb3ab173df27613abf93"/><file name="globosombra.png" hash="1a50fd383f17fe25cc74da661ddd6b5a"/><file name="logo.gif" hash="21a6ab44b6300a61ac978284c7bb09ad"/><file name="logo_small.gif" hash="1ea5b75df0babbde827d4761c942a746"/><file name="opc-ajax-loader.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/></dir></dir><dir name="js"><file name="yupick.js" hash="82da2f5bbbe1a17b4a670b58a0857209"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ydral_Yupick</name>
4
+ <version>0.6.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>M&#xF3;dulo para Magento para integrar los puntos de recogida de Yupick!</summary>
10
  <description>M&#xF3;dulo para Magento para integrar los puntos de recogida de Yupick!</description>
11
+ <notes>- Compatibilidad con m&#xF3;dulo OneStepCheckOut.com&#xD;
12
  &#xD;
13
+ - Implementada funcionalidad puntos Yupick en la opci&#xF3;n Reorder del BackOffice.&#xD;
14
+ &#xD;
15
+ - Al enviar la confirmaci&#xF3;n por correo, se incluyen los datos del Punto Yupick! seleccionado.</notes>
16
  <authors><author><name>Ydral</name><user>Ydral</user><email>webmaster@ydral.com</email></author><author><name>Luis</name><user>Alvarez</user><email>lalvarez@boyaca.es</email></author></authors>
17
+ <date>2013-01-28</date>
18
+ <time>08:38:59</time>
19
+ <contents><target name="magelocal"><dir name="Ydral"><dir name="Yupick"><dir name="Block"><dir name="Checkout"><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="1034cd37c90415b735712913a7367521"/></dir></dir></dir></dir><file name="Email.php" hash="affa2d386e25e2e517c70bca39988f7b"/><file name="Yupick.php" hash="a44a88ca6668066be57617ef4bc59796"/></dir><dir name="Helper"><file name="Data.php" hash="f91a2150e927d4a07b5280e8eff2575c"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Boyaca"><file name="Collection.php" hash="546fd69029d924657d7ce322dbd588c5"/></dir><file name="Yupick.php" hash="3bbbd6befd30bfdf844011407fa4db1b"/></dir><file name="Observer.php" hash="881fb29024fee91bc6bf3ba800b1eeaf"/><dir name="Type"><file name="Onepage.php" hash="e7ba6c24d95bb588bff8e69a79cf71a0"/></dir><dir name="Ydral"><file name="Recogeroficina.php" hash="3e0f0105d2b129dffd4c7ec0639d1eb0"/><file name="Shipment.php" hash="59e8d255241f2261d65df8e6545b06ba"/><dir name="Source"><file name="Method.php" hash="99a702161e108c27f731626d8d1a32db"/></dir></dir><file name="Yupick.php" hash="d87f52757d55a01e5ed3de0952681234"/></dir><dir name="controllers"><file name="IndexController.php" hash="0c18e19eae0e199a7bf6a4802761ea5b"/></dir><dir name="etc"><file name="config.xml" hash="88d26f19e2a937535775eae8d2cc8533"/><file name="system.xml" hash="52213ea9b1f0ea4f1ee1ac09ecda0965"/></dir><dir name="sql"><dir name="yupick_setup"><file name="mysql4-install-0.1.0.php" hash="ad2f5cd741181e0cd71fbab193a80094"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.3.0-0.4.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.4.0-0.5.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/><file name="mysql4-upgrade-0.5.0-0.6.0.php" hash="a91ac4d35130ff6d11d876c711f810e2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="yupick.xml" hash="47e25e15b6e638e6faa9b1c541ee2976"/></dir><dir name="template"><dir name="yupick"><file name="email.phtml" hash="c7880fe03a742e36e1f6fc1cea5c59a0"/><file name="info.phtml" hash="e0eb4891c623f2042a16ac2b3d0666d2"/><file name="linksmaps.phtml" hash="33ec7673296ffff4418b2a15f676b2a8"/><file name="onestepcheckout_shipping_method.phtml" hash="528c73f19b203e326c326ae19dd66da4"/><file name="shipping.phtml" hash="8a2ab4744fc9a4c2a907907b8fdb0771"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="yupick.xml" hash="f468af9371e3873ba8230fd69261fa97"/></dir><dir name="template"><dir name="yupick"><file name="form.phtml" hash="f042f294268c6b006e6bb19f9acabd58"/><file name="linksmaps.phtml" hash="b225326c5e2c60642d28cc9c983e4756"/><file name="tab_info.phtml" hash="494f48c9cf084fd08e2b7020513b88b5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ydral_Yupick.xml" hash="f420cc41a8935a25faa4c0df7ef4c1db"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="yupick.css" hash="8b41ae7949b8bde7ab6f0b0b31e48d13"/></dir><dir name="images"><dir name="yupick"><file name="globo.png" hash="d8880a99065ebb3ab173df27613abf93"/><file name="globosombra.png" hash="1a50fd383f17fe25cc74da661ddd6b5a"/><file name="logo.gif" hash="21a6ab44b6300a61ac978284c7bb09ad"/><file name="logo_small.gif" hash="1ea5b75df0babbde827d4761c942a746"/><file name="opc-ajax-loader.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/></dir></dir><dir name="js"><file name="yupick.js" hash="a0339cecae081e76723a4e9d84dfff0d"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><file name="yupick.css" hash="8b41ae7949b8bde7ab6f0b0b31e48d13"/><dir name="images"><dir name="yupick"><file name="logo_small.gif" hash="1ea5b75df0babbde827d4761c942a746"/><file name="opc-ajax-loader.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><file name="yupick.js" hash="a0339cecae081e76723a4e9d84dfff0d"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="sales"><file name="order_new_yupick.html" hash="0a813bcb2c89e335999d0efa7adac31c"/></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>
skin/adminhtml/default/default/images/yupick/logo_small.gif ADDED
Binary file
skin/adminhtml/default/default/images/yupick/opc-ajax-loader.gif ADDED
Binary file
skin/adminhtml/default/default/yupick.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #yupick_options .yupick_carrier_principal { margin-top: 10px; }
2
+ #yupick_options .yupick_carrier_secundario { margin-bottom: 10px; }
3
+ #yupick_options input { margin-right: 5px; }
4
+ #yupick_options label { margin-right: 8px; }
5
+ #oficinas_yupick_content { margin: 10px 0; }
6
+ #oficinas_yupick_content select { min-width: 450px; }
7
+ .yupick_actions { margin-top: 10px; }
8
+ .yupick_button_search { float: left; }
9
+ .yupick_control_options { float: left; margin-left: 15px; font-size: 12px; font-weight; bold; }
10
+ #loadingmask { clear: both; }
11
+ #yupick_info_map { float: left; border: 1px solid #ccc; width: 350px; height: 180px; margin-right: 10px; }
12
+ #yupick_info_time { float: left; width: 250px; height: 180px; }
13
+ #yupick_info_time table { width: 100%; }
14
+ #yupick_info_time table td,
15
+ #yupick_info_time table th { border-bottom: 2px solid #ccc; }
16
+ #yupick_info_time table th { font-weight: bold; }
17
+ .yclear { clear: both; }
18
+ #yupick_info_user { margin-left: 30px; margin-bottom: 20px; }
19
+ #yupick_info_user p { font-weight: bold; margin: 5px 0; }
20
+ #yupick_info_user .yupick_info_user_col { float: left; margin-right: 15px; }
21
+ #yupick_info_user .yupick_info_user_col label { display: block; margin-left: 15px; }
22
+ .yupick-icon-checkout { margin: 0 10px; }
skin/frontend/default/default/js/yupick.js CHANGED
@@ -27,6 +27,15 @@ PuntosYupick.prototype = {
27
 
28
  getPuntosYupick:function()
29
  {
 
 
 
 
 
 
 
 
 
30
  if ($('direccion').value == '' && $('codigoPostal').value == '') {
31
  alert('Debe introducir la Calle y/o el Código Postal');
32
  $('direccion').focus();
27
 
28
  getPuntosYupick:function()
29
  {
30
+ if ($('direccion').value == ', , ' && $('codigoPostal').value == '') {
31
+ $('direccion').value = '';
32
+ var index = $('billing:region_id').selectedIndex;
33
+ var provincia = index >= 0 ? $('billing:region_id').options[index].innerHTML : '';
34
+ $('direccion').value = $('billing:street1').value + ' ' + $('billing:street2').value
35
+ + ', ' + $('billing:city').value + ', '
36
+ + provincia;
37
+ $('codigoPostal').value = $('billing:postcode').value;
38
+ }
39
  if ($('direccion').value == '' && $('codigoPostal').value == '') {
40
  alert('Debe introducir la Calle y/o el Código Postal');
41
  $('direccion').focus();