Permalink
Browse files

[-] MO : Bug fix : TNT Carrier, mutliple inclusion of Google Maps script

  • Loading branch information...
1 parent 19844b7 commit 88f5ec37060893a8356b31d23e0edbf1048da615 @gaillafr gaillafr committed Mar 26, 2013
Showing with 9 additions and 6 deletions.
  1. +1 −1 tntcarrier/config.xml
  2. +6 −3 tntcarrier/tntcarrier.php
  3. +2 −2 tntcarrier/tpl/relaisColis.tpl
View
@@ -2,7 +2,7 @@
<module>
<name>tntcarrier</name>
<displayName><![CDATA[TNT Express]]></displayName>
- <version><![CDATA[1.8.4]]></version>
+ <version><![CDATA[1.8.5]]></version>
<description><![CDATA[Offer your customers, different delivery methods with TNT]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab>
@@ -27,7 +27,7 @@ public function __construct()
{
$this->name = 'tntcarrier';
$this->tab = 'shipping_logistics';
- $this->version = '1.8.4';
+ $this->version = '1.8.5';
$this->author = 'PrestaShop';
$this->limited_countries = array('fr');
$this->module_key = 'd4dcfde9937b67002235598ac35cbdf8';
@@ -910,7 +910,7 @@ public function hookextraCarrier($params)
}
}
$link = new Link();
- $redirect = $link->getPageLink('order.php?step=2');
+ $redirect = $link->getPageLink('order.php', false, null, 'step=2');
$smarty->assign('redirect' , $redirect);
if (!sizeof($cities))
$smarty->assign('cityError', $this->l('your shipping address zipcode is not correct.'));
@@ -931,12 +931,15 @@ public function hookextraCarrier($params)
);
$output = null;
- if (_PS_VERSION_ >= 1.5)
+ if (method_exists($this->context->controller, 'addJS'))
{
$this->context->controller->addJS('http://maps.google.com/maps/api/js?sensor=true');
$this->context->controller->addJS($this->_path.'js/relais.js');
$this->context->controller->addJS($this->_path.'js/jquery-ui-1.8.10.custom.min.js');
}
+ else
+ $smarty->assign('js_include', true);
+
return $output.$this->display(__FILE__, 'tpl/relaisColis.tpl');
}
@@ -1,12 +1,12 @@
<link rel="stylesheet" href="{$shop_url}/modules/tntcarrier/css/ui.tabs.css" type="text/css" />
<link rel="stylesheet" href="{$shop_url}/modules/tntcarrier/css/ui.dialog.css" type="text/css" />
-{if $version < '1.5'}
+{if isset($js_include)}
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="{$shop_url}/modules/tntcarrier/js/relais.js"></script>
<script type="text/javascript" src="{$shop_url}/js/jquery/jquery-ui-1.8.10.custom.min.js"></script>
{/if}
<script type="text/javascript">
-//date_carrier[$(this).val()]
+
var id_carrier = new Array();
var option_carrier = new Array();
var date_carrier = new Array();

0 comments on commit 88f5ec3

Please sign in to comment.