Version Notes
- Supported magento 1.4.2.0
- Fixed map error.
Download this release
Release Info
Developer | Roman Barbotkin |
Extension | 4f4e331f92f560de38f6bc2b5501d8cb |
Version | 1.0.3.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.3.2 to 1.0.3.3
- app/code/local/Send24/Shipping/Model/Carrier.php +76 -41
- app/design/adminhtml/default/default/template/send24/sales/order/view/info1_4.phtml +173 -0
- app/design/adminhtml/default/default/template/send24/sales/order/view/{info.phtml → info1_9.phtml} +0 -0
- app/design/frontend/base/default/template/pickup/send24_pickup.phtml +24 -4
- package.xml +6 -5
app/code/local/Send24/Shipping/Model/Carrier.php
CHANGED
@@ -50,6 +50,28 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
50 |
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
51 |
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
// Save return.
|
54 |
$ch = curl_init();
|
55 |
curl_setopt($ch, CURLOPT_URL, "https://www.send24.com/wc-api/v3/get_user_id");
|
@@ -339,15 +361,17 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
339 |
}
|
340 |
|
341 |
$response_order = json_decode($response, JSON_FORCE_OBJECT);
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
|
|
|
|
351 |
// Create custom value for order.
|
352 |
// it temporarily
|
353 |
require_once('app/Mage.php');
|
@@ -408,24 +432,32 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
408 |
//Appending the Custom Variables to Template.
|
409 |
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
|
410 |
$customerEmail = $shipping_data['email'];
|
411 |
-
|
412 |
-
$
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
429 |
}
|
430 |
|
431 |
$observer->getOrder()->save();
|
@@ -460,7 +492,7 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
460 |
// Check errors.
|
461 |
if(empty($send24_countries->errors)){
|
462 |
$n = count($send24_countries);
|
463 |
-
if($shipping_country_name == $this->select_denmark){
|
464 |
for ($i = 0; $i < $n; $i++)
|
465 |
{
|
466 |
// Express.
|
@@ -628,11 +660,12 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
628 |
$send24_countries = json_decode(curl_exec($ch));
|
629 |
// print_r($send24_countries);
|
630 |
|
|
|
631 |
curl_close($ch);
|
632 |
// Check errors.
|
633 |
if(empty($send24_countries->errors)){
|
634 |
$n = count($send24_countries);
|
635 |
-
if($shipping_country_name == $this->select_denmark){
|
636 |
for ($i = 0; $i < $n; $i++)
|
637 |
{
|
638 |
// Denmark.
|
@@ -695,19 +728,21 @@ class Send24_Shipping_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract
|
|
695 |
if(empty($send24_countries->errors)){
|
696 |
$n = count($send24_countries);
|
697 |
// Check on no Denmark.
|
698 |
-
|
699 |
-
{
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
|
|
|
|
|
|
708 |
}
|
709 |
-
}
|
710 |
-
|
711 |
}
|
712 |
|
713 |
if($is_available_international == true){
|
50 |
$send24_consumer_key = $this->getConfigData('send24_consumer_key');
|
51 |
$send24_consumer_secret = $this->getConfigData('send24_consumer_secret');
|
52 |
|
53 |
+
$version = (float)Mage::getVersion();
|
54 |
+
$new_file = $_SERVER['DOCUMENT_ROOT'].'/app/design/adminhtml/default/default/template/send24/sales/order/view/info.phtml';
|
55 |
+
if(!file_exists($new_file)) {
|
56 |
+
if($version < 1.5){
|
57 |
+
try {
|
58 |
+
$file = $_SERVER['DOCUMENT_ROOT'].'/app/design/adminhtml/default/default/template/send24/sales/order/view/info1_4.phtml';
|
59 |
+
copy($file, $new_file);
|
60 |
+
}catch(Exception $error){
|
61 |
+
Mage::getSingleton('core/session')->addError($error->getMessage());
|
62 |
+
return false;
|
63 |
+
}
|
64 |
+
}else{
|
65 |
+
try {
|
66 |
+
$file = $_SERVER['DOCUMENT_ROOT'].'/app/design/adminhtml/default/default/template/send24/sales/order/view/info1_9.phtml';
|
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 |
// Save return.
|
76 |
$ch = curl_init();
|
77 |
curl_setopt($ch, CURLOPT_URL, "https://www.send24.com/wc-api/v3/get_user_id");
|
361 |
}
|
362 |
|
363 |
$response_order = json_decode($response, JSON_FORCE_OBJECT);
|
364 |
+
$version = (float)Mage::getVersion();
|
365 |
+
if($version >= 1.5){
|
366 |
+
$history = Mage::getModel('sales/order_status_history')
|
367 |
+
->setStatus($observer->getOrder()->getStatus())
|
368 |
+
->setComment('<strong>Track parsel </strong><br><a href="'.$response_order['track'].'" target="_blank">'.$response_order['track'].'</a>')
|
369 |
+
->setEntityName(Mage_Sales_Model_Order::HISTORY_ENTITY_NAME)
|
370 |
+
->setIsCustomerNotified(false)
|
371 |
+
->setCreatedAt(date('Y-m-d H:i:s', time() - 60*60*24));
|
372 |
+
|
373 |
+
$observer->getOrder()->addStatusHistory($history);
|
374 |
+
}
|
375 |
// Create custom value for order.
|
376 |
// it temporarily
|
377 |
require_once('app/Mage.php');
|
432 |
//Appending the Custom Variables to Template.
|
433 |
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
|
434 |
$customerEmail = $shipping_data['email'];
|
435 |
+
|
436 |
+
$version = (float)Mage::getVersion();
|
437 |
+
if($version < 1.5){
|
438 |
+
$headers = 'MIME-Version: 1.0' . "\r\n";
|
439 |
+
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
|
440 |
+
$subject = 'Subject: Send24 Track Notice';
|
441 |
+
$message = 'Track: <a href="'.$emailTemplateVariables['track'].'">'.$emailTemplateVariables['track'].'</a>';
|
442 |
+
mail($senderEmail, $subject, $message, $headers);
|
443 |
+
}else{
|
444 |
+
//Sending E-Mail to Customers.
|
445 |
+
$mail = Mage::getModel('core/email')
|
446 |
+
->setToName($senderName)
|
447 |
+
->setToEmail($customerEmail)
|
448 |
+
->setBody($processedTemplate)
|
449 |
+
->setSubject('Subject: Send24 Track Notice')
|
450 |
+
->setFromEmail($senderEmail)
|
451 |
+
->setFromName($senderName)
|
452 |
+
->setType('html');
|
453 |
+
try{
|
454 |
+
//Confimation E-Mail Send
|
455 |
+
$mail->send();
|
456 |
+
}catch(Exception $error){
|
457 |
+
Mage::getSingleton('core/session')->addError($error->getMessage());
|
458 |
+
return false;
|
459 |
+
}
|
460 |
+
}
|
461 |
}
|
462 |
|
463 |
$observer->getOrder()->save();
|
492 |
// Check errors.
|
493 |
if(empty($send24_countries->errors)){
|
494 |
$n = count($send24_countries);
|
495 |
+
if($shipping_country_name == $this->select_denmark || $shipping_country_name == 'Danmark'){
|
496 |
for ($i = 0; $i < $n; $i++)
|
497 |
{
|
498 |
// Express.
|
660 |
$send24_countries = json_decode(curl_exec($ch));
|
661 |
// print_r($send24_countries);
|
662 |
|
663 |
+
|
664 |
curl_close($ch);
|
665 |
// Check errors.
|
666 |
if(empty($send24_countries->errors)){
|
667 |
$n = count($send24_countries);
|
668 |
+
if($shipping_country_name == $this->select_denmark || $shipping_country_name == 'Danmark'){
|
669 |
for ($i = 0; $i < $n; $i++)
|
670 |
{
|
671 |
// Denmark.
|
728 |
if(empty($send24_countries->errors)){
|
729 |
$n = count($send24_countries);
|
730 |
// Check on no Denmark.
|
731 |
+
$is_available_international = false;
|
732 |
+
if($shipping_country_name != $this->select_denmark && $shipping_country_name != 'Danmark'){
|
733 |
+
for ($i = 0; $i < $n; $i++)
|
734 |
+
{
|
735 |
+
// International.
|
736 |
+
if ($send24_countries[$i]->title == $shipping_country_name)
|
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 |
if($is_available_international == true){
|
app/design/adminhtml/default/default/template/send24/sales/order/view/info1_4.phtml
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_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()): ?>
|
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())?' (' . $_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>
|
112 |
+
<div class="fieldset">
|
113 |
+
<div class="hor-scroll">
|
114 |
+
<table cellspacing="0" class="form-list">
|
115 |
+
<tr>
|
116 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Customer Name') ?></label></td>
|
117 |
+
<td class="value">
|
118 |
+
<?php if ($_customerUrl=$this->getCustomerViewUrl()) : ?>
|
119 |
+
<a href="<?php echo $_customerUrl ?>" target="_blank"><strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong></a>
|
120 |
+
<?php else: ?>
|
121 |
+
<strong><?php echo $this->htmlEscape($_order->getCustomerName()) ?></strong>
|
122 |
+
<?php endif; ?>
|
123 |
+
</td>
|
124 |
+
</tr>
|
125 |
+
<tr>
|
126 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Email') ?></label></td>
|
127 |
+
<td class="value"><a href="mailto:<?php echo $_order->getCustomerEmail() ?>"><strong><?php echo $_order->getCustomerEmail() ?></strong></a></td>
|
128 |
+
</tr>
|
129 |
+
<?php if ($_groupName = $this->getCustomerGroupName()) : ?>
|
130 |
+
<tr>
|
131 |
+
<td class="label"><label><?php echo Mage::helper('sales')->__('Customer Group') ?></label></td>
|
132 |
+
<td class="value"><strong><?php echo $_groupName ?></strong></td>
|
133 |
+
</tr>
|
134 |
+
<?php endif; ?>
|
135 |
+
<?php foreach ($this->getCustomerAccountData() as $data):?>
|
136 |
+
<tr>
|
137 |
+
<td class="label"><label><?php echo $data['label'] ?></label></td>
|
138 |
+
<td class="value"><strong><?php echo $data['value'] ?></strong></td>
|
139 |
+
</tr>
|
140 |
+
<?php endforeach;?>
|
141 |
+
</table>
|
142 |
+
</div>
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
<?php echo $this->getChildHtml('send24_sales_order_view_custom');?>
|
146 |
+
</div>
|
147 |
+
<div class="clear"></div>
|
148 |
+
|
149 |
+
<div class="box-left">
|
150 |
+
<!--Billing Address-->
|
151 |
+
<div class="entry-edit">
|
152 |
+
<div class="entry-edit-head">
|
153 |
+
<h4 class="icon-head head-billing-address"><?php echo Mage::helper('sales')->__('Billing Address') ?></h4>
|
154 |
+
</div>
|
155 |
+
<fieldset>
|
156 |
+
<address><?php echo $_order->getBillingAddress()->getFormated(true) ?></address>
|
157 |
+
</fieldset>
|
158 |
+
</div>
|
159 |
+
</div>
|
160 |
+
<?php if (!$this->getOrder()->getIsVirtual()): ?>
|
161 |
+
<div class="box-right">
|
162 |
+
<!--Shipping Address-->
|
163 |
+
<div class="entry-edit">
|
164 |
+
<div class="entry-edit-head">
|
165 |
+
<h4 class="icon-head head-shipping-address"><?php echo Mage::helper('sales')->__('Shipping Address') ?></h4>
|
166 |
+
</div>
|
167 |
+
<fieldset>
|
168 |
+
<address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
|
169 |
+
</fieldset>
|
170 |
+
</div>
|
171 |
+
</div>
|
172 |
+
<div class="clear"></div>
|
173 |
+
<?php endif; ?>
|
app/design/adminhtml/default/default/template/send24/sales/order/view/{info.phtml → info1_9.phtml}
RENAMED
File without changes
|
app/design/frontend/base/default/template/pickup/send24_pickup.phtml
CHANGED
@@ -58,11 +58,17 @@ if(!empty($response)){
|
|
58 |
curl_close($ch);
|
59 |
$array_shops_id = array();
|
60 |
$map_value = '[';
|
61 |
-
|
62 |
-
$map_value .= '{lat: "'.$value['latitude'].'", lng: "'.$value['longitude'].'", title: "'.$value['post_title'].'", id: "'.$value['ID'].'", distance: "'.$value['distance'].'"},';
|
63 |
-
array_push($array_shops_id, $value['ID']);
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
|
|
66 |
$map_value .= ']';
|
67 |
}
|
68 |
|
@@ -93,6 +99,18 @@ if(!empty($response)){
|
|
93 |
<?php
|
94 |
$html = array();
|
95 |
if($show_shops == 'map'){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
// Map.
|
97 |
$html = '<br><div id="send24_map_info">';
|
98 |
$html .= 'Selected shop: <b id="shop_selected">'.$output['0']['post_title'].'</b> <p>(<a id="send24_map" href="#open_map">choose</a>)</p>';
|
@@ -122,6 +140,7 @@ echo $html;
|
|
122 |
|
123 |
var map;
|
124 |
window.initMap = function() {
|
|
|
125 |
var coordinates = <?php echo $map_value; ?>;
|
126 |
var start_coordinates = Math.round(coordinates.length/2);
|
127 |
var marker = Array();
|
@@ -129,6 +148,7 @@ echo $html;
|
|
129 |
center: {lat: Number(coordinates[start_coordinates].lat), lng: Number(coordinates[start_coordinates].lng)},
|
130 |
zoom: 12
|
131 |
});
|
|
|
132 |
|
133 |
var default_id_distance = 0;
|
134 |
for (var i = 0; i < coordinates.length; i++){
|
@@ -240,7 +260,7 @@ echo $html;
|
|
240 |
document.cookie = 'selected_shop_id='+default_shop_id;
|
241 |
}
|
242 |
|
243 |
-
window.loadJsFile("https://maps.googleapis.com/maps/api/js?
|
244 |
</script>
|
245 |
|
246 |
<?php
|
58 |
curl_close($ch);
|
59 |
$array_shops_id = array();
|
60 |
$map_value = '[';
|
61 |
+
$end = end($output);
|
|
|
|
|
62 |
|
63 |
+
foreach ($output as $key => $value) {
|
64 |
+
if($end['ID'] != $value['ID']){
|
65 |
+
$map_value .= '{lat: "'.$value['latitude'].'", lng: "'.$value['longitude'].'", title: "'.$value['post_title'].'", id: "'.$value['ID'].'", distance: "'.$value['distance'].'"},';
|
66 |
+
array_push($array_shops_id, $value['ID']);
|
67 |
+
}else{
|
68 |
+
$map_value .= '{lat: "'.$value['latitude'].'", lng: "'.$value['longitude'].'", title: "'.$value['post_title'].'", id: "'.$value['ID'].'", distance: "'.$value['distance'].'"}';
|
69 |
+
array_push($array_shops_id, $value['ID']);
|
70 |
}
|
71 |
+
}
|
72 |
$map_value .= ']';
|
73 |
}
|
74 |
|
99 |
<?php
|
100 |
$html = array();
|
101 |
if($show_shops == 'map'){
|
102 |
+
|
103 |
+
$version = (float)Mage::getVersion();
|
104 |
+
if($version < 1.5){
|
105 |
+
?>
|
106 |
+
<style type="text/css" media="screen">
|
107 |
+
#send24-popup-map{
|
108 |
+
height: 590px;
|
109 |
+
}
|
110 |
+
</style>
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
114 |
// Map.
|
115 |
$html = '<br><div id="send24_map_info">';
|
116 |
$html .= 'Selected shop: <b id="shop_selected">'.$output['0']['post_title'].'</b> <p>(<a id="send24_map" href="#open_map">choose</a>)</p>';
|
140 |
|
141 |
var map;
|
142 |
window.initMap = function() {
|
143 |
+
|
144 |
var coordinates = <?php echo $map_value; ?>;
|
145 |
var start_coordinates = Math.round(coordinates.length/2);
|
146 |
var marker = Array();
|
148 |
center: {lat: Number(coordinates[start_coordinates].lat), lng: Number(coordinates[start_coordinates].lng)},
|
149 |
zoom: 12
|
150 |
});
|
151 |
+
window.map = map;
|
152 |
|
153 |
var default_id_distance = 0;
|
154 |
for (var i = 0; i < coordinates.length; i++){
|
260 |
document.cookie = 'selected_shop_id='+default_shop_id;
|
261 |
}
|
262 |
|
263 |
+
window.loadJsFile("https://maps.googleapis.com/maps/api/js?callback=initMap");
|
264 |
</script>
|
265 |
|
266 |
<?php
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>4f4e331f92f560de38f6bc2b5501d8cb</name>
|
4 |
-
<version>1.0.3.
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
@@ -30,11 +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 |
<authors><author><name>Roman Barbotkin</name><user>Barbotkin</user><email>barbotkin@bk.ru</email></author></authors>
|
35 |
-
<date>2016-03-
|
36 |
-
<time>
|
37 |
-
<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="
|
38 |
<compatible/>
|
39 |
<dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php></required></dependencies>
|
40 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>4f4e331f92f560de38f6bc2b5501d8cb</name>
|
4 |
+
<version>1.0.3.3</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>- Supported magento 1.4.2.0
|
34 |
+
- Fixed map error.</notes>
|
35 |
<authors><author><name>Roman Barbotkin</name><user>Barbotkin</user><email>barbotkin@bk.ru</email></author></authors>
|
36 |
+
<date>2016-03-18</date>
|
37 |
+
<time>15:08:08</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="b4c73631a462d33c3e53321075453955"/><file name="Map.php" hash="82bb37a418fb949ea0b5031397cb86c3"/><file name="Points.php" hash="d8ada030c8d353f963693547ad71b03b"/></dir><dir name="controllers"><file name="AjaxController.php" hash="8ca3c223b28bea631656dfb9729dca9f"/></dir><dir name="etc"><file name="config.xml" hash="8d6ee69362e73da90f2facab4e43cbc6"/><file name="system.xml" hash="70dbd5a224e9a46dfc793ff5ac8b4248"/></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="a71bf4c32935c9bc424682106940b1bb"/></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="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>
|