');
- $('#carriercompare_errors').slideDown('fast');
+ $('#carriercompare_errors').slideDown();
displayWaitingAjax('none', '');
- $('#carriercompare_submit').removeAttr('disabled');
}
else
{
@@ -155,35 +181,10 @@ function saveSelection()
return false;
}
-function PS_SE_HandleEvent()
+var ajaxQueries = new Array();
+function resetAjaxQueries()
{
- $(document).ready(function() {
- $('#id_country').change(function() {
- resetAjaxQueries();
- updateStateByIdCountry();
- });
-
- if (SE_RefreshMethod == 0)
- {
- $('#id_state,#zipcode').change(function() {
- resetAjaxQueries();
- updateCarriersList();
- });
- $('#zipcode').keyup(function() {
- resetAjaxQueries();
- updateCarriersList();
- });
- }
-
- $('#update_carriers_list').click(function() {
- updateCarriersList();
- });
-
- $('#carriercompare_submit').click(function() {
- resetAjaxQueries();
- saveSelection();
- return false;
- });
- updateStateByIdCountry();
- });
-}
+ for (i = 0; i < ajaxQueries.length; ++i)
+ ajaxQueries[i].abort();
+ ajaxQueries = new Array();
+}
\ No newline at end of file
diff --git a/modules/carriercompare/carriercompare.php b/modules/carriercompare/carriercompare.php
index 0c28febd7..b3e6a29ec 100755
--- a/modules/carriercompare/carriercompare.php
+++ b/modules/carriercompare/carriercompare.php
@@ -204,8 +204,17 @@ class CarrierCompare extends Module
$this->context->cookie->id_state = $id_state;
$this->context->cookie->postcode = $zipcode;
$this->context->cart->id_carrier = $id_carrier;
+ $delivery_option_list = $this->context->cart->getDeliveryOptionList();
+
+ $delivery_option = reset($delivery_option_list);
+ $id_carrier = (string)$id_carrier;
+ $id_carrier .= ',';
+ foreach ($delivery_option_list as $id_address => $options)
+ if (isset($options[$id_carrier]))
+ $this->context->cart->setDeliveryOption(array($id_address => $id_carrier));
+
if (!$this->context->cart->update())
- return array($this->l('Cannot update the cart'));
+ return array($this->l('Cannot update the cart'));
return array();
}
@@ -254,8 +263,8 @@ class CarrierCompare extends Module
* If visitor is logged, the module isn't available on Front office,
* we use the account informations for carrier selection and taxes.
*/
- if (Context::getContext()->customer->id)
- return false;
+ /*if (Context::getContext()->customer->id)
+ return false;*/
return true;
}
}
diff --git a/modules/carriercompare/carriercompare.tpl b/modules/carriercompare/carriercompare.tpl
deleted file mode 100644
index 81878fcfb..000000000
--- a/modules/carriercompare/carriercompare.tpl
+++ /dev/null
@@ -1,94 +0,0 @@
-{*
-* 2007-2013 PrestaShop
-*
-* NOTICE OF LICENSE
-*
-* This source file is subject to the Academic Free License (AFL 3.0)
-* that is bundled with this package in the file LICENSE.txt.
-* It is also available through the world-wide-web at this URL:
-* http://opensource.org/licenses/afl-3.0.php
-* If you did not receive a copy of the license and are unable to
-* obtain it through the world-wide-web, please send an email
-* to license@prestashop.com so we can send you a copy immediately.
-*
-* DISCLAIMER
-*
-* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
-* versions in the future. If you wish to customize PrestaShop for your
-* needs please refer to http://www.prestashop.com for more information.
-*
-* @author PrestaShop SA
-* @copyright 2007-2013 PrestaShop SA
-* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
-* International Registered Trademark & Property of PrestaShop SA
-**}
-
-{if !$opc}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ({l s='Needed for certain carriers' mod='carriercompare'})
-
-
-
-
-
-
-
-
{l s='Carrier' mod='carriercompare'}
-
{l s='Information' mod='carriercompare'}
-
{l s='Price' mod='carriercompare'}
-
-
-
-
-
-
-
-
{l s='No carrier is available for this selection' mod='carriercompare'}
-
-
-
-
-
-
-{/if}
diff --git a/modules/carriercompare/template/carriercompare.tpl b/modules/carriercompare/template/carriercompare.tpl
index 40b3e3a0c..a66b3e4da 100755
--- a/modules/carriercompare/template/carriercompare.tpl
+++ b/modules/carriercompare/template/carriercompare.tpl
@@ -21,40 +21,30 @@
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
-**}
+*}
{if !$opc}
-