// MERGE with 1.4 r7770

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7776 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-07-28 09:20:57 +00:00
parent df255f66c1
commit a875fecb20
968 changed files with 26082 additions and 3937 deletions
+34 -12
View File
@@ -53,8 +53,7 @@ class CarrierCompare extends Module
public function hookHeader($params)
{
$fileName = explode(DIRECTORY_SEPARATOR, $_SERVER['PHP_SELF']);
if ($fileName[(sizeof($fileName)-1)] != 'order.php')
if (!$this->isModuleAvailable())
return;
$context = Context::getContext();
$context->controller->addCSS(($this->_path).'style.css', 'all');
@@ -66,20 +65,19 @@ class CarrierCompare extends Module
*/
public function hookShoppingCart($params)
{
$context = Context::getContext();
if ($context->customer->id)
if (!$this->isModuleAvailable())
return;
$context->smarty->assign(array(
'countries' => Country::getCountries($context->language->id),
'countries' => Country::getCountries($this->context->language->id),
'id_carrier' => ($params['cart']->id_carrier ? $params['cart']->id_carrier : Configuration::get('PS_CARRIER_DEFAULT')),
'id_country' => (isset($context->customer->geoloc_id_country) ? $context->customer->geoloc_id_country : Configuration::get('PS_COUNTRY_DEFAULT')),
'id_state' => (isset($context->customer->geoloc_id_state) ? $context->customer->geoloc_id_state : 0),
'zipcode' => (isset($context->customer->geoloc_postcode) ? $context->customer->geoloc_postcode : ''),
'currencySign' => $context->currency->sign,
'currencyRate' => $context->currency->conversion_rate,
'currencyFormat' => $context->currency->format,
'currencyBlank' => $context->currency->blank
'id_country' => (isset($this->context->customer->geoloc_id_country) ? $this->context->customer->geoloc_id_country : Configuration::get('PS_COUNTRY_DEFAULT')),
'id_state' => (isset($this->context->customer->geoloc_id_state) ? $this->context->customer->geoloc_id_state : 0),
'zipcode' => (isset($this->context->customer->geoloc_postcode) ? $this->context->customer->geoloc_postcode : ''),
'currencySign' => $this->context->currency->sign,
'currencyRate' => $this->context->currency->conversion_rate,
'currencyFormat' => $this->context->currency->format,
'currencyBlank' => $this->context->currency->blank
));
return $this->display(__FILE__, 'carriercompare.tpl');
@@ -173,5 +171,29 @@ class CarrierCompare extends Module
return true;
return false;
}
/**
* This module is shown on front office, in only some conditions
* @return bool
*/
private function isModuleAvailable()
{
global $cookie;
$fileName = basename($_SERVER['SCRIPT_FILENAME']);
/**
* This module is only available on standard order process because
* on One Page Checkout the carrier list is already available.
*/
if ($fileName != 'order.php')
return false;
/**
* If visitor is logged, the module isn't available on Front office,
* we use the account informations for carrier selection and taxes.
*/
if ($cookie->id_customer)
return false;
return true;
}
}
+6 -10
View File
@@ -2,6 +2,12 @@
global $_MODULE;
$_MODULE = array();
$_MODULE['<{carriercompare}prestashop>carriercompare_115484428c82f859100c07ae1170d9e0'] = 'Versandkalkulation';
$_MODULE['<{carriercompare}prestashop>carriercompare_ed70a57a190d596171cf324c16a2277d'] = 'Ungültige Bundesland-ID';
$_MODULE['<{carriercompare}prestashop>carriercompare_66e799a222e07b1cf25498465028061d'] = 'Ungültige Land-ID';
$_MODULE['<{carriercompare}prestashop>carriercompare_e3f585e306c3cda18369730a6a628f7b'] = 'Ungültige Lieferantne-ID';
$_MODULE['<{carriercompare}prestashop>carriercompare_efaf5c3827ef576b05de32ad458f196c'] = 'Dieser Lieferant steht für diesen Bereich nicht zur Verfüung';
$_MODULE['<{carriercompare}prestashop>carriercompare_edc5cf1b3bab64b1d45ef51c63b53887'] = 'Warenkorb kann nicht aktualisiert werden';
$_MODULE['<{carriercompare}prestashop>carriercompare_e7a6ca4e744870d455a57b644f696457'] = 'Gratis!';
$_MODULE['<{carriercompare}prestashop>carriercompare_fbc1bef527a3a092053a244fd8d87abf'] = 'Versand und Steuern kalkulieren';
$_MODULE['<{carriercompare}prestashop>carriercompare_59716c97497eb9694541f7c3d37b1a4d'] = 'Land';
@@ -12,13 +18,3 @@ $_MODULE['<{carriercompare}prestashop>carriercompare_a82be0f551b8708bc08eb33cd9d
$_MODULE['<{carriercompare}prestashop>carriercompare_3601146c4e948c32b6424d2c0a7f0118'] = 'Preis';
$_MODULE['<{carriercompare}prestashop>carriercompare_f620c0ed0c89129c9dd8953406300061'] = 'Kein Versender für diese Region ausgewählt';
$_MODULE['<{carriercompare}prestashop>carriercompare_c6b61ece4cb72c71e84d91a4d22aa449'] = 'Versandoptionen aktualisieren';
$_MODULE['<{carriercompare}prestashop>carriercompare_115484428c82f859100c07ae1170d9e0'] = 'Versandkalkulation';
$_MODULE['<{carriercompare}prestashop>carriercompare_1b28c1bcdfb00fe76bf8612d5cd81b01'] = 'Modul, um Liefermöglichkeiten zu vergleichen, befor es zum Bestellprozess kommt';
$_MODULE['<{carriercompare}prestashop>carriercompare_ed70a57a190d596171cf324c16a2277d'] = 'Ungültige Bundesland-ID';
$_MODULE['<{carriercompare}prestashop>carriercompare_66e799a222e07b1cf25498465028061d'] = 'Ungültige Land-ID';
$_MODULE['<{carriercompare}prestashop>carriercompare_8250266f9d2fb72b4f8921a0b998546e'] = 'Verwenden Sie bitte eine gültige Postleitzahl, die Ihrer Landauswahl entspricht';
$_MODULE['<{carriercompare}prestashop>carriercompare_e3f585e306c3cda18369730a6a628f7b'] = 'Ungültige Lieferantne-ID';
$_MODULE['<{carriercompare}prestashop>carriercompare_efaf5c3827ef576b05de32ad458f196c'] = 'Dieser Lieferant steht für diesen Bereich nicht zur Verfüung';
$_MODULE['<{carriercompare}prestashop>carriercompare_edc5cf1b3bab64b1d45ef51c63b53887'] = 'Warenkorb kann nicht aktualisiert werden';
?>
+36
View File
@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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 <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;