Version Notes
- Added Distributors
- Added SmartPrice
Download this release
Release Info
| Developer | Roman Barbotkin |
| Extension | 4f4e331f92f560de38f6bc2b5501d8cb |
| Version | 1.0.4 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.3.3 to 1.0.4
- app/code/local/Send24/Shipping/Model/Carrier.php +632 -519
- app/code/local/Send24/Shipping/Model/Distributors.php +34 -0
- app/code/local/Send24/Shipping/Model/Points.php +0 -40
- app/code/local/Send24/Shipping/etc/adminhtml.xml +14 -0
- app/code/local/Send24/Shipping/etc/config.xml +4 -3
- app/code/local/Send24/Shipping/etc/system.xml +167 -12
- app/design/adminhtml/default/default/template/send24/sales/order/view/info.phtml +177 -0
- app/design/frontend/base/default/template/pickup/send24_pickup.phtml +5 -3
- package.xml +6 -6
app/code/local/Send24/Shipping/Model/Carrier.php
CHANGED
|
@@ -7,14 +7,10 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
| 7 |
|
| 8 |
protected $_code = 'send24_shipping';
|
| 9 |
public $select_denmark = 'Denmark';
|
| 10 |
-
public $
|
| 11 |
-
public $price_international = 0;
|
| 12 |
public $postcode = 1560;
|
| 13 |
-
|
| 14 |
public $product_id_express = 7062;
|
| 15 |
-
public $product_id_danmark = 6026;
|
| 16 |
|
| 17 |
-
public $is_available_international = false;
|
| 18 |
|
| 19 |
public function getFormBlock(){
|
| 20 |
return 'send24_shipping/pickup';
|
|
@@ -26,122 +22,212 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
| 26 |
if(Mage::app()->getStore()->getDefaultCurrencyCode() == 'DKK'){
|
| 27 |
// Express.
|
| 28 |
$result->append($this->_getExpressShippingRate());
|
| 29 |
-
|
| 30 |
-
// Denmark.
|
| 31 |
$enable_denmark = $this->getConfigData('enable_denmark');
|
| 32 |
if($enable_denmark == 1){
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
|
| 36 |
-
//
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
}
|
| 41 |
}
|
| 42 |
-
|
| 43 |
return $result;
|
| 44 |
}
|
| 45 |
|
| 46 |
-
// NEDD TEST.
|
| 47 |
public function adminSystemConfigChangedSectionCarriers()
|
| 48 |
{
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
| 64 |
}else{
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
copy($file, $new_file);
|
| 68 |
-
}catch(Exception $error){
|
| 69 |
-
Mage::getSingleton('core/session')->addError($error->getMessage());
|
| 70 |
-
return false;
|
| 71 |
-
}
|
| 72 |
}
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
array(
|
| 122 |
-
'value' => '0',
|
| 123 |
-
'label' => '1000kr'
|
| 124 |
-
),
|
| 125 |
-
array(
|
| 126 |
-
'value' => '1',
|
| 127 |
-
'label' => '2000kr'
|
| 128 |
-
),
|
| 129 |
-
array(
|
| 130 |
-
'value' => '2',
|
| 131 |
-
'label' => '3000kr'
|
| 132 |
-
),
|
| 133 |
-
array(
|
| 134 |
-
'value' => '3',
|
| 135 |
-
'label' => '4000kr'
|
| 136 |
-
),
|
| 137 |
-
array(
|
| 138 |
-
'value' => '4',
|
| 139 |
-
'label' => '5000kr'
|
| 140 |
-
),
|
| 141 |
-
);
|
| 142 |
}
|
| 143 |
|
| 144 |
-
|
| 145 |
public function after_order_placed($observer) {
|
| 146 |
$incrementId = $observer->getOrder()->getIncrementId();
|
| 147 |
// DK.
|
|
@@ -150,315 +236,261 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
| 150 |
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
| 151 |
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
| 152 |
$current_shipping_method = $observer->getOrder()->getShippingMethod();
|
| 153 |
-
$select_country = 'Ekspres';
|
| 154 |
$shipping_country_code = Mage::getModel('directory/country')->loadByCode(Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry());
|
| 155 |
$shipping_country_name = $shipping_country_code->getName();
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
{
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
$is_available_express = false;
|
| 182 |
-
}
|
| 183 |
-
break;
|
| 184 |
-
|
| 185 |
-
case 'send24_shipping_send24':
|
| 186 |
-
if ($send24_countries[$i]->product_id == $this->product_id_danmark)
|
| 187 |
-
{
|
| 188 |
-
$this->price_denmark = $send24_countries[$i]->price;
|
| 189 |
-
$is_available_denmark = true;
|
| 190 |
-
}
|
| 191 |
-
break;
|
| 192 |
-
|
| 193 |
-
case 'send24_shipping_international':
|
| 194 |
-
if ($send24_countries[$i]->title == $shipping_country_name && $shipping_country_name != $this->select_denmark)
|
| 195 |
-
{
|
| 196 |
-
$this->price_international = $send24_countries[$i]->price;
|
| 197 |
-
$international_product_id = $send24_countries[$i]->product_id;
|
| 198 |
-
$this->is_available_international = true;
|
| 199 |
-
}
|
| 200 |
-
break;
|
| 201 |
-
}
|
| 202 |
-
}
|
| 203 |
-
|
| 204 |
-
switch ($current_shipping_method){
|
| 205 |
-
case 'send24_shipping_express':
|
| 206 |
-
if($is_available_express == true){
|
| 207 |
-
$insurance_price = 0;
|
| 208 |
-
$discount = "false";
|
| 209 |
-
$ship_total = $type = $price_need = '';
|
| 210 |
-
|
| 211 |
-
$user_id = $observer->getOrder()->getCustomerId();
|
| 212 |
-
$shipping_data = $observer->getOrder()->getShippingAddress()->getData();
|
| 213 |
-
$billing_data = $observer->getOrder()->getBillingAddress()->getData();
|
| 214 |
-
|
| 215 |
-
if($select_country == 'Ekspres'){ $select_country = 'Danmark'; $where_shop_id = 'ekspres'; }
|
| 216 |
-
|
| 217 |
-
// Create order.
|
| 218 |
-
$ch = curl_init();
|
| 219 |
-
curl_setopt($ch, CURLOPT_URL, "https://www.send24.com/wc-api/v3/create_order");
|
| 220 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 221 |
-
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 222 |
-
curl_setopt($ch, CURLOPT_POST, TRUE);
|
| 223 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, '
|
| 224 |
-
{
|
| 225 |
-
"TO_company": "'.$shipping_data['company'].'",
|
| 226 |
-
"TO_first_name": "'.$shipping_data['firstname'].'",
|
| 227 |
-
"TO_last_name": "'.$shipping_data['lastname'].'",
|
| 228 |
-
"TO_phone": "'.$shipping_data['telephone'].'",
|
| 229 |
-
"TO_email": "'.$shipping_data['email'].'",
|
| 230 |
-
"TO_country": "'.$select_country.'",
|
| 231 |
-
"TO_city": "'.$shipping_data['city'].'",
|
| 232 |
-
"TO_postcode": "'.$postcode.'",
|
| 233 |
-
"Insurance" : "'.$insurance_price.'",
|
| 234 |
-
"Weight": "5",
|
| 235 |
-
"TO_address": "'.$shipping_data['street'].'",
|
| 236 |
-
"WHAT_product_id": "'.$send24_product_id.'",
|
| 237 |
-
"WHERE_shop_id": "'.$where_shop_id.'",
|
| 238 |
-
"discount": "'.$discount.'",
|
| 239 |
-
"type": "'.$type.'",
|
| 240 |
-
"need_points": "'.$price_need.'",
|
| 241 |
-
"total": "'.$ship_total.'",
|
| 242 |
-
"ship_mail": "'.$shipping_data['email'].'",
|
| 243 |
-
"bill_mail": "'.$billing_data['email'].'"
|
| 244 |
-
}
|
| 245 |
-
');
|
| 246 |
-
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 247 |
-
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 248 |
-
"Content-Type: application/json",
|
| 249 |
));
|
| 250 |
-
|
| 251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
}
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
$billing_data = $observer->getOrder()->getBillingAddress()->getData();
|
| 263 |
-
|
| 264 |
-
$select_country = 'Danmark';
|
| 265 |
-
$selected_shop_id = Mage::getModel('core/cookie')->get('selected_shop_id');
|
| 266 |
-
if(!empty($selected_shop_id)){
|
| 267 |
-
$where_shop_id = $selected_shop_id;
|
| 268 |
-
}else{
|
| 269 |
-
$where_shop_id = '';
|
| 270 |
-
}
|
| 271 |
-
|
| 272 |
-
// Create order.
|
| 273 |
-
$ch = curl_init();
|
| 274 |
-
curl_setopt($ch, CURLOPT_URL, "https://www.send24.com/wc-api/v3/create_order");
|
| 275 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 276 |
-
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 277 |
-
curl_setopt($ch, CURLOPT_POST, TRUE);
|
| 278 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, '
|
| 279 |
-
{
|
| 280 |
-
"TO_company": "'.$shipping_data['company'].'",
|
| 281 |
-
"TO_first_name": "'.$shipping_data['firstname'].'",
|
| 282 |
-
"TO_last_name": "'.$shipping_data['lastname'].'",
|
| 283 |
-
"TO_phone": "'.$shipping_data['telephone'].'",
|
| 284 |
-
"TO_email": "'.$shipping_data['email'].'",
|
| 285 |
-
"TO_country": "'.$select_country.'",
|
| 286 |
-
"TO_city": "'.$shipping_data['city'].'",
|
| 287 |
-
"TO_postcode": "'.$postcode.'",
|
| 288 |
-
"Insurance" : "'.$insurance_price.'",
|
| 289 |
-
"Weight": "5",
|
| 290 |
-
"TO_address": "'.$shipping_data['street'].'",
|
| 291 |
-
"WHAT_product_id": "'.$this->product_id_danmark.'",
|
| 292 |
-
"WHERE_shop_id": "'.$where_shop_id.'",
|
| 293 |
-
"discount": "'.$discount.'",
|
| 294 |
-
"type": "'.$type.'",
|
| 295 |
-
"need_points": "'.$price_need.'",
|
| 296 |
-
"total": "'.$this->price_denmark .'",
|
| 297 |
-
"ship_mail": "'.$shipping_data['email'].'",
|
| 298 |
-
"bill_mail": "'.$billing_data['email'].'"
|
| 299 |
-
}
|
| 300 |
-
');
|
| 301 |
-
|
| 302 |
-
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 303 |
-
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 304 |
-
"Content-Type: application/json",
|
| 305 |
));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 353 |
-
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 354 |
-
"Content-Type: application/json",
|
| 355 |
-
));
|
| 356 |
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
$
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 462 |
|
| 463 |
$observer->getOrder()->save();
|
| 464 |
return true;
|
|
@@ -470,17 +502,16 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
| 470 |
// DK
|
| 471 |
$country = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountryId();
|
| 472 |
$postcode = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getPostcode();
|
| 473 |
-
|
| 474 |
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
| 475 |
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
| 476 |
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 477 |
$shipping_country_code = Mage::getModel('directory/country')->loadByCode(Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry());
|
| 478 |
$shipping_country_name = $shipping_country_code->getName();
|
| 479 |
-
$select_country = 'Ekspres';
|
| 480 |
|
| 481 |
// Get/check Express.
|
| 482 |
$ch = curl_init();
|
| 483 |
-
curl_setopt($ch, CURLOPT_URL, "https://
|
| 484 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 485 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 486 |
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
|
@@ -518,7 +549,7 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
| 518 |
}
|
| 519 |
|
| 520 |
$ch = curl_init();
|
| 521 |
-
curl_setopt($ch, CURLOPT_URL, "https://
|
| 522 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 523 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 524 |
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
|
@@ -536,7 +567,7 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
| 536 |
}
|
| 537 |
|
| 538 |
$full_billing_address = "$billing_address_1, $billing_postcode $billing_city, $billing_country";
|
| 539 |
-
$
|
| 540 |
// $full_shipping_address = "Lermontova St, 26, Zaporizhzhia, Zaporiz'ka oblast, Ukraine";
|
| 541 |
// $full_billing_address = "Lermontova St, 26, Zaporizhzhia, Zaporiz'ka oblast, Ukraine";
|
| 542 |
|
|
@@ -558,7 +589,7 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
| 558 |
|
| 559 |
// get_is_driver_area_five_km
|
| 560 |
$ch = curl_init();
|
| 561 |
-
curl_setopt($ch, CURLOPT_URL, "https://
|
| 562 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 563 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 564 |
curl_setopt($ch, CURLOPT_POST, TRUE);
|
|
@@ -612,76 +643,82 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
| 612 |
}
|
| 613 |
}
|
| 614 |
}
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
curl_close($ch);
|
| 618 |
-
// print_r($full_billing_address);
|
| 619 |
return $rate;
|
| 620 |
-
|
| 621 |
}
|
| 622 |
}
|
| 623 |
}
|
| 624 |
}
|
| 625 |
-
// die;
|
| 626 |
-
|
| 627 |
}
|
| 628 |
|
| 629 |
// Denmark Send24.
|
| 630 |
protected function _getDenmarkShippingRate() {
|
| 631 |
-
// DK
|
| 632 |
$shipping_postcode = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getPostcode();
|
| 633 |
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
| 634 |
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
| 635 |
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 636 |
$shipping_country_code = Mage::getModel('directory/country')->loadByCode(Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry());
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 677 |
$is_available = true;
|
| 678 |
break;
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
|
|
|
|
|
|
| 685 |
if($is_available == true){
|
| 686 |
$rate = Mage::getModel('shipping/rate_result_method');
|
| 687 |
$rate->setCarrier($this->_code);
|
|
@@ -690,83 +727,159 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
| 690 |
$rate->setMethodTitle('Send24 - ');
|
| 691 |
if($config_payment_parcels == 1){
|
| 692 |
// Payment shop.
|
| 693 |
-
$this->
|
| 694 |
}
|
| 695 |
-
$rate->setPrice($this->
|
| 696 |
$rate->setCost(0);
|
| 697 |
return $rate;
|
| 698 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 699 |
}
|
|
|
|
|
|
|
|
|
|
| 700 |
}
|
| 701 |
-
|
| 702 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 703 |
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
$shipping_country_name = $shipping_country_code->getName();
|
| 709 |
-
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
| 710 |
-
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
| 711 |
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 712 |
-
if($
|
| 713 |
-
$
|
| 714 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 715 |
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
{
|
| 738 |
-
$this->price_international = $send24_countries[$i]->price;
|
| 739 |
-
$is_available_international = true;
|
| 740 |
-
break;
|
| 741 |
-
}else{
|
| 742 |
-
$is_available_international = false;
|
| 743 |
-
}
|
| 744 |
-
}
|
| 745 |
-
}
|
| 746 |
-
}
|
| 747 |
|
| 748 |
-
|
| 749 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 750 |
$rate->setCarrier($this->_code);
|
| 751 |
$rate->setCarrierTitle($this->getConfigData('title'));
|
| 752 |
-
$rate->setMethod('
|
| 753 |
-
$rate->setMethodTitle('
|
|
|
|
| 754 |
if($config_payment_parcels == 1){
|
| 755 |
// Payment shop.
|
| 756 |
-
$this->
|
| 757 |
}
|
| 758 |
-
$rate->setPrice($this->
|
| 759 |
$rate->setCost(0);
|
| 760 |
return $rate;
|
| 761 |
-
|
| 762 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 763 |
}
|
| 764 |
|
| 765 |
public function getAllowedMethods() {
|
| 766 |
return array(
|
| 767 |
'send24' => 'Send24',
|
| 768 |
'express' => 'Send24 Sameday Solution',
|
| 769 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 770 |
);
|
| 771 |
}
|
| 772 |
|
| 7 |
|
| 8 |
protected $_code = 'send24_shipping';
|
| 9 |
public $select_denmark = 'Denmark';
|
| 10 |
+
public $price = 0;
|
|
|
|
| 11 |
public $postcode = 1560;
|
|
|
|
| 12 |
public $product_id_express = 7062;
|
|
|
|
| 13 |
|
|
|
|
| 14 |
|
| 15 |
public function getFormBlock(){
|
| 16 |
return 'send24_shipping/pickup';
|
| 22 |
if(Mage::app()->getStore()->getDefaultCurrencyCode() == 'DKK'){
|
| 23 |
// Express.
|
| 24 |
$result->append($this->_getExpressShippingRate());
|
| 25 |
+
// Countries.
|
|
|
|
| 26 |
$enable_denmark = $this->getConfigData('enable_denmark');
|
| 27 |
if($enable_denmark == 1){
|
| 28 |
+
// Get key.
|
| 29 |
+
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
| 30 |
+
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
| 31 |
+
// Weight.
|
| 32 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
| 33 |
+
$weight = $quote->getShippingAddress()->getWeight();
|
| 34 |
+
// Get/check Country.
|
| 35 |
+
$ch = curl_init();
|
| 36 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_countries");
|
| 37 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 38 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 39 |
+
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 40 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 41 |
+
"Content-Type: application/json"
|
| 42 |
+
));
|
| 43 |
+
$send24_countries = json_decode(curl_exec($ch));
|
| 44 |
+
$shipping_country_code = Mage::getModel('directory/country')->loadByCode(Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry());
|
| 45 |
+
$is_available = false;
|
| 46 |
+
if(!empty($send24_countries['0'])){
|
| 47 |
+
foreach ($send24_countries['0'] as $key => $value) {
|
| 48 |
+
$value = (array)$value;
|
| 49 |
+
if($value['code'] == 'DK'){
|
| 50 |
+
if($weight <= 5 && !empty($value['0_5_kg'])){
|
| 51 |
+
$price_denmark = $value['0_5_kg'];
|
| 52 |
+
}elseif($weight > 5 && $weight <= 10 && !empty($value['5_10_kg'])){
|
| 53 |
+
$price_denmark = $value['5_10_kg'];
|
| 54 |
+
}elseif($weight > 10 && $weight <= 15 && !empty($value['10_15_kg'])){
|
| 55 |
+
$price_denmark = $value['10_15_kg'];
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
if(empty($price_denmark)){
|
| 61 |
+
$price_denmark = false;
|
| 62 |
+
}
|
| 63 |
}
|
| 64 |
|
| 65 |
+
// Destributions.
|
| 66 |
+
$active_smartprice = $this->getConfigData('active_smartprice');
|
| 67 |
+
if($active_smartprice == 1){
|
| 68 |
+
if($price_denmark != false){
|
| 69 |
+
$price[] = $price_denmark;
|
| 70 |
+
}
|
| 71 |
+
$price[] = $this->getConfigData('active_bring_price');
|
| 72 |
+
$price[] = $this->getConfigData('active_dhl_price');
|
| 73 |
+
$price[] = $this->getConfigData('active_gls_price');
|
| 74 |
+
$price[] = $this->getConfigData('active_postdanmark_price');
|
| 75 |
+
$price[] = $this->getConfigData('active_tnt_price');
|
| 76 |
+
$price[] = $this->getConfigData('active_ups_price');
|
| 77 |
+
$array_price = array_diff($price, array(''));
|
| 78 |
+
$key_show = array_keys($array_price, min($array_price));
|
| 79 |
+
switch ($key_show[0]) {
|
| 80 |
+
case 0:
|
| 81 |
+
if($enable_denmark == 1){
|
| 82 |
+
$result->append($this->_getDenmarkShippingRate());
|
| 83 |
+
}
|
| 84 |
+
break;
|
| 85 |
+
case 1:
|
| 86 |
+
$result->append($this->_getBringShippingRate());
|
| 87 |
+
break;
|
| 88 |
+
case 2:
|
| 89 |
+
$result->append($this->_getDHLShippingRate());
|
| 90 |
+
break;
|
| 91 |
+
case 3:
|
| 92 |
+
$result->append($this->_getGLSShippingRate());
|
| 93 |
+
break;
|
| 94 |
+
case 4:
|
| 95 |
+
$result->append($this->_getPostDenamrkShippingRate());
|
| 96 |
+
break;
|
| 97 |
+
case 5:
|
| 98 |
+
$result->append($this->_getTNTShippingRate());
|
| 99 |
+
break;
|
| 100 |
+
case 6:
|
| 101 |
+
$result->append($this->_getUPSShippingRate());
|
| 102 |
+
break;
|
| 103 |
+
}
|
| 104 |
+
}else{
|
| 105 |
+
// Denmark Send24.
|
| 106 |
+
if($enable_denmark == 1){
|
| 107 |
+
$result->append($this->_getDenmarkShippingRate());
|
| 108 |
+
}
|
| 109 |
+
// Destributions.
|
| 110 |
+
$result->append($this->_getBringShippingRate());
|
| 111 |
+
$result->append($this->_getDHLShippingRate());
|
| 112 |
+
$result->append($this->_getGLSShippingRate());
|
| 113 |
+
$result->append($this->_getPostDenamrkShippingRate());
|
| 114 |
+
$result->append($this->_getTNTShippingRate());
|
| 115 |
+
$result->append($this->_getUPSShippingRate());
|
| 116 |
}
|
| 117 |
}
|
|
|
|
| 118 |
return $result;
|
| 119 |
}
|
| 120 |
|
|
|
|
| 121 |
public function adminSystemConfigChangedSectionCarriers()
|
| 122 |
{
|
| 123 |
+
$get_model = Mage::getStoreConfig('carriers/send24_shipping/model');
|
| 124 |
+
if($get_model == 'send24_shipping/carrier'){
|
| 125 |
+
// Save return link.
|
| 126 |
+
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
| 127 |
+
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
| 128 |
+
|
| 129 |
+
$version = (float)Mage::getVersion();
|
| 130 |
+
$new_file = $_SERVER['DOCUMENT_ROOT'].'/app/design/adminhtml/default/default/template/send24/sales/order/view/info.phtml';
|
| 131 |
+
if(!file_exists($new_file)) {
|
| 132 |
+
if($version < 1.5){
|
| 133 |
+
try {
|
| 134 |
+
$file = $_SERVER['DOCUMENT_ROOT'].'/app/design/adminhtml/default/default/template/send24/sales/order/view/info1_4.phtml';
|
| 135 |
+
copy($file, $new_file);
|
| 136 |
+
}catch(Exception $error){
|
| 137 |
+
Mage::getSingleton('core/session')->addError($error->getMessage());
|
| 138 |
+
return false;
|
| 139 |
+
}
|
| 140 |
+
}else{
|
| 141 |
+
try {
|
| 142 |
+
$file = $_SERVER['DOCUMENT_ROOT'].'/app/design/adminhtml/default/default/template/send24/sales/order/view/info1_9.phtml';
|
| 143 |
+
copy($file, $new_file);
|
| 144 |
+
}catch(Exception $error){
|
| 145 |
+
Mage::getSingleton('core/session')->addError($error->getMessage());
|
| 146 |
+
return false;
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
|
| 151 |
+
// Save return.
|
| 152 |
+
$ch = curl_init();
|
| 153 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_user_id");
|
| 154 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 155 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 156 |
+
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 157 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 158 |
+
"Content-Type: application/json",
|
| 159 |
+
)
|
| 160 |
+
);
|
| 161 |
+
$user_meta = json_decode(curl_exec($ch));
|
| 162 |
+
if(!empty($user_meta->return_activate)){
|
| 163 |
+
$result_return = $user_meta->return_webpage_link['0'];
|
| 164 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/return_portal', $result_return);
|
| 165 |
}else{
|
| 166 |
+
$result_return = ' ';
|
| 167 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/return_portal', $result_return);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
}
|
| 169 |
+
// Distributor.
|
| 170 |
+
$distributor_active_PostDanmark = $user_meta->distributor_active_PostDanmark[0];
|
| 171 |
+
$distributor_active_GLS = $user_meta->distributor_active_GLS[0];
|
| 172 |
+
$distributor_active_UPS = $user_meta->distributor_active_UPS[0];
|
| 173 |
+
$distributor_active_DHL = $user_meta->distributor_active_DHL[0];
|
| 174 |
+
$distributor_active_TNT = $user_meta->distributor_active_TNT[0];
|
| 175 |
+
$distributor_active_Bring = $user_meta->distributor_active_Bring[0];
|
| 176 |
+
if(!empty($distributor_active_PostDanmark)){
|
| 177 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_postdanmark', '1');
|
| 178 |
+
}else{
|
| 179 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_postdanmark', '0');
|
| 180 |
+
}
|
| 181 |
+
if(!empty($distributor_active_GLS)){
|
| 182 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_gls', '1');
|
| 183 |
+
}else{
|
| 184 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_gls', '0');
|
| 185 |
+
}
|
| 186 |
+
if(!empty($distributor_active_UPS)){
|
| 187 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_ups', '1');
|
| 188 |
+
}else{
|
| 189 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_ups', '0');
|
| 190 |
+
}
|
| 191 |
+
if(!empty($distributor_active_DHL)){
|
| 192 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_dhl', '1');
|
| 193 |
+
}else{
|
| 194 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_dhl', '0');
|
| 195 |
+
}
|
| 196 |
+
if(!empty($distributor_active_TNT)){
|
| 197 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_tnt', '1');
|
| 198 |
+
}else{
|
| 199 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_tnt', '0');
|
| 200 |
+
}
|
| 201 |
+
if(!empty($distributor_active_Bring)){
|
| 202 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_bring', '1');
|
| 203 |
+
}else{
|
| 204 |
+
Mage::getModel('core/config')->saveConfig('carriers/send24_shipping/active_bring', '0');
|
| 205 |
+
}
|
| 206 |
+
curl_close($ch);
|
| 207 |
+
|
| 208 |
+
// Check key or secret.
|
| 209 |
+
$ch = curl_init();
|
| 210 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_service_area/".$this->postcode);
|
| 211 |
+
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 212 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 213 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 214 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 215 |
+
"Content-Type: application/json"
|
| 216 |
+
));
|
| 217 |
+
$zip_area = curl_exec($ch);
|
| 218 |
+
if($zip_area == 'true'){
|
| 219 |
+
Mage::getSingleton('core/session')->addSuccess('Key and secret passed authorization on send24.com successfully.');
|
| 220 |
+
}else{
|
| 221 |
+
Mage::getSingleton('core/session')->addError('Key or secret incorrect.');
|
| 222 |
+
}
|
| 223 |
+
curl_close($ch);
|
| 224 |
|
| 225 |
+
// Refresh magento configuration cache.
|
| 226 |
+
Mage::app()->getCacheInstance()->cleanType('config');
|
| 227 |
+
}
|
| 228 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
}
|
| 230 |
|
|
|
|
| 231 |
public function after_order_placed($observer) {
|
| 232 |
$incrementId = $observer->getOrder()->getIncrementId();
|
| 233 |
// DK.
|
| 236 |
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
| 237 |
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
| 238 |
$current_shipping_method = $observer->getOrder()->getShippingMethod();
|
|
|
|
| 239 |
$shipping_country_code = Mage::getModel('directory/country')->loadByCode(Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry());
|
| 240 |
$shipping_country_name = $shipping_country_code->getName();
|
| 241 |
+
$country_id = $shipping_country_code->getData('country_id');
|
| 242 |
+
// Address.
|
| 243 |
+
$shipping_address_1 = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getData('street');
|
| 244 |
+
$shipping_postcode = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getPostcode();
|
| 245 |
+
$shipping_city = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCity();
|
| 246 |
+
$shipping_country = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry();
|
| 247 |
+
$full_shipping_address = "$shipping_address_1, $shipping_postcode $shipping_city, $shipping_country";
|
| 248 |
+
// Get shipping coordinates.
|
| 249 |
+
$shipping_url = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=".urlencode($full_shipping_address);
|
| 250 |
+
$shipping_latlng = get_object_vars(json_decode(file_get_contents($shipping_url)));
|
| 251 |
+
// Weight.
|
| 252 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
| 253 |
+
$weight = $quote->getShippingAddress()->getWeight();
|
| 254 |
+
|
| 255 |
+
// Check shipping address.
|
| 256 |
+
if(!empty($shipping_latlng['results'])){
|
| 257 |
+
if($current_shipping_method == 'send24_shipping_express'){
|
| 258 |
+
// get/check Express.
|
| 259 |
+
$ch = curl_init();
|
| 260 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_products");
|
| 261 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 262 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 263 |
+
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 264 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 265 |
+
"Content-Type: application/json"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
));
|
| 267 |
+
$send24_countries = json_decode(curl_exec($ch));
|
| 268 |
+
curl_close($ch);
|
| 269 |
+
$n = count($send24_countries);
|
| 270 |
+
$is_available_denmark = false;
|
| 271 |
+
for ($i = 0; $i < $n; $i++)
|
| 272 |
+
{
|
| 273 |
+
switch ($current_shipping_method){
|
| 274 |
+
case 'send24_shipping_express':
|
| 275 |
+
if ($send24_countries[$i]->product_id == $this->product_id_express)
|
| 276 |
+
{
|
| 277 |
+
$this->price = $send24_countries[$i]->price;
|
| 278 |
+
$send24_product_id = $send24_countries[$i]->product_id;
|
| 279 |
+
$is_available = true;
|
| 280 |
+
}else{
|
| 281 |
+
$is_available = false;
|
| 282 |
+
}
|
| 283 |
+
break;
|
| 284 |
+
}
|
| 285 |
}
|
| 286 |
+
}else{
|
| 287 |
+
// Get/check Country.
|
| 288 |
+
$ch = curl_init();
|
| 289 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_countries");
|
| 290 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 291 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 292 |
+
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 293 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 294 |
+
"Content-Type: application/json"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 295 |
));
|
| 296 |
+
$send24_countries = json_decode(curl_exec($ch));
|
| 297 |
+
$shipping_country_code = Mage::getModel('directory/country')->loadByCode(Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry());
|
| 298 |
+
$is_available = false;
|
| 299 |
+
if(!empty($send24_countries['0'])){
|
| 300 |
+
foreach ($send24_countries['0'] as $key => $value) {
|
| 301 |
+
$value = (array)$value;
|
| 302 |
+
if($value['code'] == $country_id){
|
| 303 |
+
if($weight <= 5 && !empty($value['0_5_kg'])){
|
| 304 |
+
$this->price = $value['0_5_kg'];
|
| 305 |
+
}elseif($weight > 5 && $weight <= 10 && !empty($value['5_10_kg'])){
|
| 306 |
+
$this->price = $value['5_10_kg'];
|
| 307 |
+
}elseif($weight > 10 && $weight <= 15 && !empty($value['10_15_kg'])){
|
| 308 |
+
$this->price = $value['10_15_kg'];
|
| 309 |
+
}
|
| 310 |
+
$is_available = true;
|
| 311 |
+
break;
|
| 312 |
+
}
|
| 313 |
+
}
|
| 314 |
+
}
|
| 315 |
|
| 316 |
+
if(empty($this->price)){
|
| 317 |
+
$is_available = false;
|
| 318 |
+
}
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
$current_shipping_method = explode('send24_shipping_', $current_shipping_method);
|
| 322 |
+
$product_code = 's24p';
|
| 323 |
+
if(!empty($current_shipping_method['1'])){
|
| 324 |
+
switch ($current_shipping_method['1']) {
|
| 325 |
+
case 'send24':
|
| 326 |
+
$distributor_name = 'Send24';
|
| 327 |
+
break;
|
| 328 |
+
case 'express':
|
| 329 |
+
$product_code = 's24s';
|
| 330 |
+
$where_shop_id = 'ekspres';
|
| 331 |
+
$distributor_name = '';
|
| 332 |
+
break;
|
| 333 |
+
case 'send24_postdenamrk':
|
| 334 |
+
$distributor_name = 'PostDanmark';
|
| 335 |
+
break;
|
| 336 |
+
case 'send24_gls':
|
| 337 |
+
$distributor_name = 'GLS';
|
| 338 |
+
break;
|
| 339 |
+
case 'send24_ups':
|
| 340 |
+
$distributor_name = 'UPS';
|
| 341 |
+
break;
|
| 342 |
+
case 'send24_dhl':
|
| 343 |
+
$distributor_name = 'DHL';
|
| 344 |
+
break;
|
| 345 |
+
case 'send24_tnt':
|
| 346 |
+
$distributor_name = 'TNT';
|
| 347 |
+
break;
|
| 348 |
+
case 'send24_bring':
|
| 349 |
+
$distributor_name = 'Bring';
|
| 350 |
+
break;
|
| 351 |
+
}
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
// Selected shop.
|
| 355 |
+
$selected_shop_id = Mage::getModel('core/cookie')->get('selected_shop_id');
|
| 356 |
+
if(!empty($selected_shop_id) && $current_shipping_method['1'] == 'Send24'){
|
| 357 |
+
$where_shop_id = $selected_shop_id;
|
| 358 |
+
}else{
|
| 359 |
+
$where_shop_id = '';
|
| 360 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
|
| 362 |
+
$user_id = $observer->getOrder()->getCustomerId();
|
| 363 |
+
$shipping_data = $observer->getOrder()->getShippingAddress()->getData();
|
| 364 |
+
$billing_data = $observer->getOrder()->getBillingAddress()->getData();
|
| 365 |
+
|
| 366 |
+
// Create order.
|
| 367 |
+
$ch = curl_init();
|
| 368 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/create_order");
|
| 369 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 370 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 371 |
+
curl_setopt($ch, CURLOPT_POST, TRUE);
|
| 372 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
|
| 373 |
+
"company" : "'.$shipping_data['company'].'",
|
| 374 |
+
"first_name" : "'.$shipping_data['firstname'].'",
|
| 375 |
+
"last_name" : "'.$shipping_data['lastname'].'",
|
| 376 |
+
"phone" : "'.$shipping_data['telephone'].'",
|
| 377 |
+
"email" : "'.$shipping_data['email'].'",
|
| 378 |
+
"country_code" : "'.$country_id.'",
|
| 379 |
+
"city" : "'.$shipping_data['city'].'",
|
| 380 |
+
"postcode" : "'.$postcode.'",
|
| 381 |
+
"address" : "'.$shipping_data['street'].'",
|
| 382 |
+
"product_code" : "'.$product_code.'",
|
| 383 |
+
"shop_id" : "'.$where_shop_id.'",
|
| 384 |
+
"distributor_name" : "'.$distributor_name.'"
|
| 385 |
+
}');
|
| 386 |
+
|
| 387 |
+
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 388 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 389 |
+
"Content-Type: application/json",
|
| 390 |
+
));
|
| 391 |
+
$response = curl_exec($ch);
|
| 392 |
+
curl_close($ch);
|
| 393 |
+
|
| 394 |
+
$response_order = json_decode($response, JSON_FORCE_OBJECT);
|
| 395 |
+
$version = (float)Mage::getVersion();
|
| 396 |
+
if($version >= 1.5){
|
| 397 |
+
$history = Mage::getModel('sales/order_status_history')
|
| 398 |
+
->setStatus($observer->getOrder()->getStatus())
|
| 399 |
+
->setComment('<strong>Track parsel </strong><br><a href="'.$response_order['track'].'" target="_blank">'.$response_order['track'].'</a>')
|
| 400 |
+
->setEntityName(Mage_Sales_Model_Order::HISTORY_ENTITY_NAME)
|
| 401 |
+
->setIsCustomerNotified(false)
|
| 402 |
+
->setCreatedAt(date('Y-m-d H:i:s', time() - 60*60*24));
|
| 403 |
+
|
| 404 |
+
$observer->getOrder()->addStatusHistory($history);
|
| 405 |
+
}
|
| 406 |
+
// Create custom value for order.
|
| 407 |
+
// it temporarily
|
| 408 |
+
require_once('app/Mage.php');
|
| 409 |
+
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
|
| 410 |
+
$installer = new Mage_Sales_Model_Mysql4_Setup;
|
| 411 |
+
$attribute_track_parsel = array(
|
| 412 |
+
'type' => 'varchar',
|
| 413 |
+
'backend_type' => 'varchar',
|
| 414 |
+
'frontend_input' => 'varchar',
|
| 415 |
+
'is_user_defined' => true,
|
| 416 |
+
'label' => 'Send24 Track Parsel',
|
| 417 |
+
'visible' => false,
|
| 418 |
+
'required' => false,
|
| 419 |
+
'user_defined' => false,
|
| 420 |
+
'searchable' => false,
|
| 421 |
+
'filterable' => false,
|
| 422 |
+
'comparable' => false,
|
| 423 |
+
'default' => ''
|
| 424 |
+
);
|
| 425 |
+
$attribute_printout = array(
|
| 426 |
+
'type' => 'text',
|
| 427 |
+
'backend_type' => 'text',
|
| 428 |
+
'frontend_input' => 'text',
|
| 429 |
+
'is_user_defined' => true,
|
| 430 |
+
'label' => 'Send24 Printout',
|
| 431 |
+
'visible' => false,
|
| 432 |
+
'required' => false,
|
| 433 |
+
'user_defined' => false,
|
| 434 |
+
'searchable' => false,
|
| 435 |
+
'filterable' => false,
|
| 436 |
+
'comparable' => false,
|
| 437 |
+
'default' => ''
|
| 438 |
+
);
|
| 439 |
+
$installer->addAttribute('order', 'send24_track_parsel', $attribute_track_parsel);
|
| 440 |
+
$installer->addAttribute('order', 'send24_printout', $attribute_printout);
|
| 441 |
+
$installer->endSetup();
|
| 442 |
+
// Add Track parsel.
|
| 443 |
+
$observer->getOrder()->setSend24TrackParsel($response_order['track']);
|
| 444 |
+
// Add Printout.
|
| 445 |
+
$printout = json_encode($response_order);
|
| 446 |
+
$observer->getOrder()->setSend24Printout($printout);
|
| 447 |
+
|
| 448 |
+
// Track notice
|
| 449 |
+
$config_track_notice = $this->getConfigData('track_notice');
|
| 450 |
+
if($config_track_notice == 1){
|
| 451 |
+
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('send24_track_notice');
|
| 452 |
+
// Getting the Store E-Mail Sender Name.
|
| 453 |
+
$senderName = Mage::getStoreConfig('trans_email/ident_general/name');
|
| 454 |
+
// Getting the Store General E-Mail.
|
| 455 |
+
$senderEmail = Mage::getStoreConfig('trans_email/ident_general/email');
|
| 456 |
+
|
| 457 |
+
//Variables for Confirmation Mail.
|
| 458 |
+
$emailTemplateVariables = array();
|
| 459 |
+
$emailTemplateVariables['track'] = $response_order['track'];
|
| 460 |
+
$order_id = $observer->getOrder()->getId();
|
| 461 |
+
$emailTemplateVariables['id'] = $order_id;
|
| 462 |
+
|
| 463 |
+
//Appending the Custom Variables to Template.
|
| 464 |
+
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
|
| 465 |
+
$customerEmail = $shipping_data['email'];
|
| 466 |
+
|
| 467 |
+
$version = (float)Mage::getVersion();
|
| 468 |
+
if($version < 1.5){
|
| 469 |
+
$headers = 'MIME-Version: 1.0' . "\r\n";
|
| 470 |
+
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
|
| 471 |
+
$subject = 'Subject: Send24 Track Notice';
|
| 472 |
+
$message = 'Track: <a href="'.$emailTemplateVariables['track'].'">'.$emailTemplateVariables['track'].'</a>';
|
| 473 |
+
mail($senderEmail, $subject, $message, $headers);
|
| 474 |
+
}else{
|
| 475 |
+
//Sending E-Mail to Customers.
|
| 476 |
+
$mail = Mage::getModel('core/email')
|
| 477 |
+
->setToName($senderName)
|
| 478 |
+
->setToEmail($customerEmail)
|
| 479 |
+
->setBody($processedTemplate)
|
| 480 |
+
->setSubject('Subject: Send24 Track Notice')
|
| 481 |
+
->setFromEmail($senderEmail)
|
| 482 |
+
->setFromName($senderName)
|
| 483 |
+
->setType('html');
|
| 484 |
+
try{
|
| 485 |
+
//Confimation E-Mail Send
|
| 486 |
+
$mail->send();
|
| 487 |
+
}catch(Exception $error){
|
| 488 |
+
Mage::getSingleton('core/session')->addError($error->getMessage());
|
| 489 |
+
return false;
|
| 490 |
+
}
|
| 491 |
+
}
|
| 492 |
+
}
|
| 493 |
+
}
|
| 494 |
|
| 495 |
$observer->getOrder()->save();
|
| 496 |
return true;
|
| 502 |
// DK
|
| 503 |
$country = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountryId();
|
| 504 |
$postcode = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getPostcode();
|
| 505 |
+
// Key.
|
| 506 |
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
| 507 |
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
| 508 |
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 509 |
$shipping_country_code = Mage::getModel('directory/country')->loadByCode(Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry());
|
| 510 |
$shipping_country_name = $shipping_country_code->getName();
|
|
|
|
| 511 |
|
| 512 |
// Get/check Express.
|
| 513 |
$ch = curl_init();
|
| 514 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_products");
|
| 515 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 516 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 517 |
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 549 |
}
|
| 550 |
|
| 551 |
$ch = curl_init();
|
| 552 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_user_id");
|
| 553 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 554 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 555 |
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 567 |
}
|
| 568 |
|
| 569 |
$full_billing_address = "$billing_address_1, $billing_postcode $billing_city, $billing_country";
|
| 570 |
+
$full_shipping_address = "$shipping_address_1, $shipping_postcode $shipping_city, $shipping_country";
|
| 571 |
// $full_shipping_address = "Lermontova St, 26, Zaporizhzhia, Zaporiz'ka oblast, Ukraine";
|
| 572 |
// $full_billing_address = "Lermontova St, 26, Zaporizhzhia, Zaporiz'ka oblast, Ukraine";
|
| 573 |
|
| 589 |
|
| 590 |
// get_is_driver_area_five_km
|
| 591 |
$ch = curl_init();
|
| 592 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_is_driver_area_five_km");
|
| 593 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 594 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 595 |
curl_setopt($ch, CURLOPT_POST, TRUE);
|
| 643 |
}
|
| 644 |
}
|
| 645 |
}
|
| 646 |
+
curl_close($ch);
|
|
|
|
|
|
|
|
|
|
| 647 |
return $rate;
|
|
|
|
| 648 |
}
|
| 649 |
}
|
| 650 |
}
|
| 651 |
}
|
|
|
|
|
|
|
| 652 |
}
|
| 653 |
|
| 654 |
// Denmark Send24.
|
| 655 |
protected function _getDenmarkShippingRate() {
|
|
|
|
| 656 |
$shipping_postcode = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getPostcode();
|
| 657 |
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
| 658 |
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
| 659 |
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 660 |
$shipping_country_code = Mage::getModel('directory/country')->loadByCode(Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry());
|
| 661 |
+
// Address.
|
| 662 |
+
$shipping_address_1 = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getData('street');
|
| 663 |
+
$shipping_postcode = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getPostcode();
|
| 664 |
+
$shipping_city = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCity();
|
| 665 |
+
$shipping_country = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getCountry();
|
| 666 |
+
$full_shipping_address = "$shipping_address_1, $shipping_postcode $shipping_city, $shipping_country";
|
| 667 |
+
// Get shipping coordinates.
|
| 668 |
+
$shipping_url = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=".urlencode($full_shipping_address);
|
| 669 |
+
$shipping_latlng = get_object_vars(json_decode(file_get_contents($shipping_url)));
|
| 670 |
+
|
| 671 |
+
// Check shipping address.
|
| 672 |
+
if(!empty($shipping_latlng['results'])){
|
| 673 |
+
// Check zip.
|
| 674 |
+
$ch = curl_init();
|
| 675 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_service_area/".$shipping_postcode);
|
| 676 |
+
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 677 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 678 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 679 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 680 |
+
"Content-Type: application/json"
|
| 681 |
+
));
|
| 682 |
+
$zip_area = curl_exec($ch);
|
| 683 |
+
curl_close($ch);
|
| 684 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
| 685 |
+
$weight = $quote->getShippingAddress()->getWeight();
|
| 686 |
+
|
| 687 |
+
if($zip_area == 'true'){
|
| 688 |
+
// Get/check Denmark.
|
| 689 |
+
$ch = curl_init();
|
| 690 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_countries");
|
| 691 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 692 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 693 |
+
curl_setopt($ch, CURLOPT_USERPWD, $send24_consumer_key . ":" . $send24_consumer_secret);
|
| 694 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
| 695 |
+
"Content-Type: application/json"
|
| 696 |
+
));
|
| 697 |
+
$send24_countries = json_decode(curl_exec($ch));
|
| 698 |
+
curl_close($ch);
|
| 699 |
+
$is_available = false;
|
| 700 |
+
$country_id = $shipping_country_code->getData('country_id');
|
| 701 |
+
if(!empty($send24_countries['0'])){
|
| 702 |
+
foreach ($send24_countries['0'] as $key => $value) {
|
| 703 |
+
$value = (array)$value;
|
| 704 |
+
if($value['code'] == $country_id){
|
| 705 |
+
if($weight <= 5 && !empty($value['0_5_kg'])){
|
| 706 |
+
$this->price = $value['0_5_kg'];
|
| 707 |
+
}elseif($weight > 5 && $weight <= 10 && !empty($value['5_10_kg'])){
|
| 708 |
+
$this->price = $value['5_10_kg'];
|
| 709 |
+
}elseif($weight > 10 && $weight <= 15 && !empty($value['10_15_kg'])){
|
| 710 |
+
$this->price = $value['10_15_kg'];
|
| 711 |
+
}
|
| 712 |
$is_available = true;
|
| 713 |
break;
|
| 714 |
+
}
|
| 715 |
+
}
|
| 716 |
+
}
|
| 717 |
+
|
| 718 |
+
if(empty($this->price)){
|
| 719 |
+
$is_available = false;
|
| 720 |
+
}
|
| 721 |
+
|
| 722 |
if($is_available == true){
|
| 723 |
$rate = Mage::getModel('shipping/rate_result_method');
|
| 724 |
$rate->setCarrier($this->_code);
|
| 727 |
$rate->setMethodTitle('Send24 - ');
|
| 728 |
if($config_payment_parcels == 1){
|
| 729 |
// Payment shop.
|
| 730 |
+
$this->price = 0;
|
| 731 |
}
|
| 732 |
+
$rate->setPrice($this->price);
|
| 733 |
$rate->setCost(0);
|
| 734 |
return $rate;
|
| 735 |
}
|
| 736 |
+
}
|
| 737 |
+
}
|
| 738 |
+
}
|
| 739 |
+
|
| 740 |
+
|
| 741 |
+
// PostDenmark.
|
| 742 |
+
protected function _getPostDenamrkShippingRate(){
|
| 743 |
+
$active_postdanmark = $this->getConfigData('active_postdanmark');
|
| 744 |
+
$active_postdanmark_price = $this->getConfigData('active_postdanmark_price');
|
| 745 |
+
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 746 |
+
if(!empty($active_postdanmark_price) || $active_postdanmark_price == '0' && $active_postdanmark == '1'){
|
| 747 |
+
$rate = Mage::getModel('shipping/rate_result_method');
|
| 748 |
+
$rate->setCarrier($this->_code);
|
| 749 |
+
$rate->setCarrierTitle($this->getConfigData('title'));
|
| 750 |
+
$rate->setMethod('send24_postdenamrk');
|
| 751 |
+
$rate->setMethodTitle('PostDanmark');
|
| 752 |
+
$this->price = $active_postdanmark_price;
|
| 753 |
+
if($config_payment_parcels == 1){
|
| 754 |
+
// Payment shop.
|
| 755 |
+
$this->price = 0;
|
| 756 |
}
|
| 757 |
+
$rate->setPrice($this->price);
|
| 758 |
+
$rate->setCost(0);
|
| 759 |
+
return $rate;
|
| 760 |
}
|
| 761 |
+
}
|
| 762 |
|
| 763 |
+
// GLS.
|
| 764 |
+
protected function _getGLSShippingRate(){
|
| 765 |
+
$active = $this->getConfigData('active_gls');
|
| 766 |
+
$price = $this->getConfigData('active_gls_price');
|
| 767 |
+
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 768 |
+
if(!empty($price) || $price == '0' && $active == '1'){
|
| 769 |
+
$rate = Mage::getModel('shipping/rate_result_method');
|
| 770 |
+
$rate->setCarrier($this->_code);
|
| 771 |
+
$rate->setCarrierTitle($this->getConfigData('title'));
|
| 772 |
+
$rate->setMethod('send24_gls');
|
| 773 |
+
$rate->setMethodTitle('GLS');
|
| 774 |
+
$this->price = $price;
|
| 775 |
+
if($config_payment_parcels == 1){
|
| 776 |
+
// Payment shop.
|
| 777 |
+
$this->price = 0;
|
| 778 |
+
}
|
| 779 |
+
$rate->setPrice($this->price);
|
| 780 |
+
$rate->setCost(0);
|
| 781 |
+
return $rate;
|
| 782 |
+
}
|
| 783 |
+
}
|
| 784 |
|
| 785 |
+
// UPS.
|
| 786 |
+
protected function _getUPSShippingRate(){
|
| 787 |
+
$active = $this->getConfigData('active_ups');
|
| 788 |
+
$price = $this->getConfigData('active_ups_price');
|
|
|
|
|
|
|
|
|
|
| 789 |
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 790 |
+
if(!empty($price) || $price == '0' && $active == '1'){
|
| 791 |
+
$rate = Mage::getModel('shipping/rate_result_method');
|
| 792 |
+
$rate->setCarrier($this->_code);
|
| 793 |
+
$rate->setCarrierTitle($this->getConfigData('title'));
|
| 794 |
+
$rate->setMethod('send24_ups');
|
| 795 |
+
$rate->setMethodTitle('UPS');
|
| 796 |
+
$this->price = $price;
|
| 797 |
+
if($config_payment_parcels == 1){
|
| 798 |
+
// Payment shop.
|
| 799 |
+
$this->price = 0;
|
| 800 |
+
}
|
| 801 |
+
$rate->setPrice($this->price);
|
| 802 |
+
$rate->setCost(0);
|
| 803 |
+
return $rate;
|
| 804 |
+
}
|
| 805 |
+
}
|
| 806 |
|
| 807 |
+
// DHL.
|
| 808 |
+
protected function _getDHLShippingRate(){
|
| 809 |
+
$active = $this->getConfigData('active_dhl');
|
| 810 |
+
$price = $this->getConfigData('active_dhl_price');
|
| 811 |
+
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 812 |
+
if(!empty($price) || $price == '0' && $active == '1'){
|
| 813 |
+
$rate = Mage::getModel('shipping/rate_result_method');
|
| 814 |
+
$rate->setCarrier($this->_code);
|
| 815 |
+
$rate->setCarrierTitle($this->getConfigData('title'));
|
| 816 |
+
$rate->setMethod('send24_dhl');
|
| 817 |
+
$rate->setMethodTitle('DHL');
|
| 818 |
+
$this->price = $price;
|
| 819 |
+
if($config_payment_parcels == 1){
|
| 820 |
+
// Payment shop.
|
| 821 |
+
$this->price = 0;
|
| 822 |
+
}
|
| 823 |
+
$rate->setPrice($this->price);
|
| 824 |
+
$rate->setCost(0);
|
| 825 |
+
return $rate;
|
| 826 |
+
}
|
| 827 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 828 |
|
| 829 |
+
// TNT.
|
| 830 |
+
protected function _getTNTShippingRate(){
|
| 831 |
+
$active = $this->getConfigData('active_tnt');
|
| 832 |
+
$price = $this->getConfigData('active_tnt_price');
|
| 833 |
+
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 834 |
+
if(!empty($price) || $price == '0' && $active == '1'){
|
| 835 |
+
$rate = Mage::getModel('shipping/rate_result_method');
|
| 836 |
$rate->setCarrier($this->_code);
|
| 837 |
$rate->setCarrierTitle($this->getConfigData('title'));
|
| 838 |
+
$rate->setMethod('send24_tnt');
|
| 839 |
+
$rate->setMethodTitle('TNT');
|
| 840 |
+
$this->price = $price;
|
| 841 |
if($config_payment_parcels == 1){
|
| 842 |
// Payment shop.
|
| 843 |
+
$this->price = 0;
|
| 844 |
}
|
| 845 |
+
$rate->setPrice($this->price);
|
| 846 |
$rate->setCost(0);
|
| 847 |
return $rate;
|
| 848 |
+
}
|
| 849 |
+
}
|
| 850 |
+
|
| 851 |
+
// Bring.
|
| 852 |
+
protected function _getBringShippingRate(){
|
| 853 |
+
$active = $this->getConfigData('active_bring');
|
| 854 |
+
$price = $this->getConfigData('active_bring_price');
|
| 855 |
+
$config_payment_parcels = $this->getConfigData('payment_parcels');
|
| 856 |
+
if(!empty($price) || $price == '0' && $active == '1'){
|
| 857 |
+
$rate = Mage::getModel('shipping/rate_result_method');
|
| 858 |
+
$rate->setCarrier($this->_code);
|
| 859 |
+
$rate->setCarrierTitle($this->getConfigData('title'));
|
| 860 |
+
$rate->setMethod('send24_bring');
|
| 861 |
+
$rate->setMethodTitle('Bring');
|
| 862 |
+
$this->price = $price;
|
| 863 |
+
if($config_payment_parcels == 1){
|
| 864 |
+
// Payment shop.
|
| 865 |
+
$this->price = 0;
|
| 866 |
+
}
|
| 867 |
+
$rate->setPrice($this->price);
|
| 868 |
+
$rate->setCost(0);
|
| 869 |
+
return $rate;
|
| 870 |
+
}
|
| 871 |
}
|
| 872 |
|
| 873 |
public function getAllowedMethods() {
|
| 874 |
return array(
|
| 875 |
'send24' => 'Send24',
|
| 876 |
'express' => 'Send24 Sameday Solution',
|
| 877 |
+
'send24_postdenamrk' => 'PostDanmark',
|
| 878 |
+
'send24_gls' => 'GLS',
|
| 879 |
+
'send24_ups' => 'UPS',
|
| 880 |
+
'send24_dhl' => 'DHL',
|
| 881 |
+
'send24_tnt' => 'TNT',
|
| 882 |
+
'send24_bring' => 'Bring',
|
| 883 |
);
|
| 884 |
}
|
| 885 |
|
app/code/local/Send24/Shipping/Model/Distributors.php
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Send24_Shipping_Model_Distributors
|
| 4 |
+
{
|
| 5 |
+
public function toOptionArray()
|
| 6 |
+
{
|
| 7 |
+
return array(
|
| 8 |
+
array(
|
| 9 |
+
'value' => 'PostDanmark',
|
| 10 |
+
'label' => 'PostDanmark'
|
| 11 |
+
),
|
| 12 |
+
array(
|
| 13 |
+
'value' => 'GLS',
|
| 14 |
+
'label' => 'GLS'
|
| 15 |
+
),
|
| 16 |
+
array(
|
| 17 |
+
'value' => 'UPS',
|
| 18 |
+
'label' => 'UPS'
|
| 19 |
+
),
|
| 20 |
+
array(
|
| 21 |
+
'value' => 'DHL',
|
| 22 |
+
'label' => 'DHL'
|
| 23 |
+
),
|
| 24 |
+
array(
|
| 25 |
+
'value' => 'TNT',
|
| 26 |
+
'label' => 'TNT'
|
| 27 |
+
),
|
| 28 |
+
array(
|
| 29 |
+
'value' => 'Bring',
|
| 30 |
+
'label' => 'Bring'
|
| 31 |
+
),
|
| 32 |
+
);
|
| 33 |
+
}
|
| 34 |
+
}
|
app/code/local/Send24/Shipping/Model/Points.php
DELETED
|
@@ -1,40 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class Send24_Shipping_Model_Points
|
| 4 |
-
{
|
| 5 |
-
public function toOptionArray()
|
| 6 |
-
{
|
| 7 |
-
return array(
|
| 8 |
-
array(
|
| 9 |
-
'value' => '1',
|
| 10 |
-
'label' => '1%'
|
| 11 |
-
),
|
| 12 |
-
array(
|
| 13 |
-
'value' => '2',
|
| 14 |
-
'label' => '2%'
|
| 15 |
-
),
|
| 16 |
-
array(
|
| 17 |
-
'value' => '3',
|
| 18 |
-
'label' => '3%'
|
| 19 |
-
),
|
| 20 |
-
array(
|
| 21 |
-
'value' => '4',
|
| 22 |
-
'label' => '4%'
|
| 23 |
-
),
|
| 24 |
-
array(
|
| 25 |
-
'value' => '5',
|
| 26 |
-
'label' => '5%'
|
| 27 |
-
),
|
| 28 |
-
array(
|
| 29 |
-
'value' => '6',
|
| 30 |
-
'label' => '6%'
|
| 31 |
-
),
|
| 32 |
-
array(
|
| 33 |
-
'value' => '7',
|
| 34 |
-
'label' => '7%'
|
| 35 |
-
),
|
| 36 |
-
);
|
| 37 |
-
}
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Send24/Shipping/etc/adminhtml.xml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<menu>
|
| 4 |
+
<system>
|
| 5 |
+
<children>
|
| 6 |
+
<stockstatus>
|
| 7 |
+
<title>Send24 Shipping</title>
|
| 8 |
+
<action>adminhtml/system_config/edit/section/carriers</action>
|
| 9 |
+
<sort_order>100000</sort_order>
|
| 10 |
+
</stockstatus>
|
| 11 |
+
</children>
|
| 12 |
+
</system>
|
| 13 |
+
</menu>
|
| 14 |
+
</config>
|
app/code/local/Send24/Shipping/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Send24_Shipping>
|
| 5 |
-
<module>1.0.
|
| 6 |
</Send24_Shipping>
|
| 7 |
</modules>
|
| 8 |
|
|
@@ -99,7 +99,7 @@
|
|
| 99 |
<!--
|
| 100 |
The title as referenced in the carrier class
|
| 101 |
-->
|
| 102 |
-
<title>
|
| 103 |
<startexpress_time_select>08,00,00</startexpress_time_select>
|
| 104 |
<endexpress_time_select>18,00,00</endexpress_time_select>
|
| 105 |
<select_insurance>0</select_insurance>
|
|
@@ -109,4 +109,5 @@
|
|
| 109 |
</send24_shipping>
|
| 110 |
</carriers>
|
| 111 |
</default>
|
| 112 |
-
</config>
|
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Send24_Shipping>
|
| 5 |
+
<module>1.0.4</module>
|
| 6 |
</Send24_Shipping>
|
| 7 |
</modules>
|
| 8 |
|
| 99 |
<!--
|
| 100 |
The title as referenced in the carrier class
|
| 101 |
-->
|
| 102 |
+
<title>Fragt</title>
|
| 103 |
<startexpress_time_select>08,00,00</startexpress_time_select>
|
| 104 |
<endexpress_time_select>18,00,00</endexpress_time_select>
|
| 105 |
<select_insurance>0</select_insurance>
|
| 109 |
</send24_shipping>
|
| 110 |
</carriers>
|
| 111 |
</default>
|
| 112 |
+
</config>
|
| 113 |
+
|
app/code/local/Send24/Shipping/etc/system.xml
CHANGED
|
@@ -5,6 +5,7 @@
|
|
| 5 |
<groups>
|
| 6 |
<send24_shipping translate="label">
|
| 7 |
<label>Send24</label>
|
|
|
|
| 8 |
<frontend_type>text</frontend_type>
|
| 9 |
<sort_order>2</sort_order>
|
| 10 |
<show_in_default>1</show_in_default>
|
|
@@ -89,7 +90,6 @@
|
|
| 89 |
<show_in_website>1</show_in_website>
|
| 90 |
<show_in_store>1</show_in_store>
|
| 91 |
</endexpress_time_select>
|
| 92 |
-
|
| 93 |
<track_notice translate="label">
|
| 94 |
<label>Return Notice:</label>
|
| 95 |
<frontend_type>select</frontend_type>
|
|
@@ -115,21 +115,28 @@
|
|
| 115 |
<show_in_website>1</show_in_website>
|
| 116 |
<show_in_store>0</show_in_store>
|
| 117 |
</return_portal>
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
<payment_parcels translate="label">
|
| 120 |
<label>Payment parcels shop?</label>
|
| 121 |
<frontend_type>select</frontend_type>
|
| 122 |
<comment>yes = shop payment, no = user payment</comment>
|
| 123 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 124 |
-
<sort_order>
|
| 125 |
<show_in_default>1</show_in_default>
|
| 126 |
<show_in_website>1</show_in_website>
|
| 127 |
<show_in_store>1</show_in_store>
|
| 128 |
</payment_parcels>
|
| 129 |
|
| 130 |
<enable_denmark translate="label">
|
| 131 |
-
<label>
|
| 132 |
-
<comment>enable
|
| 133 |
<frontend_type>select</frontend_type>
|
| 134 |
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
| 135 |
<sort_order>99</sort_order>
|
|
@@ -159,17 +166,165 @@
|
|
| 159 |
<show_in_store>1</show_in_store>
|
| 160 |
</show_shops>
|
| 161 |
|
| 162 |
-
|
| 163 |
-
<label>
|
| 164 |
-
<
|
| 165 |
-
<
|
| 166 |
-
<
|
| 167 |
-
<sort_order>100</sort_order>
|
| 168 |
<show_in_default>1</show_in_default>
|
| 169 |
<show_in_website>1</show_in_website>
|
| 170 |
<show_in_store>1</show_in_store>
|
| 171 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
<sort_order translate="label">
|
| 175 |
<label>Sort Order</label>
|
| 5 |
<groups>
|
| 6 |
<send24_shipping translate="label">
|
| 7 |
<label>Send24</label>
|
| 8 |
+
|
| 9 |
<frontend_type>text</frontend_type>
|
| 10 |
<sort_order>2</sort_order>
|
| 11 |
<show_in_default>1</show_in_default>
|
| 90 |
<show_in_website>1</show_in_website>
|
| 91 |
<show_in_store>1</show_in_store>
|
| 92 |
</endexpress_time_select>
|
|
|
|
| 93 |
<track_notice translate="label">
|
| 94 |
<label>Return Notice:</label>
|
| 95 |
<frontend_type>select</frontend_type>
|
| 115 |
<show_in_website>1</show_in_website>
|
| 116 |
<show_in_store>0</show_in_store>
|
| 117 |
</return_portal>
|
| 118 |
+
<heading_service translate="label">
|
| 119 |
+
<label>Service:</label>
|
| 120 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
| 121 |
+
<sort_order>114</sort_order>
|
| 122 |
+
<show_in_default>1</show_in_default>
|
| 123 |
+
<show_in_website>1</show_in_website>
|
| 124 |
+
<show_in_store>0</show_in_store>
|
| 125 |
+
</heading_service>
|
| 126 |
<payment_parcels translate="label">
|
| 127 |
<label>Payment parcels shop?</label>
|
| 128 |
<frontend_type>select</frontend_type>
|
| 129 |
<comment>yes = shop payment, no = user payment</comment>
|
| 130 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 131 |
+
<sort_order>117</sort_order>
|
| 132 |
<show_in_default>1</show_in_default>
|
| 133 |
<show_in_website>1</show_in_website>
|
| 134 |
<show_in_store>1</show_in_store>
|
| 135 |
</payment_parcels>
|
| 136 |
|
| 137 |
<enable_denmark translate="label">
|
| 138 |
+
<label>Send24 Shipping</label>
|
| 139 |
+
<comment>enable sending to countries that support in Send24.</comment>
|
| 140 |
<frontend_type>select</frontend_type>
|
| 141 |
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
| 142 |
<sort_order>99</sort_order>
|
| 166 |
<show_in_store>1</show_in_store>
|
| 167 |
</show_shops>
|
| 168 |
|
| 169 |
+
<!-- <active_distributors translate="label">
|
| 170 |
+
<label>Other distributors:</label>
|
| 171 |
+
<frontend_type>multiselect</frontend_type>
|
| 172 |
+
<source_model>send24_shipping/distributors</source_model>
|
| 173 |
+
<sort_order>101</sort_order>
|
|
|
|
| 174 |
<show_in_default>1</show_in_default>
|
| 175 |
<show_in_website>1</show_in_website>
|
| 176 |
<show_in_store>1</show_in_store>
|
| 177 |
+
</active_distributors> -->
|
| 178 |
+
|
| 179 |
+
<heading_example translate="label">
|
| 180 |
+
<label>Other distributors:</label>
|
| 181 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
| 182 |
+
<sort_order>101</sort_order>
|
| 183 |
+
<show_in_default>1</show_in_default>
|
| 184 |
+
<show_in_website>1</show_in_website>
|
| 185 |
+
<show_in_store>0</show_in_store>
|
| 186 |
+
</heading_example>
|
| 187 |
|
| 188 |
+
<active_gls translate="label comment">
|
| 189 |
+
<label>GLS</label>
|
| 190 |
+
<frontend_type>select</frontend_type>
|
| 191 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 192 |
+
<sort_order>102</sort_order>
|
| 193 |
+
<show_in_default>1</show_in_default>
|
| 194 |
+
<show_in_website>1</show_in_website>
|
| 195 |
+
<show_in_store>0</show_in_store>
|
| 196 |
+
</active_gls>
|
| 197 |
+
<active_gls_price translate="label comment">
|
| 198 |
+
<label>GLS Price</label>
|
| 199 |
+
<comment>Price for GLS.</comment>
|
| 200 |
+
<frontend_type>text</frontend_type>
|
| 201 |
+
<sort_order>103</sort_order>
|
| 202 |
+
<show_in_default>1</show_in_default>
|
| 203 |
+
<show_in_website>1</show_in_website>
|
| 204 |
+
<show_in_store>0</show_in_store>
|
| 205 |
+
<depends>
|
| 206 |
+
<active_gls>1</active_gls>
|
| 207 |
+
</depends>
|
| 208 |
+
</active_gls_price>
|
| 209 |
+
|
| 210 |
+
<active_postdanmark translate="label comment">
|
| 211 |
+
<label>PostDanmark</label>
|
| 212 |
+
<frontend_type>select</frontend_type>
|
| 213 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 214 |
+
<sort_order>104</sort_order>
|
| 215 |
+
<show_in_default>1</show_in_default>
|
| 216 |
+
<show_in_website>1</show_in_website>
|
| 217 |
+
<show_in_store>0</show_in_store>
|
| 218 |
+
</active_postdanmark>
|
| 219 |
+
<active_postdanmark_price translate="label comment">
|
| 220 |
+
<label>PostDanmark Price</label>
|
| 221 |
+
<comment>Price for PostDanmark.</comment>
|
| 222 |
+
<frontend_type>text</frontend_type>
|
| 223 |
+
<sort_order>105</sort_order>
|
| 224 |
+
<show_in_default>1</show_in_default>
|
| 225 |
+
<show_in_website>1</show_in_website>
|
| 226 |
+
<show_in_store>0</show_in_store>
|
| 227 |
+
<depends>
|
| 228 |
+
<active_postdanmark>1</active_postdanmark>
|
| 229 |
+
</depends>
|
| 230 |
+
</active_postdanmark_price>
|
| 231 |
+
|
| 232 |
+
<active_ups translate="label comment">
|
| 233 |
+
<label>UPS</label>
|
| 234 |
+
<frontend_type>select</frontend_type>
|
| 235 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 236 |
+
<sort_order>106</sort_order>
|
| 237 |
+
<show_in_default>1</show_in_default>
|
| 238 |
+
<show_in_website>1</show_in_website>
|
| 239 |
+
<show_in_store>0</show_in_store>
|
| 240 |
+
</active_ups>
|
| 241 |
+
<active_ups_price translate="label comment">
|
| 242 |
+
<label>UPS Price</label>
|
| 243 |
+
<comment>Price for UPS.</comment>
|
| 244 |
+
<frontend_type>text</frontend_type>
|
| 245 |
+
<sort_order>107</sort_order>
|
| 246 |
+
<show_in_default>1</show_in_default>
|
| 247 |
+
<show_in_website>1</show_in_website>
|
| 248 |
+
<show_in_store>0</show_in_store>
|
| 249 |
+
<depends>
|
| 250 |
+
<active_ups>1</active_ups>
|
| 251 |
+
</depends>
|
| 252 |
+
</active_ups_price>
|
| 253 |
+
|
| 254 |
+
<active_dhl translate="label comment">
|
| 255 |
+
<label>DHL</label>
|
| 256 |
+
<frontend_type>select</frontend_type>
|
| 257 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 258 |
+
<sort_order>108</sort_order>
|
| 259 |
+
<show_in_default>1</show_in_default>
|
| 260 |
+
<show_in_website>1</show_in_website>
|
| 261 |
+
<show_in_store>0</show_in_store>
|
| 262 |
+
</active_dhl>
|
| 263 |
+
<active_dhl_price translate="label comment">
|
| 264 |
+
<label>DHL Price</label>
|
| 265 |
+
<comment>Price for DHL.</comment>
|
| 266 |
+
<frontend_type>text</frontend_type>
|
| 267 |
+
<sort_order>109</sort_order>
|
| 268 |
+
<show_in_default>1</show_in_default>
|
| 269 |
+
<show_in_website>1</show_in_website>
|
| 270 |
+
<show_in_store>0</show_in_store>
|
| 271 |
+
<depends>
|
| 272 |
+
<active_dhl>1</active_dhl>
|
| 273 |
+
</depends>
|
| 274 |
+
</active_dhl_price>
|
| 275 |
+
|
| 276 |
+
<active_tnt translate="label comment">
|
| 277 |
+
<label>TNT</label>
|
| 278 |
+
<frontend_type>select</frontend_type>
|
| 279 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 280 |
+
<sort_order>110</sort_order>
|
| 281 |
+
<show_in_default>1</show_in_default>
|
| 282 |
+
<show_in_website>1</show_in_website>
|
| 283 |
+
<show_in_store>0</show_in_store>
|
| 284 |
+
</active_tnt>
|
| 285 |
+
<active_tnt_price translate="label comment">
|
| 286 |
+
<label>TNT Price</label>
|
| 287 |
+
<comment>Price for TNT.</comment>
|
| 288 |
+
<frontend_type>text</frontend_type>
|
| 289 |
+
<sort_order>111</sort_order>
|
| 290 |
+
<show_in_default>1</show_in_default>
|
| 291 |
+
<show_in_website>1</show_in_website>
|
| 292 |
+
<show_in_store>0</show_in_store>
|
| 293 |
+
<depends>
|
| 294 |
+
<active_tnt>1</active_tnt>
|
| 295 |
+
</depends>
|
| 296 |
+
</active_tnt_price>
|
| 297 |
+
|
| 298 |
+
<active_bring translate="label comment">
|
| 299 |
+
<label>Bring</label>
|
| 300 |
+
<frontend_type>select</frontend_type>
|
| 301 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 302 |
+
<sort_order>112</sort_order>
|
| 303 |
+
<show_in_default>1</show_in_default>
|
| 304 |
+
<show_in_website>1</show_in_website>
|
| 305 |
+
<show_in_store>0</show_in_store>
|
| 306 |
+
</active_bring>
|
| 307 |
+
<active_bring_price translate="label comment">
|
| 308 |
+
<label>Bring Price</label>
|
| 309 |
+
<comment>Price for Bring.</comment>
|
| 310 |
+
<frontend_type>text</frontend_type>
|
| 311 |
+
<sort_order>113</sort_order>
|
| 312 |
+
<show_in_default>1</show_in_default>
|
| 313 |
+
<show_in_website>1</show_in_website>
|
| 314 |
+
<show_in_store>0</show_in_store>
|
| 315 |
+
<depends>
|
| 316 |
+
<active_bring>1</active_bring>
|
| 317 |
+
</depends>
|
| 318 |
+
</active_bring_price>
|
| 319 |
+
<active_smartprice translate="label">
|
| 320 |
+
<label>Smart Price</label>
|
| 321 |
+
<frontend_type>select</frontend_type>
|
| 322 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 323 |
+
<sort_order>116</sort_order>
|
| 324 |
+
<show_in_default>1</show_in_default>
|
| 325 |
+
<show_in_website>1</show_in_website>
|
| 326 |
+
<show_in_store>0</show_in_store>
|
| 327 |
+
</active_smartprice>
|
| 328 |
|
| 329 |
<sort_order translate="label">
|
| 330 |
<label>Sort Order</label>
|
app/design/adminhtml/default/default/template/send24/sales/order/view/info.phtml
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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@magento.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.magento.com for more information.
|
| 20 |
+
*
|
| 21 |
+
* @category design
|
| 22 |
+
* @package default_default
|
| 23 |
+
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
|
| 24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 25 |
+
*/
|
| 26 |
+
?>
|
| 27 |
+
<?php $_order = $this->getOrder() ?>
|
| 28 |
+
<?php
|
| 29 |
+
$orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
|
| 30 |
+
$orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true);
|
| 31 |
+
?>
|
| 32 |
+
<div class="box-left">
|
| 33 |
+
<!--Order Information-->
|
| 34 |
+
<div class="entry-edit">
|
| 35 |
+
<?php if ($_order->getEmailSent()):
|
| 36 |
+
$_email = Mage::helper('sales')->__('the order confirmation email was sent');
|
| 37 |
+
else:
|
| 38 |
+
$_email = Mage::helper('sales')->__('the order confirmation email is not sent');
|
| 39 |
+
endif; ?>
|
| 40 |
+
<div class="entry-edit-head">
|
| 41 |
+
<?php if ($this->getNoUseOrderLink()): ?>
|
| 42 |
+
<h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?> (<?php echo $_email ?>)</h4>
|
| 43 |
+
<?php else: ?>
|
| 44 |
+
<a href="<?php echo $this->getViewUrl($_order->getId()) ?>"><?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?></a>
|
| 45 |
+
<strong>(<?php echo $_email ?>)</strong>
|
| 46 |
+
<?php endif; ?>
|
| 47 |
+
</div>
|
| 48 |
+
<div class="fieldset">
|
| 49 |
+
<table cellspacing="0" class="form-list">
|
| 50 |
+
<tr>
|
| 51 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Order Date') ?></label></td>
|
| 52 |
+
<td class="value"><strong><?php echo $orderAdminDate ?></strong></td>
|
| 53 |
+
</tr>
|
| 54 |
+
<?php if ($orderAdminDate != $orderStoreDate):?>
|
| 55 |
+
<tr>
|
| 56 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Order Date (%s)', $_order->getCreatedAtStoreDate()->getTimezone()) ?></label></td>
|
| 57 |
+
<td class="value"><strong><?php echo $orderStoreDate ?></strong></td>
|
| 58 |
+
</tr>
|
| 59 |
+
<?php endif;?>
|
| 60 |
+
<tr>
|
| 61 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Order Status') ?></label></td>
|
| 62 |
+
<td class="value"><strong><span id="order_status"><?php echo $_order->getStatusLabel() ?></span></strong></td>
|
| 63 |
+
</tr>
|
| 64 |
+
<tr>
|
| 65 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Purchased From') ?></label></td>
|
| 66 |
+
<td class="value"><strong><?php echo $this->getOrderStoreName() ?></strong></td>
|
| 67 |
+
</tr>
|
| 68 |
+
<?php if($_order->getRelationChildId()): ?>
|
| 69 |
+
<tr>
|
| 70 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Link to the New Order') ?></label></td>
|
| 71 |
+
<td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationChildId()) ?>">
|
| 72 |
+
<?php echo $_order->getRelationChildRealId() ?>
|
| 73 |
+
</a></td>
|
| 74 |
+
</tr>
|
| 75 |
+
<?php endif; ?>
|
| 76 |
+
<?php if($_order->getRelationParentId()): ?>
|
| 77 |
+
<tr>
|
| 78 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Link to the Previous Order') ?></label></td>
|
| 79 |
+
<td class="value"><a href="<?php echo $this->getViewUrl($_order->getRelationParentId()) ?>">
|
| 80 |
+
<?php echo $_order->getRelationParentRealId() ?>
|
| 81 |
+
</a></td>
|
| 82 |
+
</tr>
|
| 83 |
+
<?php endif; ?>
|
| 84 |
+
<?php if($_order->getRemoteIp() && $this->shouldDisplayCustomerIp()): ?>
|
| 85 |
+
<tr>
|
| 86 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Placed from IP') ?></label></td>
|
| 87 |
+
<td class="value"><strong><?php echo $_order->getRemoteIp(); echo ($_order->getXForwardedFor())?' (' . $this->escapeHtml($_order->getXForwardedFor()) . ')':''; ?></strong></td>
|
| 88 |
+
</tr>
|
| 89 |
+
<?php endif; ?>
|
| 90 |
+
<?php if($_order->getGlobalCurrencyCode() != $_order->getBaseCurrencyCode()): ?>
|
| 91 |
+
<tr>
|
| 92 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getGlobalCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
|
| 93 |
+
<td class="value"><strong><?php echo $_order->getBaseToGlobalRate() ?></strong></td>
|
| 94 |
+
</tr>
|
| 95 |
+
<?php endif; ?>
|
| 96 |
+
<?php if($_order->getBaseCurrencyCode() != $_order->getOrderCurrencyCode()): ?>
|
| 97 |
+
<tr>
|
| 98 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('%s / %s rate:', $_order->getOrderCurrencyCode(), $_order->getBaseCurrencyCode()) ?></label></td>
|
| 99 |
+
<td class="value"><strong><?php echo $_order->getBaseToOrderRate() ?></strong></td>
|
| 100 |
+
</tr>
|
| 101 |
+
<?php endif; ?>
|
| 102 |
+
</table>
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
</div>
|
| 106 |
+
<div class="box-right">
|
| 107 |
+
<!--Account Information-->
|
| 108 |
+
<div class="entry-edit">
|
| 109 |
+
<div class="entry-edit-head">
|
| 110 |
+
<h4 class="icon-head head-account"><?php echo Mage::helper('sales')->__('Account Information') ?></h4>
|
| 111 |
+
<div class="tools"><?php echo $this->getAccountEditLink()?></div>
|
| 112 |
+
</div>
|
| 113 |
+
<div class="fieldset">
|
| 114 |
+
<div class="hor-scroll">
|
| 115 |
+
<table cellspacing="0" class="form-list">
|
| 116 |
+
<tr>
|
| 117 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Customer Name') ?></label></td>
|
| 118 |
+
<td class="value">
|
| 119 |
+
<?php if ($_customerUrl=$this->getCustomerViewUrl()) : ?>
|
| 120 |
+
<a href="<?php echo $_customerUrl ?>" target="_blank"><strong><?php echo $this->escapeHtml($_order->getCustomerName()) ?></strong></a>
|
| 121 |
+
<?php else: ?>
|
| 122 |
+
<strong><?php echo $this->escapeHtml($_order->getCustomerName()) ?></strong>
|
| 123 |
+
<?php endif; ?>
|
| 124 |
+
</td>
|
| 125 |
+
</tr>
|
| 126 |
+
<tr>
|
| 127 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Email') ?></label></td>
|
| 128 |
+
<td class="value"><a href="mailto:<?php echo $_order->getCustomerEmail() ?>"><strong><?php echo $_order->getCustomerEmail() ?></strong></a></td>
|
| 129 |
+
</tr>
|
| 130 |
+
<?php if ($_groupName = $this->getCustomerGroupName()) : ?>
|
| 131 |
+
<tr>
|
| 132 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Customer Group') ?></label></td>
|
| 133 |
+
<td class="value"><strong><?php echo $_groupName ?></strong></td>
|
| 134 |
+
</tr>
|
| 135 |
+
<?php endif; ?>
|
| 136 |
+
<?php foreach ($this->getCustomerAccountData() as $data):?>
|
| 137 |
+
<tr>
|
| 138 |
+
<td class="label"><label><?php echo $data['label'] ?></label></td>
|
| 139 |
+
<td class="value"><strong><?php echo $data['value'] ?></strong></td>
|
| 140 |
+
</tr>
|
| 141 |
+
<?php endforeach;?>
|
| 142 |
+
</table>
|
| 143 |
+
</div>
|
| 144 |
+
</div>
|
| 145 |
+
</div>
|
| 146 |
+
<?php echo $this->getChildHtml('send24_sales_order_view_custom');?>
|
| 147 |
+
</div>
|
| 148 |
+
<div class="clear"></div>
|
| 149 |
+
|
| 150 |
+
<div class="box-left">
|
| 151 |
+
<!--Billing Address-->
|
| 152 |
+
<div class="entry-edit">
|
| 153 |
+
<div class="entry-edit-head">
|
| 154 |
+
<h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Billing Address') ?></h4>
|
| 155 |
+
<div class="tools"><?php echo $this->getAddressEditLink($_order->getBillingAddress())?></div>
|
| 156 |
+
</div>
|
| 157 |
+
<fieldset>
|
| 158 |
+
<address><?php echo $_order->getBillingAddress()->getFormated(true) ?></address>
|
| 159 |
+
</fieldset>
|
| 160 |
+
</div>
|
| 161 |
+
</div>
|
| 162 |
+
<?php if (!$this->getOrder()->getIsVirtual()): ?>
|
| 163 |
+
<div class="box-right">
|
| 164 |
+
<!--Shipping Address-->
|
| 165 |
+
<div class="entry-edit">
|
| 166 |
+
<div class="entry-edit-head">
|
| 167 |
+
<h4 class="icon-head head-shipping-address"><?php echo Mage::helper('sales')->__('Shipping Address') ?></h4>
|
| 168 |
+
<div class="tools"><?php echo $this->getAddressEditLink($_order->getShippingAddress())?></div>
|
| 169 |
+
</div>
|
| 170 |
+
<fieldset>
|
| 171 |
+
<address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
|
| 172 |
+
</fieldset>
|
| 173 |
+
</div>
|
| 174 |
+
</div>
|
| 175 |
+
|
| 176 |
+
<div class="clear"></div>
|
| 177 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/pickup/send24_pickup.phtml
CHANGED
|
@@ -30,7 +30,7 @@ $show_shops = Mage::getStoreConfig('carriers/send24_shipping/show_shops');
|
|
| 30 |
$val = json_encode($data);
|
| 31 |
// Get pickups list.
|
| 32 |
$ch = curl_init();
|
| 33 |
-
curl_setopt($ch, CURLOPT_URL, "https://
|
| 34 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
| 35 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 36 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
|
@@ -75,7 +75,7 @@ if(!empty($response)){
|
|
| 75 |
// Get shop all details.
|
| 76 |
$value_shops_id = implode(",", $array_shops_id);
|
| 77 |
$ch = curl_init();
|
| 78 |
-
curl_setopt($ch, CURLOPT_URL, "https://
|
| 79 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 80 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 81 |
curl_setopt($ch, CURLOPT_POST, TRUE);
|
|
@@ -121,11 +121,12 @@ $html .= '<div id="map"></div>';
|
|
| 121 |
$html .= '<div id="send24_info_map"></div>';
|
| 122 |
$html .= '<div id="send24_selected_shop"></div>';
|
| 123 |
$html .= '</div>';
|
|
|
|
| 124 |
echo $html;
|
| 125 |
|
| 126 |
?>
|
| 127 |
<script type="text/javascript">
|
| 128 |
-
|
| 129 |
jQuery('#send24_map_info').show("slow");
|
| 130 |
});
|
| 131 |
window.stroreshipper = {};
|
|
@@ -283,6 +284,7 @@ echo $html;
|
|
| 283 |
jQuery('#send24_map_info').show("slow");
|
| 284 |
});
|
| 285 |
|
|
|
|
| 286 |
document.cookie = 'selected_shop_id='+default_shop_id;
|
| 287 |
jQuery( ".selected_shop_dropdown" ).live( "click", function() {
|
| 288 |
var selected_shop_id = jQuery(this).val();
|
| 30 |
$val = json_encode($data);
|
| 31 |
// Get pickups list.
|
| 32 |
$ch = curl_init();
|
| 33 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/pickups_list");
|
| 34 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
| 35 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 36 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 75 |
// Get shop all details.
|
| 76 |
$value_shops_id = implode(",", $array_shops_id);
|
| 77 |
$ch = curl_init();
|
| 78 |
+
curl_setopt($ch, CURLOPT_URL, "https://send24.com/wc-api/v3/get_shop_full_list");
|
| 79 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
| 80 |
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
| 81 |
curl_setopt($ch, CURLOPT_POST, TRUE);
|
| 121 |
$html .= '<div id="send24_info_map"></div>';
|
| 122 |
$html .= '<div id="send24_selected_shop"></div>';
|
| 123 |
$html .= '</div>';
|
| 124 |
+
// jQuery( "#s_method_send24_shipping_send24, #s_method_send24_shipping_send24_gls, #s_method_send24_shipping_send24_ups, #s_method_send24_shipping_send24_postdenamrk, #s_method_send24_shipping_send24_dhl, #s_method_send24_shipping_send24_tnt, #s_method_send24_shipping_send24_bring" )
|
| 125 |
echo $html;
|
| 126 |
|
| 127 |
?>
|
| 128 |
<script type="text/javascript">
|
| 129 |
+
jQuery( "#s_method_send24_shipping_send24" ).live( "click", function() {
|
| 130 |
jQuery('#send24_map_info').show("slow");
|
| 131 |
});
|
| 132 |
window.stroreshipper = {};
|
| 284 |
jQuery('#send24_map_info').show("slow");
|
| 285 |
});
|
| 286 |
|
| 287 |
+
|
| 288 |
document.cookie = 'selected_shop_id='+default_shop_id;
|
| 289 |
jQuery( ".selected_shop_dropdown" ).live( "click", function() {
|
| 290 |
var selected_shop_id = jQuery(this).val();
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>4f4e331f92f560de38f6bc2b5501d8cb</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>GNU General Public License (GPL)</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -30,12 +30,12 @@ REQUIRES
|
|
| 30 |
This plugin requires an account on Send24. You will need to enter your api key in this shipping module to activate it. The account is free of charge and is used to administrate your shipments.
|
| 31 |
Register your free account on Send24.
|
| 32 |
</description>
|
| 33 |
-
<notes>-
|
| 34 |
-
-
|
| 35 |
<authors><author><name>Roman Barbotkin</name><user>Barbotkin</user><email>barbotkin@bk.ru</email></author></authors>
|
| 36 |
-
<date>2016-
|
| 37 |
-
<time>
|
| 38 |
-
<contents><target name="magelocal"><dir name="Send24"><dir name="Shipping"><dir name="Block"><file name="Pickup.php" hash="f177e834828df1e1815f2948550fa990"/></dir><dir name="Model"><file name="Carrier.php" hash="
|
| 39 |
<compatible/>
|
| 40 |
<dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php></required></dependencies>
|
| 41 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>4f4e331f92f560de38f6bc2b5501d8cb</name>
|
| 4 |
+
<version>1.0.4</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>GNU General Public License (GPL)</license>
|
| 7 |
<channel>community</channel>
|
| 30 |
This plugin requires an account on Send24. You will need to enter your api key in this shipping module to activate it. The account is free of charge and is used to administrate your shipments.
|
| 31 |
Register your free account on Send24.
|
| 32 |
</description>
|
| 33 |
+
<notes>- Added Distributors
|
| 34 |
+
- Added SmartPrice</notes>
|
| 35 |
<authors><author><name>Roman Barbotkin</name><user>Barbotkin</user><email>barbotkin@bk.ru</email></author></authors>
|
| 36 |
+
<date>2016-04-13</date>
|
| 37 |
+
<time>08:44:58</time>
|
| 38 |
+
<contents><target name="magelocal"><dir name="Send24"><dir name="Shipping"><dir name="Block"><file name="Pickup.php" hash="f177e834828df1e1815f2948550fa990"/></dir><dir name="Model"><file name="Carrier.php" hash="5788b68b031da8d7dac4136323f569e7"/><file name="Distributors.php" hash="c6e43ae0f45c964088defc02d328827e"/><file name="Map.php" hash="82bb37a418fb949ea0b5031397cb86c3"/></dir><dir name="controllers"><file name="AjaxController.php" hash="8ca3c223b28bea631656dfb9729dca9f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="eb4c1e9213ed826c0ddda6faf0a036b8"/><file name="config.xml" hash="8842107ae50a37ad6811ef3e312c812c"/><file name="system.xml" hash="ca5c1fe025b03a78f932ceab9d2c1b89"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Send24_Shipping.xml" hash="c365adcf43a601147514106e32ef524e"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="pickup"><dir name="checkout"><dir name="onepage"><dir name="shipping_method"><file name="send24-available.phtml" hash="702f6e436a80a6a83a30ffd005fd5250"/></dir></dir></dir><file name="send24_pickup.phtml" hash="662f71e3a61e9a76696fc078d79acbc1"/></dir></dir><dir name="layout"><file name="send24_pickup.xml" hash="c6ad18a12688a27737aea4ab17b9f1bd"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="send24_order_tamplate.xml" hash="28484d6562bca02f3202dbd3ea7664e6"/></dir><dir name="template"><dir name="send24"><dir name="sales"><dir name="order"><dir name="view"><file name="custom.phtml" hash="5348e18bd217afe85a6d7000da4f627e"/><file name="info.phtml" hash="7704a122a7741323d32ce1bb3ebe56a1"/><file name="info1_4.phtml" hash="cadf51cf0c34285a56060a89809f3982"/><file name="info1_9.phtml" hash="7704a122a7741323d32ce1bb3ebe56a1"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="send24"><file name="jquery-1.6.4.min.js" hash="9118381924c51c89d9414a311ec9c97f"/><file name="noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/><file name="popup.css" hash="34c9994bc7c4508709f612c4a217f51f"/></dir></dir></target></contents>
|
| 39 |
<compatible/>
|
| 40 |
<dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php></required></dependencies>
|
| 41 |
</package>
|
