Ydral_Yupick - Version 0.5.0

Version Notes

- En "Más opciones de búsqueda", añadida la Calle y Código Postal para permitir la búsqueda de Puntos Yupick! en direcciones diferentes de la de Facturación y Entrega.

- Se ha añadido el soporte para que en tiendas seguras (HTTPS), se muestre correctamente la ubicación del punto seleccionado.

Download this release

Release Info

Developer Ydral
Extension Ydral_Yupick
Version 0.5.0
Comparing to
See all releases


Code changes from version 0.4.0 to 0.5.0

app/code/local/Ydral/Yupick/Block/Checkout/Onepage/Shipping/Method/Available.php CHANGED
@@ -5,7 +5,7 @@ class Ydral_Yupick_Block_Checkout_Onepage_Shipping_Method_Available extends Mage
5
  {
6
  $codigoPostal = $this->getQuote()->getShippingAddress()->getPostcode();
7
 
8
- Mage::log($codigoPostal);
9
 
10
  $_htmlOficinas = Mage::getModel('yupick/ydral_recogeroficina')->getHtmlOficinas($codigoPostal);
11
 
5
  {
6
  $codigoPostal = $this->getQuote()->getShippingAddress()->getPostcode();
7
 
8
+ //Mage::log($codigoPostal);
9
 
10
  $_htmlOficinas = Mage::getModel('yupick/ydral_recogeroficina')->getHtmlOficinas($codigoPostal);
11
 
app/code/local/Ydral/Yupick/Model/Type/Onepage.php CHANGED
@@ -40,9 +40,35 @@ class Ydral_Yupick_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
40
  {
41
  $_cp = Mage::app()->getRequest()->getPost('oficinas_yupick_data');
42
 
43
- if ( ($shippingMethod == 'yupick_yupick') && (empty($_cp)) )
44
- {
45
- return array('error' => -1, 'message' => $this->_helper->__('No se ha especificado un punto de recogida.'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
 
48
  return parent::saveShippingMethod($shippingMethod);
40
  {
41
  $_cp = Mage::app()->getRequest()->getPost('oficinas_yupick_data');
42
 
43
+ if ($shippingMethod == 'yupick_yupick') {
44
+ if (empty($_cp)) {
45
+ return array('error' => -1, 'message' => $this->_helper->__('No se ha especificado un punto de recogida.'));
46
+ }
47
+ $_alert = Mage::app()->getRequest()->getPost('yupick_type_alert');
48
+ $_email = Mage::app()->getRequest()->getPost('yupick_type_alert_email');
49
+ $_movil = Mage::app()->getRequest()->getPost('yupick_type_alert_phone');
50
+
51
+ if ($_alert == 'Email') {
52
+ if ($_email == "" || !filter_var($_email, FILTER_VALIDATE_EMAIL)) {
53
+ return array('error' => -1, 'message' => $this->_helper->__('Dirección de Correo no válida.'));
54
+ }
55
+ } else if ($_alert == 'SMS') {
56
+ if ($_movil == "" || strlen($_movil) < 9) {
57
+ return array('error' => -1, 'message' => $this->_helper->__('Número de móvil no válido.'));
58
+ } else {
59
+ if (strlen($_movil) == 9 && substr($_movil, 0, 1) != "6" && substr($_movil, 0, 1) != "7") {
60
+ return array('error' => -1, 'message' => $this->_helper->__('Número de móvil no pertenece a España.'));
61
+ } else if (strlen($_movil) == 11 && substr($_movil, 0, 2) == "34"
62
+ && substr($_movil, 2, 1) != "6" && substr($_movil, 2, 1) != "7") {
63
+ return array('error' => -1, 'message' => $this->_helper->__('Número de móvil no pertenece a España.'));
64
+ } else if (strlen($_movil) == 12 && substr($_movil, 0, 3) == "+34"
65
+ && substr($_movil, 3, 1) != "6" && substr($_movil, 3, 1) != "7") {
66
+ return array('error' => -1, 'message' => $this->_helper->__('Número de móvil no pertenece a España.'));
67
+ } else if (strlen($_movil) >= 13) {
68
+ return array('error' => -1, 'message' => $this->_helper->__('Número de móvil no pertenece a España.'));
69
+ }
70
+ }
71
+ }
72
  }
73
 
74
  return parent::saveShippingMethod($shippingMethod);
app/code/local/Ydral/Yupick/Model/Ydral/Recogeroficina.php CHANGED
@@ -28,7 +28,13 @@ class Ydral_Yupick_Model_Ydral_Recogeroficina extends Mage_Shipping_Model_Carrie
28
  $request->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $request->getStore()))
29
  ->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $request->getStore()));
30
  }
31
-
 
 
 
 
 
 
32
 
33
  /**
34
  *
@@ -174,9 +180,9 @@ class Ydral_Yupick_Model_Ydral_Recogeroficina extends Mage_Shipping_Model_Carrie
174
  if (!Mage::getStoreConfig('yupick/general/active')) return false;
175
  if (!Mage::getStoreConfig('yupick/general/etiquetador')) return false;
176
 
177
- Mage::log($data);
178
  $URL=Mage::helper('yupick')->getUrlRequestCarrier();
179
- Mage::log($URL);
180
  $client = new SoapClient($URL);
181
  // Realizamos la peticion
182
  $result = $client->getBuscarPuntos(Mage::getStoreConfig('yupick/general/etiquetador'),$data['codigoPostal'],$data['direccion'],$data['option_parking'],$data['option_wifi'],$data['option_alimentacion'],$data['option_prensa'],$data['option_tarjeta'],$data['option_mas20'],$data['option_sabados'],$data['option_domingos']);
28
  $request->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $request->getStore()))
29
  ->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $request->getStore()));
30
  }
31
+
32
+ //Yupick limite de kilos
33
+ if ($request->getPackageWeight() > 20)
34
+ {
35
+ return false;
36
+ }
37
+
38
 
39
  /**
40
  *
180
  if (!Mage::getStoreConfig('yupick/general/active')) return false;
181
  if (!Mage::getStoreConfig('yupick/general/etiquetador')) return false;
182
 
183
+ //Mage::log($data);
184
  $URL=Mage::helper('yupick')->getUrlRequestCarrier();
185
+ //Mage::log($URL);
186
  $client = new SoapClient($URL);
187
  // Realizamos la peticion
188
  $result = $client->getBuscarPuntos(Mage::getStoreConfig('yupick/general/etiquetador'),$data['codigoPostal'],$data['direccion'],$data['option_parking'],$data['option_wifi'],$data['option_alimentacion'],$data['option_prensa'],$data['option_tarjeta'],$data['option_mas20'],$data['option_sabados'],$data['option_domingos']);
app/code/local/Ydral/Yupick/controllers/IndexController.php CHANGED
@@ -4,7 +4,7 @@ class Ydral_Yupick_IndexController extends Mage_Core_Controller_Front_Action
4
  {
5
  public function getdataAction()
6
  {
7
- Mage::log($this->getRequest()->isPost());
8
  if ($this->getRequest()->isPost())
9
  {
10
 
4
  {
5
  public function getdataAction()
6
  {
7
+ //Mage::log($this->getRequest()->isPost());
8
  if ($this->getRequest()->isPost())
9
  {
10
 
app/code/local/Ydral/Yupick/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <config>
4
  <modules>
5
  <Ydral_Yupick>
6
- <version>0.4.0</version>
7
  </Ydral_Yupick>
8
  </modules>
9
  <global>
3
  <config>
4
  <modules>
5
  <Ydral_Yupick>
6
+ <version>0.5.0</version>
7
  </Ydral_Yupick>
8
  </modules>
9
  <global>
app/design/frontend/base/default/template/yupick/shipping.phtml CHANGED
@@ -140,12 +140,12 @@
140
  <div id="yupick_info_user" style="display: none; ">
141
  <p><?php echo $this->__('&iquest;C&oacute;mo prefiere ser informado de cuando puede recoger su compra?') ?></p>
142
  <div class="yupick_info_user_col">
143
- <label><?php echo $this->__('E-mail') ?></label>
144
  <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="Email" checked="checked" />
145
  <input type="text" name="yupick_type_alert_email" id="yupick_type_alert_email" value="<?php echo $this->getQuote()->getShippingAddress()->getEmail(); ?>" style="width: 200px; " />
146
  </div>
147
  <div class="yupick_info_user_col">
148
- <label><?php echo $this->__('Tel&eacute;fono') ?></label>
149
  <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="SMS" />
150
  <input type="text" name="yupick_type_alert_phone" id="yupick_type_alert_phone" value="<?php echo $this->getQuote()->getShippingAddress()->getTelephone(); ?>" />
151
  </div>
140
  <div id="yupick_info_user" style="display: none; ">
141
  <p><?php echo $this->__('&iquest;C&oacute;mo prefiere ser informado de cuando puede recoger su compra?') ?></p>
142
  <div class="yupick_info_user_col">
143
+ <label><?php echo $this->__('Email') ?></label>
144
  <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="Email" checked="checked" />
145
  <input type="text" name="yupick_type_alert_email" id="yupick_type_alert_email" value="<?php echo $this->getQuote()->getShippingAddress()->getEmail(); ?>" style="width: 200px; " />
146
  </div>
147
  <div class="yupick_info_user_col">
148
+ <label><?php echo $this->__('SMS - Tel&eacute;fono M&oacute;vil') ?></label>
149
  <input type="radio" name="yupick_type_alert" id="yupick_type_alert" value="SMS" />
150
  <input type="text" name="yupick_type_alert_phone" id="yupick_type_alert_phone" value="<?php echo $this->getQuote()->getShippingAddress()->getTelephone(); ?>" />
151
  </div>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ydral_Yupick</name>
4
- <version>0.4.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>
@@ -12,9 +12,9 @@
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-12</date>
16
- <time>14:53:19</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="0283b5f585e3899ee4893ac48ae4ed1b"/></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="cd0009f236027e74c474d54f37429c97"/></dir><dir name="Ydral"><file name="Recogeroficina.php" hash="ba9104bbd564e9469048d11992fbf572"/><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="a16ef94be4cdc58957914d86b074f8a8"/></dir><dir name="etc"><file name="config.xml" hash="7a49397888b43af36e46f3b167b70bf9"/><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="2a335ddab7fa1d03469b7b6bbef3cfc4"/></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.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>
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>