From 0b3ad194e059458442d169bf6bfaf92fe1b92454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Chans=C3=A9aume?= Date: Mon, 28 Apr 2014 15:28:25 +0200 Subject: [PATCH] unnecessary code removed, adding new configuration values in update sql --- .../Core/Template/Smarty/Plugins/CartPostage.php | 16 ++-------------- setup/update/2.0.1.sql | 4 ++++ templates/frontOffice/default/cart.html | 2 +- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/CartPostage.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/CartPostage.php index 1fb8df43e..9bf98dd43 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/CartPostage.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/CartPostage.php @@ -76,7 +76,7 @@ class CartPostage extends AbstractSmartyPlugin { if (! $repeat) { - return $content; + return (null !== $this->countryId) ? $content : ""; } $customer = $this->request->getSession()->getCustomerUser(); @@ -102,9 +102,7 @@ class CartPostage extends AbstractSmartyPlugin * cart if it exists * - the country saved in cookie if customer have changed * the default country - * - the default country for the shop if exists - * - the country related to the customer based on browser preferences - * - default country + * - the default country for the shop if it exists * * * @param \Thelia\Model\Customer $customer @@ -149,16 +147,6 @@ class CartPostage extends AbstractSmartyPlugin ; } - // get browser lang - $lang_code= $this->request->getSession()->getLang()->getCode(); - if ($lang_code) { - $country = CountryQuery::create() - ->findOneByIsoalpha2(strtoupper($lang_code)); - if (null !== $country) { - return $country; - } - } - return null; } diff --git a/setup/update/2.0.1.sql b/setup/update/2.0.1.sql index f3d7be46f..cc368353a 100644 --- a/setup/update/2.0.1.sql +++ b/setup/update/2.0.1.sql @@ -6,6 +6,10 @@ UPDATE `config` SET `value`='2.0.1' WHERE `name`='thelia_version'; UPDATE `config` SET `value`='1' WHERE `name`='thelia_release_version'; UPDATE `config` SET `value`='' WHERE `name`='thelia_extra_version'; +INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES +('front_cart_country_cookie_name','fcccn', 1, 1, NOW(), NOW()); +INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES +('front_cart_country_cookie_expires','2592000', 1, 1, NOW(), NOW()); ALTER TABLE `module` ADD INDEX `idx_module_activate` (`activate`); diff --git a/templates/frontOffice/default/cart.html b/templates/frontOffice/default/cart.html index a38877d01..366ebd6fe 100644 --- a/templates/frontOffice/default/cart.html +++ b/templates/frontOffice/default/cart.html @@ -165,7 +165,7 @@
{assign var="totalAmount" value={cart attr='total_taxed_price_without_discount'} + $postageAmount } {$totalAmount} {currency attr="symbol"} -
cart +