Version Notes
Completar el registro contactando a los telefonos +52 (55) 6363 1559 o enviando un correo a hola@99minutos.com.
Download this release
Release Info
Developer | 99 minutos |
Extension | 99minutos |
Version | 2.0.0 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 2.0.0
- app/code/community/Godoparsa/Shipping/.DS_Store +0 -0
- app/code/community/Godoparsa/Shipping/Model/.DS_Store +0 -0
- app/code/community/Godoparsa/Shipping/Model/Carrier.php +61 -53
- app/code/community/Godoparsa/Shipping/Model/Observer.php +46 -120
- app/code/community/Godoparsa/Shipping/etc/.DS_Store +0 -0
- app/code/community/Godoparsa/Shipping/etc/config.xml +1 -1
- app/code/community/Godoparsa/Shipping/etc/system.xml +1 -1
- app/code/community/Godoparsa/Shipping/sql/.DS_Store +0 -0
- app/code/community/Godoparsa/Shipping/sql/godoparsa_shipping_setup/install-1.3.0.php +0 -16
- app/code/community/Godoparsa/Shipping/sql/godoparsa_shipping_setup/install-2.0.0.php +36 -0
- package.xml +4 -4
app/code/community/Godoparsa/Shipping/.DS_Store
CHANGED
Binary file
|
app/code/community/Godoparsa/Shipping/Model/.DS_Store
CHANGED
Binary file
|
app/code/community/Godoparsa/Shipping/Model/Carrier.php
CHANGED
@@ -9,70 +9,78 @@ class Godoparsa_Shipping_Model_Carrier
|
|
9 |
|
10 |
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
|
11 |
{
|
|
|
|
|
|
|
12 |
$shop= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
13 |
-
$
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
if (($cp_pedido = $cp_entrega) and ($total_weight <= $max_weight))
|
31 |
{
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
return $result;
|
37 |
-
}
|
38 |
}
|
39 |
|
40 |
public function getAllowedMethods()
|
41 |
{
|
42 |
return array(
|
43 |
-
|
44 |
-
|
45 |
);
|
46 |
}
|
47 |
|
48 |
-
protected function _getStandardRate()
|
49 |
-
{
|
50 |
-
/** @var Mage_Shipping_Model_Rate_Result_Method $rate */
|
51 |
-
$rate = Mage::getModel('shipping/rate_result_method');
|
52 |
-
|
53 |
-
$rate->setCarrier($this->_code);
|
54 |
-
$rate->setCarrierTitle($this->getConfigData('title'));
|
55 |
-
$rate->setMethod('large');
|
56 |
-
$rate->setMethodTitle('Programado mismo día');
|
57 |
-
$rate->setPrice(85);
|
58 |
-
$rate->setCost(0);
|
59 |
-
|
60 |
-
return $rate;
|
61 |
-
}
|
62 |
-
|
63 |
-
protected function _getExpressRate()
|
64 |
-
{
|
65 |
-
/** @var Mage_Shipping_Model_Rate_Result_Method $rate */
|
66 |
-
$rate = Mage::getModel('shipping/rate_result_method');
|
67 |
-
|
68 |
-
$rate->setCarrier($this->_code);
|
69 |
-
$rate->setCarrierTitle($this->getConfigData('title'));
|
70 |
-
$rate->setMethod('express');
|
71 |
-
$rate->setMethodTitle('En menos de 99 minutos');
|
72 |
-
$rate->setPrice(115);
|
73 |
-
$rate->setCost(0);
|
74 |
-
|
75 |
-
return $rate;
|
76 |
-
}
|
77 |
}
|
78 |
?>
|
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 |
$shop= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
16 |
+
$freeship = $request->getFreeShipping();
|
17 |
+
$country = $request->getDestCountryId();
|
18 |
+
if ($freeship == True) {
|
19 |
+
$ship = 'True';
|
20 |
+
}
|
21 |
+
else {
|
22 |
+
$ship = 'False';
|
23 |
+
}
|
24 |
+
//Mage::log(var_export($request->debug(), TRUE));
|
25 |
+
$content = array(
|
26 |
+
'Shop' => $shop,
|
27 |
+
'Freeship' => $ship ,
|
28 |
+
'PostalCode' => $cp_pedido,
|
29 |
+
'TotalWeight' => $total_weight,
|
30 |
+
'Country' => $country
|
31 |
+
);
|
32 |
+
|
33 |
+
$ch = curl_init('http://api.99minutos.com/magento/shippingrate.php');
|
34 |
+
curl_setopt_array($ch, array(
|
35 |
+
CURLOPT_POST => TRUE,
|
36 |
+
CURLOPT_RETURNTRANSFER => TRUE,
|
37 |
+
CURLOPT_HTTPHEADER => array(
|
38 |
+
'Content-Type: application/json'
|
39 |
+
),
|
40 |
+
CURLOPT_POSTFIELDS => json_encode($content)
|
41 |
+
));
|
42 |
|
43 |
+
// Send the request
|
44 |
+
$response = curl_exec($ch);
|
45 |
+
$responseData = json_decode($response, TRUE);
|
46 |
+
curl_close($response);
|
47 |
+
if ($responseData['Status'] == 'OK')
|
|
|
48 |
{
|
49 |
+
//Mage::log(var_export($responseData, TRUE));
|
50 |
+
|
51 |
+
$schedule_data = $responseData['Rates']['Schedule'];
|
52 |
+
$schedule = Mage::getModel('shipping/rate_result_method');
|
53 |
+
$schedule->setCarrier($this->_code);
|
54 |
+
$schedule->setCarrierTitle($schedule_data['CarrierTitle']);
|
55 |
+
$schedule->setMethod($schedule_data['Method']);
|
56 |
+
$schedule->setMethodTitle($schedule_data['Title']);
|
57 |
+
$schedule->setPrice($schedule_data['Price']);
|
58 |
+
$schedule->setCost($schedule_data['Cost']);
|
59 |
+
|
60 |
+
$express_data = $responseData['Rates']['Express'];
|
61 |
+
$express = Mage::getModel('shipping/rate_result_method');
|
62 |
+
$express->setCarrier($this->_code);
|
63 |
+
$express->setCarrierTitle($express_data['CarrierTitle']);
|
64 |
+
$express->setMethod($express_data['Method']);
|
65 |
+
$express->setMethodTitle($express_data['Title']);
|
66 |
+
$express->setPrice($express_data['Price']);
|
67 |
+
$express->setCost($express_data['Cost']);
|
68 |
+
|
69 |
+
|
70 |
+
$result->append($schedule);
|
71 |
+
$result->append($express);
|
72 |
+
}
|
73 |
+
return $result;
|
74 |
|
|
|
|
|
75 |
}
|
76 |
|
77 |
public function getAllowedMethods()
|
78 |
{
|
79 |
return array(
|
80 |
+
'standard' => 'Standard delivery',
|
81 |
+
'express' => 'Express delivery',
|
82 |
);
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
?>
|
app/code/community/Godoparsa/Shipping/Model/Observer.php
CHANGED
@@ -78,142 +78,68 @@ class Godoparsa_Shipping_Model_Observer extends Mage_Core_Helper_Abstract
|
|
78 |
Mage::logException($e);
|
79 |
}
|
80 |
}
|
81 |
-
public function shippedrequest(
|
82 |
{
|
83 |
-
$
|
84 |
-
$express= '
|
85 |
$shipment= $observer->getEvent()->getShipment();
|
86 |
$order= $shipment->getOrder();
|
87 |
-
|
88 |
-
|
89 |
-
if(($shipping_method == $express) or ($shipping_method == $programado))
|
90 |
{
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
96 |
$address= $shippingAddress->getstreet();
|
97 |
function reduce($v1,$v2)
|
98 |
{
|
99 |
return $v1.' '.$v2;
|
100 |
}
|
101 |
-
$
|
102 |
$city= $shippingAddress->getcity();
|
103 |
$province= $shippingAddress->getregion();
|
104 |
$zip= $shippingAddress->getpostcode();
|
105 |
-
$
|
106 |
-
$request= "http://maps.googleapis.com/maps/api/geocode/json?address=".$scearch."&sensor=false";
|
107 |
-
$name= 'Orden: '.$order->getIncrementId().'';
|
108 |
-
$store= 'Tienda:'.$resutl_set['cliente'].'';//$order->getStoreName();
|
109 |
$email= $order->getCustomerEmail();
|
110 |
$phone= $shippingAddress->getTelephone();
|
111 |
$first_name= $shippingAddress->getFirstname();
|
112 |
-
$last_name= $shippingAddress->getLastname();
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
curl_setopt($ch, CURLOPT_HEADER, 0);
|
117 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
118 |
-
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
|
119 |
-
curl_setopt($ch, CURLOPT_HTTPGET, true);
|
120 |
-
$url = curl_exec($ch);
|
121 |
-
curl_close($ch);
|
122 |
-
|
123 |
-
$decoded_data= json_decode($url,true);
|
124 |
-
$latitude = $decoded_data['results']['0']['geometry']['location']['lat'];
|
125 |
-
$longitude = $decoded_data['results']['0']['geometry']['location']['lng'];
|
126 |
-
|
127 |
-
// variables
|
128 |
-
$api_key= '23894thfpoiq10fapo93fmapo';
|
129 |
-
$user_id= urlencode($result_set['user_id']);
|
130 |
-
$route= urlencode($resutl_set['route']);
|
131 |
-
$street_number= urlencode($resutl_set['street_number']);
|
132 |
-
$neighborhood= urlencode($resutl_set['neighborhood']);
|
133 |
-
$locality= urlencode($resutl_set['locality']);
|
134 |
-
$administrative_area_level_1= urlencode($resutl_set['administrative_area']);
|
135 |
-
$postal_code= urlencode($resutl_set['postal_code']);
|
136 |
-
$country= $locality;
|
137 |
-
$latlng= urlencode($resutl_set['latlng']);
|
138 |
-
$destination_route= urlencode($address1);
|
139 |
-
$destination_locality= urlencode($city);
|
140 |
-
$destination_administrative_area_level= urlencode($province);
|
141 |
-
$destination_postal_code= urlencode($zip);
|
142 |
-
$d_latlng= urlencode(implode(',', array($latitude,$longitude)));
|
143 |
-
$customer_phone= urlencode($phone);
|
144 |
-
$destination_country= $country;
|
145 |
-
$nombre= 'Cliente: '.implode(' ',array($first_name,$last_name)).'';
|
146 |
-
|
147 |
-
//Variable que pasa al sistema de 99minutos los datos en la seccion de notas
|
148 |
-
$notes=urlencode(implode(', ', array($store,$name,$nombre)));
|
149 |
-
|
150 |
-
//url que sirve para hacer la peticion de envion al sistema de 99minutos
|
151 |
-
$request_ship= "https://99minutos-dot-yaxiapi.appspot.com/2/delivery/request?";
|
152 |
-
$request_ship.= "api_key=".$api_key."&";
|
153 |
-
$request_ship.= "route=".$route."&";
|
154 |
-
$request_ship.= "street_number=".$street_number."&";
|
155 |
-
$request_ship.= "neighborhood=".$neighborhood."&";
|
156 |
-
$request_ship.= "locality=".$locality."&";
|
157 |
-
$request_ship.= "administrative_area_level_1=".$administrative_area_level_1."&";
|
158 |
-
$request_ship.= "postal_code=".$postal_code."&";
|
159 |
-
$request_ship.= "country=".$country."&";
|
160 |
-
$request_ship.= "latlng=".$d_latlng."&";
|
161 |
-
$request_ship.= "destination-route=".$destination_route."&";
|
162 |
-
$request_ship.= "destination-street_number=&";
|
163 |
-
$request_ship.= "destination-neighborhood=".$destination_locality."&";
|
164 |
-
$request_ship.= "destination-locality=".$destination_locality."&";
|
165 |
-
$request_ship.= "destination-administrative_area_level=".$destination_administrative_area_level."&";
|
166 |
-
$request_ship.= "destination-postal_code=".$destination_postal_code."&";
|
167 |
-
$request_ship.= "destination-country=".$destination_country."&";
|
168 |
-
$request_ship.= "destination-latlng=".$d_latlng."&";
|
169 |
-
$request_ship.= "customer_email=".$email."&";
|
170 |
-
$request_ship.= "customer_phone=".$customer_phone."&";
|
171 |
-
$request_ship.= "notification_email=¬es=".$notes."&dispatch=True";
|
172 |
-
//funcion curl para enviar la peticion de envio al sistema de 99minutos
|
173 |
-
$chr=curl_init();
|
174 |
-
curl_setopt($chr, CURLOPT_URL, $request_ship);
|
175 |
-
curl_setopt($chr, CURLOPT_SSL_VERIFYPEER, false);
|
176 |
-
curl_setopt($chr, CURLOPT_HEADER, false);
|
177 |
-
curl_setopt($chr, CURLOPT_RETURNTRANSFER, true);
|
178 |
-
curl_setopt($chr, CURLOPT_TIMEOUT, 1);
|
179 |
-
$url_request = curl_exec($chr);
|
180 |
-
curl_close($chr);
|
181 |
-
|
182 |
-
//url que sirve para hacer la peticion de envion al nuevo sistema de 99minutos
|
183 |
-
$request_n= "https://precise-line-76299minutos.appspot.com/2/delivery/request?";
|
184 |
-
$request_n.= "api_key=".$api_key."&";
|
185 |
-
$request_n.= "user_id=".$user_id."&";
|
186 |
-
$request_n.= "route=".$route."&";
|
187 |
-
$request_n.= "street_number=".$street_number."&";
|
188 |
-
$request_n.= "neighborhood=".$neighborhood."&";
|
189 |
-
$request_n.= "locality=".$locality."&";
|
190 |
-
$request_n.= "administrative_area_level_1=".$administrative_area_level_1."&";
|
191 |
-
$request_n.= "postal_code=".$postal_code."&";
|
192 |
-
$request_n.= "country=".$country."&";
|
193 |
-
$request_n.= "latlng=".$d_latlng."&";
|
194 |
-
$request_n.= "destination-route=".$destination_route."&";
|
195 |
-
$request_n.= "destination-street_number=&";
|
196 |
-
$request_n.= "destination-neighborhood=".$destination_locality."&";
|
197 |
-
$request_n.= "destination-locality=".$destination_locality."&";
|
198 |
-
$request_n.= "destination-administrative_area_level=".$destination_administrative_area_level."&";
|
199 |
-
$request_n.= "destination-postal_code=".$destination_postal_code."&";
|
200 |
-
$request_n.= "destination-country=".$destination_country."&";
|
201 |
-
$request_n.= "destination-latlng=".$d_latlng."&";
|
202 |
-
$request_n.= "customer_email=".$email."&";
|
203 |
-
$request_n.= "customer_phone=".$customer_phone."&";
|
204 |
-
$request_n.= "notification_email=¬es=".$notes."&dispatch=True";
|
205 |
-
//funcion curl para enviar la peticion de envio al sistema de 99minutos
|
206 |
-
$chn=curl_init();
|
207 |
-
curl_setopt($chn, CURLOPT_URL, $request_n);
|
208 |
-
curl_setopt($chn, CURLOPT_SSL_VERIFYPEER, false);
|
209 |
-
curl_setopt($chn, CURLOPT_HEADER, false);
|
210 |
-
curl_setopt($chn, CURLOPT_RETURNTRANSFER, true);
|
211 |
-
curl_setopt($chn, CURLOPT_TIMEOUT, 1);
|
212 |
-
$url_n = curl_exec($chn);
|
213 |
-
curl_close($chn);
|
214 |
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
}
|
78 |
Mage::logException($e);
|
79 |
}
|
80 |
}
|
81 |
+
public function shippedrequest($observer)
|
82 |
{
|
83 |
+
$schedule= 'godoparsa_shipping_large';
|
84 |
+
$express= 'godoparsa_shipping_express';
|
85 |
$shipment= $observer->getEvent()->getShipment();
|
86 |
$order= $shipment->getOrder();
|
87 |
+
$shipping_method= $order->getShippingMethod();
|
88 |
+
if(($shipping_method == $express) or ($shipping_method == $schedule))
|
|
|
89 |
{
|
90 |
+
if ($shipping_method == 'godoparsa_shipping_large')
|
91 |
+
{
|
92 |
+
$DeliveryType = 'Programado';
|
93 |
+
}
|
94 |
+
else if ($shipping_method == 'godoparsa_shipping_express')
|
95 |
+
{
|
96 |
+
$DeliveryType = '99minutos';
|
97 |
+
}
|
98 |
+
$shop= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
99 |
+
$shippingAddress= $order->getShippingAddress();
|
100 |
$address= $shippingAddress->getstreet();
|
101 |
function reduce($v1,$v2)
|
102 |
{
|
103 |
return $v1.' '.$v2;
|
104 |
}
|
105 |
+
$address_finale= array_reduce($address,'reduce');
|
106 |
$city= $shippingAddress->getcity();
|
107 |
$province= $shippingAddress->getregion();
|
108 |
$zip= $shippingAddress->getpostcode();
|
109 |
+
$name_order= 'Orden: '.$order->getIncrementId().'';
|
|
|
|
|
|
|
110 |
$email= $order->getCustomerEmail();
|
111 |
$phone= $shippingAddress->getTelephone();
|
112 |
$first_name= $shippingAddress->getFirstname();
|
113 |
+
$last_name= $shippingAddress->getLastname();
|
114 |
+
$payment= $order->getPayment();
|
115 |
+
$method= $payment->getMethod();
|
116 |
+
$amount= round($payment->getAmountOrdered(), 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
+
$content = array(
|
119 |
+
'Shop' => $shop,
|
120 |
+
'DeliveryType' => $DeliveryType,
|
121 |
+
'Address' => $address_finale,
|
122 |
+
'Province' => $province,
|
123 |
+
'City' => $city,
|
124 |
+
'PostalCode' => $zip,
|
125 |
+
'Email' => $email,
|
126 |
+
'Phone' => $phone,
|
127 |
+
'FirstName' => $first_name,
|
128 |
+
'LastName' => $last_name,
|
129 |
+
'PaymentMethod' => $method,
|
130 |
+
'Amount' => $amount,
|
131 |
+
'Order' => $name_order,
|
132 |
+
);
|
133 |
+
$ch = curl_init('http://api.99minutos.com/magento/shipping.php');
|
134 |
+
curl_setopt_array($ch, array(
|
135 |
+
CURLOPT_POST => TRUE,
|
136 |
+
CURLOPT_RETURNTRANSFER => TRUE,
|
137 |
+
CURLOPT_HTTPHEADER => array('Content-Type: application/json'),
|
138 |
+
CURLOPT_POSTFIELDS => json_encode($content)));
|
139 |
+
// Send the request
|
140 |
+
$response = curl_exec($ch);
|
141 |
+
curl_close($response);
|
142 |
+
}
|
143 |
}
|
144 |
|
145 |
}
|
app/code/community/Godoparsa/Shipping/etc/.DS_Store
ADDED
Binary file
|
app/code/community/Godoparsa/Shipping/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Godoparsa_Shipping>
|
5 |
-
<version>
|
6 |
</Godoparsa_Shipping>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Godoparsa_Shipping>
|
5 |
+
<version>2.0.0</version>
|
6 |
</Godoparsa_Shipping>
|
7 |
</modules>
|
8 |
<global>
|
app/code/community/Godoparsa/Shipping/etc/system.xml
CHANGED
@@ -66,7 +66,7 @@
|
|
66 |
</notify_custom2_email>
|
67 |
<notify_emails translate="label">
|
68 |
<label>Correos de notificación</label>
|
69 |
-
<comment><![CDATA[
|
70 |
<frontend_type>textarea</frontend_type>
|
71 |
<sort_order>7</sort_order>
|
72 |
<show_in_default>1</show_in_default>
|
66 |
</notify_custom2_email>
|
67 |
<notify_emails translate="label">
|
68 |
<label>Correos de notificación</label>
|
69 |
+
<comment><![CDATA[Estas opciones son para notificar cuando una orden se crea y tiene como método de envió a 99minutos.com, si deseas activarlas en las casillas superiores selecciona la opción "Si". Si deseas notificar a un correo que no esta definido en las configuración de tu tienda en la casilla agrega los correos deseados de la siguiente manera: "Envíos 99minutos <hola@99minutos.com>", sin comillas. Agrega un correo por línea ]]></comment>
|
70 |
<frontend_type>textarea</frontend_type>
|
71 |
<sort_order>7</sort_order>
|
72 |
<show_in_default>1</show_in_default>
|
app/code/community/Godoparsa/Shipping/sql/.DS_Store
CHANGED
Binary file
|
app/code/community/Godoparsa/Shipping/sql/godoparsa_shipping_setup/install-1.3.0.php
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
$installer->startSetup();
|
4 |
-
|
5 |
-
$shop= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
6 |
-
$db = new mysqli("54.172.87.163", "minutos", "00Minutos+01", "minutos");
|
7 |
-
$db->query(" INSERT INTO tbl_usersmagento SET store_name = '$shop'");
|
8 |
-
$inbox = Mage::getModel('adminnotification/inbox');
|
9 |
-
$severity = Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE;
|
10 |
-
$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!";
|
11 |
-
$description="Para completar el proceso por favor comunicate a 99minutos.com al tel (55) 6363 1559 o envia un correo a hola@99minutos. Gracias!";
|
12 |
-
$url= null;
|
13 |
-
$inbox->add($severity, $title, $description, $url);
|
14 |
-
|
15 |
-
$installer->endSetup();
|
16 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Godoparsa/Shipping/sql/godoparsa_shipping_setup/install-2.0.0.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$shop= Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
6 |
+
|
7 |
+
$url = "http://api.99minutos.com/magento/install.php";
|
8 |
+
$content = json_encode(array('Shop' => $shop));
|
9 |
+
|
10 |
+
$curl = curl_init($url);
|
11 |
+
curl_setopt($curl, CURLOPT_HEADER, false);
|
12 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
13 |
+
curl_setopt($curl, CURLOPT_HTTPHEADER,
|
14 |
+
array("Content-type: application/json"));
|
15 |
+
curl_setopt($curl, CURLOPT_POST, true);
|
16 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
17 |
+
|
18 |
+
$json_response = curl_exec($curl);
|
19 |
+
|
20 |
+
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
21 |
+
|
22 |
+
if ( $status != 201 ) {
|
23 |
+
die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
|
24 |
+
}
|
25 |
+
|
26 |
+
curl_close($curl);
|
27 |
+
|
28 |
+
$inbox = Mage::getModel('adminnotification/inbox');
|
29 |
+
$severity = Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE;
|
30 |
+
$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!";
|
31 |
+
$description="Para completar el proceso por favor comunicate a 99minutos.com al tel (55) 6363 1559 o envia un correo a hola@99minutos. Gracias!";
|
32 |
+
$url= null;
|
33 |
+
$inbox->add($severity, $title, $description, $url);
|
34 |
+
|
35 |
+
$installer->endSetup();
|
36 |
+
?>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>99minutos</name>
|
4 |
-
<version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/mit-license.php">MIT License</license>
|
7 |
<channel>community</channel>
|
@@ -23,9 +23,9 @@ Servicio de logistica para tiendas en linea donde compras y en tiempo record rec
|
|
23 |

|
24 |
</notes>
|
25 |
<authors><author><name>99 minutos</name><user>99minutos</user><email>saul@99minutos.com</email></author></authors>
|
26 |
-
<date>2015-
|
27 |
-
<time>
|
28 |
-
<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="
|
29 |
<compatible/>
|
30 |
<dependencies><required><php><min>5.3.1</min><max>5.6.6</max></php></required></dependencies>
|
31 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>99minutos</name>
|
4 |
+
<version>2.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/mit-license.php">MIT License</license>
|
7 |
<channel>community</channel>
|
23 |

|
24 |
</notes>
|
25 |
<authors><author><name>99 minutos</name><user>99minutos</user><email>saul@99minutos.com</email></author></authors>
|
26 |
+
<date>2015-09-23</date>
|
27 |
+
<time>19:12:45</time>
|
28 |
+
<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="671a680fac9db4e86804834956220fc1"/><file name="Observer.php" hash="ee90ac3af29b83afb9b749aabc0880d0"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="config.xml" hash="80940bc393fef0b0f67ec9375138d5e2"/><file name="system.xml" hash="e9bd3b93f45bf8e53838efa79c1b52ca"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="sql"><dir name="godoparsa_shipping_setup"><file name="install-2.0.0.php" hash="c78a6964f9f882514d4c00da9aebb34f"/></dir><file name=".DS_Store" hash="344937b225fe7535f14b0e80c9e2ba99"/></dir><file name=".DS_Store" hash="e57abcc90332e77fac087f5f9cd1fa40"/></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>
|
29 |
<compatible/>
|
30 |
<dependencies><required><php><min>5.3.1</min><max>5.6.6</max></php></required></dependencies>
|
31 |
</package>
|