Version Notes
Completar el registro comunicandose al (55) 6363 1559 o enviar correo con el asunto Magento 99minutos.com a: hola@99minutos.com
Download this release
Release Info
Developer | 99 minutos |
Extension | 99minutos |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Godoparsa/Shipping/.DS_Store +0 -0
- app/code/community/Godoparsa/Shipping/Helper/Data.php +88 -0
- app/code/community/Godoparsa/Shipping/Model/.DS_Store +0 -0
- app/code/community/Godoparsa/Shipping/Model/Carrier.php +35 -0
- app/code/community/Godoparsa/Shipping/Model/Observer.php +181 -0
- app/code/community/Godoparsa/Shipping/etc/config.xml +74 -0
- app/code/community/Godoparsa/Shipping/etc/system.xml +90 -0
- app/code/community/Godoparsa/Shipping/sql/.DS_Store +0 -0
- app/code/community/Godoparsa/Shipping/sql/shipping_setup/mysql4-install-1.0.0.php +8 -0
- app/etc/modules/Godoparsa_Shipping.xml +14 -0
- app/locale/en_US/template/email/godoparsa_shipping.html +108 -0
- package.xml +35 -0
app/code/community/Godoparsa/Shipping/.DS_Store
ADDED
Binary file
|
app/code/community/Godoparsa/Shipping/Helper/Data.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Godoparsa_Shipping_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
const XML_PATH_ACTIVE = 'carriers/godoparsa_shipping/active';
|
5 |
+
const XML_PATH_NOTIFY_GENERAL_EMAIL = 'carriers/godoparsa_shipping/notify_general_email';
|
6 |
+
const XML_PATH_NOTIFY_SALES_EMAIL = 'carriers/godoparsa_shipping/notify_sales_email';
|
7 |
+
const XML_PATH_NOTIFY_SUPPORT_EMAIL = 'carriers/godoparsa_shipping/notify_support_email';
|
8 |
+
const XML_PATH_NOTIFY_CUSTOM1_EMAIL = 'carriers/godoparsa_shipping/notify_custom1_email';
|
9 |
+
const XML_PATH_NOTIFY_CUSTOM2_EMAIL = 'carriers/godoparsa_shipping/notify_custom2_email';
|
10 |
+
const XML_PATH_NOTIFY_EMAILS = 'carriers/godoparsa_shipping/notify_emails';
|
11 |
+
const XML_PATH_EMAIL_TEMPLATE = 'carriers/godoparsa_shipping/email_template';
|
12 |
+
|
13 |
+
public function isModuleEnabled($store = null)
|
14 |
+
{
|
15 |
+
return Mage::getStoreConfig(self::XML_PATH_ACTIVE, $store);
|
16 |
+
}
|
17 |
+
|
18 |
+
public function getNotifyGeneralEmail($store = null)
|
19 |
+
{
|
20 |
+
return Mage::getStoreConfig(self::XML_PATH_NOTIFY_GENERAL_EMAIL, $store);
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getNotifySalesEmail($store = null)
|
24 |
+
{
|
25 |
+
return Mage::getStoreConfig(self::XML_PATH_NOTIFY_SALES_EMAIL, $store);
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getNotifySupportEmail($store = null)
|
29 |
+
{
|
30 |
+
return Mage::getStoreConfig(self::XML_PATH_NOTIFY_SUPPORT_EMAIL, $store);
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getNotifyCustom1Email($store = null)
|
34 |
+
{
|
35 |
+
return Mage::getStoreConfig(self::XML_PATH_NOTIFY_CUSTOM1_EMAIL, $store);
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getNotifyCustom2Email($store = null)
|
39 |
+
{
|
40 |
+
return Mage::getStoreConfig(self::XML_PATH_NOTIFY_CUSTOM2_EMAIL, $store);
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getNotifyEmails($store = null)
|
44 |
+
{
|
45 |
+
$entries = Mage::getStoreConfig(self::XML_PATH_NOTIFY_EMAILS, $store);
|
46 |
+
$emails = array();
|
47 |
+
|
48 |
+
if (!empty($entries)) {
|
49 |
+
$entries = explode(PHP_EOL, $entries);
|
50 |
+
|
51 |
+
if (is_array($entries)) {
|
52 |
+
foreach ($entries as $entry) {
|
53 |
+
$_entry = trim($entry);
|
54 |
+
$_name = trim(substr($_entry, 0, strpos($_entry, '<')));
|
55 |
+
$_email = trim(substr($_entry, strpos($_entry, '<')+1, -1));
|
56 |
+
|
57 |
+
if (!empty($_name) && !empty($_email)) {
|
58 |
+
$emails[] = array('name'=>$_name, 'email'=>$_email);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
return $emails;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function getEmailTemplate($store = null)
|
68 |
+
{
|
69 |
+
return Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE, $store);
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* @param $identType ('general' or 'sales' or 'support' or 'custom1' or 'custom2')
|
74 |
+
* @param $option ('name' or 'email')
|
75 |
+
* @return string
|
76 |
+
*/
|
77 |
+
public function getStoreEmailAddressSenderOption($identType, $option)
|
78 |
+
{
|
79 |
+
if (!$generalContactName = Mage::getSingleton('core/config_data')->getCollection()->getItemByColumnValue('path', 'trans_email/ident_'.$identType.'/'.$option)) {
|
80 |
+
$conf = Mage::getSingleton('core/config')->init()->getXpath('/config/default/trans_email/ident_'.$identType.'/'.$option);
|
81 |
+
$generalContactName = array_shift($conf);
|
82 |
+
} else {
|
83 |
+
$generalContactName = $generalContactName->getValue();
|
84 |
+
}
|
85 |
+
|
86 |
+
return (string)$generalContactName;
|
87 |
+
}
|
88 |
+
}
|
app/code/community/Godoparsa/Shipping/Model/.DS_Store
ADDED
Binary file
|
app/code/community/Godoparsa/Shipping/Model/Carrier.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Godoparsa_Shipping_Model_Carrier
|
4 |
+
extends Mage_Shipping_Model_Carrier_Abstract
|
5 |
+
implements Mage_Shipping_Model_Carrier_Interface
|
6 |
+
{
|
7 |
+
|
8 |
+
protected $_code = 'godoparsa_shipping';
|
9 |
+
|
10 |
+
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
|
11 |
+
{
|
12 |
+
$result = Mage::getModel('shipping/rate_result');
|
13 |
+
$cp_pedido = $request->getDestPostcode();
|
14 |
+
$total_weight= $request->getPackageWeight();
|
15 |
+
$max_weight= 3000000000000;
|
16 |
+
$db = new mysqli("store.99minutos.com", "minutos_magento", "nz%^F&{OHP2w", "minutos_api");
|
17 |
+
$consulta_cp = $db->query("SELECT codigopostal FROM tbl_postalcode WHERE codigopostal = '$cp_pedido'");
|
18 |
+
$resultado_cp = mysqli_fetch_array($consulta_cp);
|
19 |
+
$cp_entrega = $resultado_cp['codigopostal'];
|
20 |
+
|
21 |
+
if (($cp_pedido = $cp_entrega) and ($total_weight <= $max_weight))
|
22 |
+
{
|
23 |
+
}
|
24 |
+
|
25 |
+
return $result;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getAllowedMethods()
|
29 |
+
{
|
30 |
+
return array(
|
31 |
+
'standard' => 'Standard delivery',
|
32 |
+
'express' => 'Express delivery',
|
33 |
+
);
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Godoparsa/Shipping/Model/Observer.php
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Godoparsa_Shipping_Model_Observer extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
public function sendNotificationEmailToAdmin($observer)
|
5 |
+
{
|
6 |
+
$order = $observer->getEvent()->getOrder();
|
7 |
+
$storeId = $order->getStoreId();
|
8 |
+
//Mage::log(var_export($order->debug(), TRUE));
|
9 |
+
$helper = Mage::helper('godoparsa_shipping');
|
10 |
+
|
11 |
+
if (!$helper->isModuleEnabled($storeId)) {
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
|
15 |
+
try {
|
16 |
+
$templateId = $helper->getEmailTemplate($storeId);
|
17 |
+
$programado = '99minutos.com - Programado mismo día';
|
18 |
+
$express = '99minutos.com - En menos de 99 minutos';
|
19 |
+
$envio = $order->getShippingDescription();
|
20 |
+
|
21 |
+
$mailer = Mage::getModel('core/email_template_mailer');
|
22 |
+
|
23 |
+
if ($helper->getNotifyGeneralEmail()) {
|
24 |
+
$emailInfo = Mage::getModel('core/email_info');
|
25 |
+
$emailInfo->addTo($helper->getStoreEmailAddressSenderOption('general', 'email'), $helper->getStoreEmailAddressSenderOption('general', 'name'));
|
26 |
+
$mailer->addEmailInfo($emailInfo);
|
27 |
+
}
|
28 |
+
|
29 |
+
if ($helper->getNotifySalesEmail()) {
|
30 |
+
$emailInfo = Mage::getModel('core/email_info');
|
31 |
+
$emailInfo->addTo($helper->getStoreEmailAddressSenderOption('sales', 'email'), $helper->getStoreEmailAddressSenderOption('sales', 'name'));
|
32 |
+
$mailer->addEmailInfo($emailInfo);
|
33 |
+
}
|
34 |
+
|
35 |
+
if ($helper->getNotifySupportEmail()) {
|
36 |
+
$emailInfo = Mage::getModel('core/email_info');
|
37 |
+
$emailInfo->addTo($helper->getStoreEmailAddressSenderOption('support', 'email'), $helper->getStoreEmailAddressSenderOption('support', 'name'));
|
38 |
+
$mailer->addEmailInfo($emailInfo);
|
39 |
+
}
|
40 |
+
|
41 |
+
if ($helper->getNotifyCustom1Email()) {
|
42 |
+
$emailInfo = Mage::getModel('core/email_info');
|
43 |
+
$emailInfo->addTo($helper->getStoreEmailAddressSenderOption('custom1', 'email'), $helper->getStoreEmailAddressSenderOption('custom1', 'name'));
|
44 |
+
$mailer->addEmailInfo($emailInfo);
|
45 |
+
}
|
46 |
+
|
47 |
+
if ($helper->getNotifyCustom2Email()) {
|
48 |
+
$emailInfo = Mage::getModel('core/email_info');
|
49 |
+
$emailInfo->addTo($helper->getStoreEmailAddressSenderOption('custom2', 'email'), $helper->getStoreEmailAddressSenderOption('custom2', 'name'));
|
50 |
+
$mailer->addEmailInfo($emailInfo);
|
51 |
+
}
|
52 |
+
|
53 |
+
foreach ($helper->getNotifyEmails() as $entry) {
|
54 |
+
$emailInfo = Mage::getModel('core/email_info');
|
55 |
+
$emailInfo->addTo($entry['email'], $entry['name']);
|
56 |
+
$mailer->addEmailInfo($emailInfo);
|
57 |
+
}
|
58 |
+
|
59 |
+
$mailer->setSender(array(
|
60 |
+
'name' => $helper->getStoreEmailAddressSenderOption('general', 'name'),
|
61 |
+
'email' => $helper->getStoreEmailAddressSenderOption('general', 'email'),
|
62 |
+
));
|
63 |
+
|
64 |
+
$mailer->setStoreId($storeId);
|
65 |
+
$mailer->setTemplateId($templateId);
|
66 |
+
$mailer->setTemplateParams(array(
|
67 |
+
'order' => $order,
|
68 |
+
));
|
69 |
+
if ($envio == $programado)
|
70 |
+
{
|
71 |
+
$mailer->send();
|
72 |
+
}
|
73 |
+
if ($envio == $express)
|
74 |
+
{
|
75 |
+
$mailer->send();
|
76 |
+
}
|
77 |
+
|
78 |
+
} catch (Exception $e) {
|
79 |
+
Mage::logException($e);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
public function shippedrequest( $observer)
|
83 |
+
{
|
84 |
+
$programado = '99minutos.com - Programado mismo día';
|
85 |
+
$express= '99minutos.com - En menos de 99 minutos';
|
86 |
+
$shipment= $observer->getEvent()->getShipment();
|
87 |
+
$order= $shipment->getOrder();
|
88 |
+
$shippingAddress= $order->getShippingAddress();
|
89 |
+
$shipping_method= $order->getShippingDescription();
|
90 |
+
if(($shipping_method == $express) or ($shipping_method == $programado))
|
91 |
+
{
|
92 |
+
$address= $shippingAddress->getstreet();
|
93 |
+
function reduce($v1,$v2)
|
94 |
+
{
|
95 |
+
return $v1.' '.$v2;
|
96 |
+
}
|
97 |
+
$address1= array_reduce($address,"reduce");
|
98 |
+
$city= $shippingAddress->getcity();
|
99 |
+
$province= $shippingAddress->getregion();
|
100 |
+
$zip= $shippingAddress->getpostcode();
|
101 |
+
$scearch= urlencode(implode(', ', array($address1,$city,$province,$zip)));
|
102 |
+
$request= "http://maps.googleapis.com/maps/api/geocode/json?address=".$scearch."&sensor=false";
|
103 |
+
$name= 'Orden: '.$order->getIncrementId().'';
|
104 |
+
$store= 'Tienda: chicpawscorner';//$order->getStoreName();
|
105 |
+
$email= $order->getCustomerEmail();
|
106 |
+
$phone= $shippingAddress->getTelephone();
|
107 |
+
$first_name= $shippingAddress->getFirstname();
|
108 |
+
$last_name= $shippingAddress->getLastname();
|
109 |
+
|
110 |
+
$ch=curl_init();
|
111 |
+
curl_setopt($ch, CURLOPT_URL, $request);
|
112 |
+
curl_setopt($ch, CURLOPT_HEADER, 0);
|
113 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
114 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
115 |
+
curl_setopt($ch, CURLOPT_HTTPGET, true);
|
116 |
+
$url = curl_exec($ch);
|
117 |
+
curl_close($ch);
|
118 |
+
|
119 |
+
$decoded_data= json_decode($url,true);
|
120 |
+
$latitude = $decoded_data['results']['0']['geometry']['location']['lat'];
|
121 |
+
$longitude = $decoded_data['results']['0']['geometry']['location']['lng'];
|
122 |
+
|
123 |
+
// variables
|
124 |
+
$api_key= '23894thfpoiq10fapo93fmapo';
|
125 |
+
$route= 'Descartes';
|
126 |
+
$street_number= '51+int+101';
|
127 |
+
$neighborhood= 'Anzures';
|
128 |
+
$locality= 'M%C3%A9xico';
|
129 |
+
$administrative_area_level_1= 'Distrito+Federal';
|
130 |
+
$postal_code= '11590';
|
131 |
+
$country= $locality;
|
132 |
+
$latlng= '19.4288373,-99.1765008';
|
133 |
+
$destination_route= urlencode($address1);
|
134 |
+
$destination_locality= urlencode($city);
|
135 |
+
$destination_administrative_area_level= urlencode($province);
|
136 |
+
$destination_postal_code= urlencode($zip);
|
137 |
+
$d_latlng= urlencode(implode(',', array($latitude,$longitude)));
|
138 |
+
$customer_phone= urlencode($phone);
|
139 |
+
$destination_country= $country;
|
140 |
+
$nombre= 'Cliente: '.implode(' ',array($first_name,$last_name)).'';
|
141 |
+
|
142 |
+
//Variable que pasa al sistema de 99minutos los datos en la seccion de notas
|
143 |
+
$notes=urlencode(implode(', ', array($store,$name,$nombre)));
|
144 |
+
|
145 |
+
//url que sirve para hacer la peticion de envion al sistema de 99minutos
|
146 |
+
$request_ship= "https://99minutos-dot-yaxiapi.appspot.com/2/delivery/request?";
|
147 |
+
$request_ship.= "api_key=".$api_key."&";
|
148 |
+
$request_ship.= "route=".$route."&";
|
149 |
+
$request_ship.= "street_number=".$street_number."&";
|
150 |
+
$request_ship.= "neighborhood=".$neighborhood."&";
|
151 |
+
$request_ship.= "locality=".$locality."&";
|
152 |
+
$request_ship.= "administrative_area_level_1=".$administrative_area_level_1."&";
|
153 |
+
$request_ship.= "postal_code=".$postal_code."&";
|
154 |
+
$request_ship.= "country=".$country."&";
|
155 |
+
$request_ship.= "latlng=".$d_latlng."&";
|
156 |
+
$request_ship.= "destination-route=".$destination_route."&";
|
157 |
+
$request_ship.= "destination-street_number=&";
|
158 |
+
$request_ship.= "destination-neighborhood=".$destination_locality."&";
|
159 |
+
$request_ship.= "destination-locality=".$destination_locality."&";
|
160 |
+
$request_ship.= "destination-administrative_area_level=".$destination_administrative_area_level."&";
|
161 |
+
$request_ship.= "destination-postal_code=".$destination_postal_code."&";
|
162 |
+
$request_ship.= "destination-country=".$destination_country."&";
|
163 |
+
$request_ship.= "destination-latlng=".$d_latlng."&";
|
164 |
+
$request_ship.= "customer_email=".$email."&";
|
165 |
+
$request_ship.= "customer_phone=".$customer_phone."&";
|
166 |
+
$request_ship.= "notification_email=¬es=".$notes."&dispatch=True";
|
167 |
+
|
168 |
+
//funcion curl para enviar la peticion de envio al sistema de 99minutos
|
169 |
+
$chr=curl_init();
|
170 |
+
curl_setopt($chr, CURLOPT_URL, $request_ship);
|
171 |
+
curl_setopt($chr, CURLOPT_SSL_VERIFYPEER, false);
|
172 |
+
curl_setopt($chr, CURLOPT_HEADER, false);
|
173 |
+
curl_setopt($chr, CURLOPT_RETURNTRANSFER, true);
|
174 |
+
curl_setopt($chr, CURLOPT_TIMEOUT, 1);
|
175 |
+
$url_request = curl_exec($chr);
|
176 |
+
curl_close($chr);
|
177 |
+
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
}
|
app/code/community/Godoparsa/Shipping/etc/config.xml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Godoparsa_Shipping>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Godoparsa_Shipping>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<resources>
|
10 |
+
<shipping_setup>
|
11 |
+
<setup>
|
12 |
+
<module>Godoparsa_Shipping</module>
|
13 |
+
</setup>
|
14 |
+
<connection>
|
15 |
+
<use>core_setup</use>
|
16 |
+
</connection>
|
17 |
+
</shipping_setup>
|
18 |
+
</resources>
|
19 |
+
<models>
|
20 |
+
<godoparsa_shipping>
|
21 |
+
<class>Godoparsa_Shipping_Model</class>
|
22 |
+
</godoparsa_shipping>
|
23 |
+
</models>
|
24 |
+
<helpers>
|
25 |
+
<godoparsa_shipping>
|
26 |
+
<class>Godoparsa_Shipping_Helper</class>
|
27 |
+
</godoparsa_shipping>
|
28 |
+
</helpers>
|
29 |
+
<blocks>
|
30 |
+
<godoparsa_shipping>
|
31 |
+
<class>Godoparsa_Shipping_Block</class>
|
32 |
+
</godoparsa_shipping>
|
33 |
+
</blocks>
|
34 |
+
<template>
|
35 |
+
<email>
|
36 |
+
<carriers_godoparsa_shipping_email_template>
|
37 |
+
<label>99minutos</label>
|
38 |
+
<file>godoparsa_shipping.html</file>
|
39 |
+
<type>html</type>
|
40 |
+
</carriers_godoparsa_shipping_email_template>
|
41 |
+
</email>
|
42 |
+
</template>
|
43 |
+
<events>
|
44 |
+
<sales_order_place_after>
|
45 |
+
<observers>
|
46 |
+
<godoparsa_shipping_sendNotificationEmailToAdmin>
|
47 |
+
<class>godoparsa_shipping/observer</class>
|
48 |
+
<method>sendNotificationEmailToAdmin</method>
|
49 |
+
</godoparsa_shipping_sendNotificationEmailToAdmin>
|
50 |
+
</observers>
|
51 |
+
</sales_order_place_after>
|
52 |
+
|
53 |
+
<sales_order_shipment_save_before>
|
54 |
+
<observers>
|
55 |
+
<godoparsa_shipping_shippedrequest>
|
56 |
+
<class>godoparsa_shipping/observer</class>
|
57 |
+
<method>shippedrequest</method>
|
58 |
+
</godoparsa_shipping_shippedrequest>
|
59 |
+
</observers>
|
60 |
+
</sales_order_shipment_save_before>
|
61 |
+
</events>
|
62 |
+
</global>
|
63 |
+
<default>
|
64 |
+
<carriers>
|
65 |
+
<godoparsa_shipping>
|
66 |
+
<active>1</active>
|
67 |
+
<sort_order>10</sort_order>
|
68 |
+
<model>godoparsa_shipping/carrier</model>
|
69 |
+
<title>99minutos.com</title>
|
70 |
+
<sort_order>10</sort_order>
|
71 |
+
</godoparsa_shipping>
|
72 |
+
</carriers>
|
73 |
+
</default>
|
74 |
+
</config>
|
app/code/community/Godoparsa/Shipping/etc/system.xml
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<carriers>
|
5 |
+
<groups>
|
6 |
+
<godoparsa_shipping translate="label" module="godoparsa_shipping">
|
7 |
+
<label>99minutos.com</label>
|
8 |
+
<sort_order>2</sort_order>
|
9 |
+
<show_in_default>1</show_in_default>
|
10 |
+
<show_in_website>0</show_in_website>
|
11 |
+
<show_in_store>0</show_in_store>
|
12 |
+
<fields>
|
13 |
+
<active translate="label">
|
14 |
+
<label>Enabled</label>
|
15 |
+
<frontend_type>select</frontend_type>
|
16 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
17 |
+
<sort_order>1</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>0</show_in_website>
|
20 |
+
<show_in_store>0</show_in_store>
|
21 |
+
</active>
|
22 |
+
<notify_general_email translate="label">
|
23 |
+
<label>Correo de notificación general</label>
|
24 |
+
<frontend_type>select</frontend_type>
|
25 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
26 |
+
<sort_order>2</sort_order>
|
27 |
+
<show_in_default>1</show_in_default>
|
28 |
+
<show_in_website>1</show_in_website>
|
29 |
+
<show_in_store>1</show_in_store>
|
30 |
+
</notify_general_email>
|
31 |
+
<notify_sales_email translate="label">
|
32 |
+
<label>Correo de notificación de ventas</label>
|
33 |
+
<frontend_type>select</frontend_type>
|
34 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
35 |
+
<sort_order>3</sort_order>
|
36 |
+
<show_in_default>1</show_in_default>
|
37 |
+
<show_in_website>1</show_in_website>
|
38 |
+
<show_in_store>1</show_in_store>
|
39 |
+
</notify_sales_email>
|
40 |
+
<notify_support_email translate="label">
|
41 |
+
<label>Correo de notificación de Soporte</label>
|
42 |
+
<frontend_type>select</frontend_type>
|
43 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
44 |
+
<sort_order>4</sort_order>
|
45 |
+
<show_in_default>1</show_in_default>
|
46 |
+
<show_in_website>1</show_in_website>
|
47 |
+
<show_in_store>1</show_in_store>
|
48 |
+
</notify_support_email>
|
49 |
+
<notify_custom1_email translate="label">
|
50 |
+
<label>Correo de notificación Extra 1</label>
|
51 |
+
<frontend_type>select</frontend_type>
|
52 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
53 |
+
<sort_order>5</sort_order>
|
54 |
+
<show_in_default>1</show_in_default>
|
55 |
+
<show_in_website>1</show_in_website>
|
56 |
+
<show_in_store>1</show_in_store>
|
57 |
+
</notify_custom1_email>
|
58 |
+
<notify_custom2_email translate="label">
|
59 |
+
<label>Correo de notificación Extra 2</label>
|
60 |
+
<frontend_type>select</frontend_type>
|
61 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
62 |
+
<sort_order>6</sort_order>
|
63 |
+
<show_in_default>1</show_in_default>
|
64 |
+
<show_in_website>1</show_in_website>
|
65 |
+
<show_in_store>1</show_in_store>
|
66 |
+
</notify_custom2_email>
|
67 |
+
<notify_emails translate="label">
|
68 |
+
<label>Correos de notificación</label>
|
69 |
+
<comment><![CDATA[Single or multiple emails in a following form "Firstname Lastname <email>", like "Branko Ajzele <branko@inchoo.net>", without quotation marks. In case of multiple entries, each entry goes on separate line.]]></comment>
|
70 |
+
<frontend_type>textarea</frontend_type>
|
71 |
+
<sort_order>7</sort_order>
|
72 |
+
<show_in_default>1</show_in_default>
|
73 |
+
<show_in_website>1</show_in_website>
|
74 |
+
<show_in_store>1</show_in_store>
|
75 |
+
</notify_emails>
|
76 |
+
<email_template translate="label">
|
77 |
+
<label>Template del correo</label>
|
78 |
+
<frontend_type>select</frontend_type>
|
79 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
80 |
+
<sort_order>8</sort_order>
|
81 |
+
<show_in_default>1</show_in_default>
|
82 |
+
<show_in_website>1</show_in_website>
|
83 |
+
<show_in_store>1</show_in_store>
|
84 |
+
</email_template>
|
85 |
+
</fields>
|
86 |
+
</godoparsa_shipping>
|
87 |
+
</groups>
|
88 |
+
</carriers>
|
89 |
+
</sections>
|
90 |
+
</config>
|
app/code/community/Godoparsa/Shipping/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Godoparsa/Shipping/sql/shipping_setup/mysql4-install-1.0.0.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$inbox = Mage::getModel('adminnotification/inbox');
|
3 |
+
$severity = Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE;
|
4 |
+
$title= "Gracias por elegir 99minutos.com. Por favor completa el proceso de alta para usar el servicio de logística web más rápido!";
|
5 |
+
$description="Para completar el proceso por favor comunicate a 99minutos.com al tel (55) 6363 1559 o envia un correo a hola@99minutos. Gracias!";
|
6 |
+
$url= "http://99minutos.com";
|
7 |
+
$inbox->add($severity, $title, $description, $url);
|
8 |
+
?>
|
app/etc/modules/Godoparsa_Shipping.xml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Godoparsa_Shipping>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<depends>
|
8 |
+
<Mage_Shipping />
|
9 |
+
<Mage_Sales />
|
10 |
+
<Mage_Adminhtml />
|
11 |
+
</depends>
|
12 |
+
</Godoparsa_Shipping>
|
13 |
+
</modules>
|
14 |
+
</config>
|
app/locale/en_US/template/email/godoparsa_shipping.html
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.getBillingAddress().getName()":"Guest Customer Name",
|
7 |
+
"var store.getFrontendName()":"Store Name",
|
8 |
+
"var order.increment_id":"Order Id",
|
9 |
+
"var order.getCreatedAtFormated('long')":"Order Created At (datetime)",
|
10 |
+
"var order.getBillingAddress().format('html')":"Billing Address",
|
11 |
+
"var payment_html":"Payment Details",
|
12 |
+
"var order.getShippingAddress().format('html')":"Shipping Address",
|
13 |
+
"var order.getShippingDescription()":"Shipping Description",
|
14 |
+
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
|
15 |
+
"var order.getEmailCustomerNote()":"Email Order Note"}
|
16 |
+
@-->
|
17 |
+
<!--@styles
|
18 |
+
body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
|
19 |
+
@-->
|
20 |
+
|
21 |
+
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
22 |
+
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
23 |
+
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
24 |
+
<tr>
|
25 |
+
<td align="center" valign="top" style="padding:20px 0 20px 0">
|
26 |
+
<!-- [ header starts here] -->
|
27 |
+
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
28 |
+
<tr>
|
29 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
30 |
+
</tr>
|
31 |
+
<!-- [ middle starts here] -->
|
32 |
+
<tr>
|
33 |
+
<td valign="top">
|
34 |
+
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;">ORDEN CON ENVIO PARA 99MINUTOS, {{htmlescape var=$order.getBillingAddress().getName()}}</h1>
|
35 |
+
<p style="font-size:12px; line-height:16px; margin:0 0 10px 0;">
|
36 |
+
Thank you for your order from {{var store.getFrontendName()}}.
|
37 |
+
Once your package ships we will send an email with a link to track your order.
|
38 |
+
If you have any questions about your order please contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
|
39 |
+
</p>
|
40 |
+
<p style="font-size:12px; line-height:16px; margin:0;">Your order confirmation is below. Thank you again for your business.</p>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td>
|
45 |
+
<h2 style="font-size:18px; font-weight:normal; margin:0;">Your Order #{{var order.increment_id}} <small>(placed on {{var order.getCreatedAtFormated('long')}})</small></h2>
|
46 |
+
</td>
|
47 |
+
</tr>
|
48 |
+
<tr>
|
49 |
+
<td>
|
50 |
+
<table cellspacing="0" cellpadding="0" border="0" width="650">
|
51 |
+
<thead>
|
52 |
+
<tr>
|
53 |
+
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Billing Information:</th>
|
54 |
+
<th width="10"></th>
|
55 |
+
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Payment Method:</th>
|
56 |
+
</tr>
|
57 |
+
</thead>
|
58 |
+
<tbody>
|
59 |
+
<tr>
|
60 |
+
<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;">
|
61 |
+
{{var order.getBillingAddress().format('html')}}
|
62 |
+
</td>
|
63 |
+
<td> </td>
|
64 |
+
<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;">
|
65 |
+
{{var payment_html}}
|
66 |
+
</td>
|
67 |
+
</tr>
|
68 |
+
</tbody>
|
69 |
+
</table>
|
70 |
+
<br/>
|
71 |
+
{{depend order.getIsNotVirtual()}}
|
72 |
+
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
73 |
+
<thead>
|
74 |
+
<tr>
|
75 |
+
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Information:</th>
|
76 |
+
<th width="10"></th>
|
77 |
+
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;">Shipping Method:</th>
|
78 |
+
</tr>
|
79 |
+
</thead>
|
80 |
+
<tbody>
|
81 |
+
<tr>
|
82 |
+
<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;">
|
83 |
+
{{var order.getShippingAddress().format('html')}}
|
84 |
+
|
85 |
+
</td>
|
86 |
+
<td> </td>
|
87 |
+
<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;">
|
88 |
+
{{var order.getShippingDescription()}}
|
89 |
+
|
90 |
+
</td>
|
91 |
+
</tr>
|
92 |
+
</tbody>
|
93 |
+
</table>
|
94 |
+
<br/>
|
95 |
+
{{/depend}}
|
96 |
+
{{layout handle="sales_email_order_items" order=$order}}
|
97 |
+
<p style="font-size:12px; margin:0 10px 10px 0">{{var order.getEmailCustomerNote()}}</p>
|
98 |
+
</td>
|
99 |
+
</tr>
|
100 |
+
<tr>
|
101 |
+
<td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
|
102 |
+
</tr>
|
103 |
+
</table>
|
104 |
+
</td>
|
105 |
+
</tr>
|
106 |
+
</table>
|
107 |
+
</div>
|
108 |
+
</body>
|
package.xml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>99minutos</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>All rights reserved</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>The fastest shipping for online shopping. (Only available in Guadalajara & Mexico City)</summary>
|
10 |
+
<description>Only available in Guadalajara & Mexico City
|
11 |
+

|
12 |
+
99minutos.com
|
13 |
+

|
14 |
+
99minutos.com is an e-commerce ultra fast delivery service. You buy and you receive in less than 99 minutes! You can also track your product from your smartphone live! 
|
15 |
+
You can also pay the product once it arrives, no need to pay online and you can order more than one product, try it on, and if you don’t like it you can return it right there.
|
16 |
+
99minutos.com has a fulfilment service in which we will take care of all your deliveries and you can take care of selling. 
|
17 |
+
Easy, smart and ultra fast!
|
18 |
+

|
19 |
+
99minutos.com The fastest shipping for online shopping!
|
20 |
+

|
21 |
+
Únicamente disponible en la Ciudad de México y Guadalajara
|
22 |
+

|
23 |
+
Servicio de logistica para tiendas en linea donde compras y en tiempo record recibes el producto. Ademas rastrea tu envío desde tu dispositivo móvil! 99minutos.com también ofrece sus bodegas para realizar un fulfillment completo de tus producto. 
|
24 |
+
Es muy sencillo y muy rápido.
|
25 |
+
Compra y recibe en menos de 99 minutos, rastrea el producto en vivo, paga el producto en contra entrega, prueba varios productos y quédate con el que mas te gusta! Todas estas soluciones con solo un click.
|
26 |
+

|
27 |
+
De lo quiero, a lo tengo en menos de 99 minutos.</description>
|
28 |
+
<notes>Completar el registro comunicandose al (55) 6363 1559 o enviar correo con el asunto Magento 99minutos.com a: hola@99minutos.com</notes>
|
29 |
+
<authors><author><name>99minutos</name><user>99minutos</user><email>saul@99minutos.com</email></author></authors>
|
30 |
+
<date>2015-02-19</date>
|
31 |
+
<time>06:05:39</time>
|
32 |
+
<contents><target name="magecommunity"><dir name="Godoparsa"><dir name="Shipping"><dir name="Helper"><file name="Data.php" hash="1c6839600686b48a7ce1d19b4d1350d7"/></dir><dir name="Model"><file name="Carrier.php" hash="774778c344f8fb4b709276ed66f2f609"/><file name="Observer.php" hash="1a6171e2ca2debce5505069f08fea79c"/><file name=".DS_Store" hash="8e927e15d29c07b05d4dca1375302c38"/></dir><dir name="etc"><file name="config.xml" hash="e6387c450d1499f3cb7971f0cd75a5b8"/><file name="system.xml" hash="9bceeef1dd7309e07ce93a5fec17ee7c"/></dir><dir name="sql"><dir name="shipping_setup"><file name="mysql4-install-1.0.0.php" hash="cd2cca9fdad6a1c1ac4b31687a9be8a9"/></dir><file name=".DS_Store" hash="b7eb3510c7ee85f2982975a460037ca3"/></dir><file name=".DS_Store" hash="76942eb471c322a4a461a24e557dd4e8"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Godoparsa_Shipping.xml" hash="e3018fdc7c5f7f2db4a31313d275eb0e"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="godoparsa_shipping.html" hash="be5fbe33f6fc64d02375bec27a10d77b"/></dir></dir></dir></target></contents>
|
33 |
+
<compatible/>
|
34 |
+
<dependencies><required><php><min>5.3.0</min><max>5.4.30</max></php></required></dependencies>
|
35 |
+
</package>
|