diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php
index b0222401a..ebdef6a4a 100644
--- a/controllers/admin/AdminEmployeesController.php
+++ b/controllers/admin/AdminEmployeesController.php
@@ -227,7 +227,7 @@ class AdminEmployeesControllerCore extends AdminController
'name' => 'id_lang',
'required' => true,
'options' => array(
- 'query' => Language::getLanguages(),
+ 'query' => Language::getLanguages(false),
'id' => 'id_lang',
'name' => 'name'
)
diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php
index 091a51b8b..9d516d1d9 100644
--- a/controllers/admin/AdminModulesController.php
+++ b/controllers/admin/AdminModulesController.php
@@ -600,25 +600,14 @@ class AdminModulesControllerCore extends AdminController
foreach ($modules as $name)
{
$full_report = null;
- if ($key == 'update')
- {
- if (ConfigurationTest::test_dir('modules/'.$name, true, $full_report))
- Tools::deleteDirectory('../modules/'.$name.'/');
- else
- {
- $module = Module::getInstanceByName(urldecode($name));
- $this->errors[] = $this->l(sprintf("Module %s can't be upgraded : ", $module->displayName)).$full_report;
- continue;
- }
- }
-
// If Addons module, download and unzip it before installing it
- if (!file_exists('../modules/'.$name.'/'.$name.'.php'))
+ if (!file_exists('../modules/'.$name.'/'.$name.'.php') || $key == 'update')
{
$filesList = array(
array('type' => 'addonsNative', 'file' => Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 'loggedOnAddons' => 0),
array('type' => 'addonsBought', 'file' => Module::CACHE_FILE_CUSTOMER_MODULES_LIST, 'loggedOnAddons' => 1),
);
+
foreach ($filesList as $f)
if (file_exists(_PS_ROOT_DIR_.$f['file']))
{
@@ -628,12 +617,19 @@ class AdminModulesControllerCore extends AdminController
foreach ($xml->module as $modaddons)
if ($name == $modaddons->name && isset($modaddons->id) && ($this->logged_on_addons || $f['loggedOnAddons'] == 0))
{
+ $download_ok = false;
if ($f['loggedOnAddons'] == 0)
- if (file_put_contents('../modules/'.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id)))))
- $this->extractArchive('../modules/'.$modaddons->name.'.zip', false);
- if ($f['loggedOnAddons'] == 1 && $this->logged_on_addons)
- if (file_put_contents('../modules/'.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons))))))
- $this->extractArchive('../modules/'.$modaddons->name.'.zip', false);
+ if (file_put_contents(_PS_MODULE_DIR_.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id)))))
+ $download_ok = true;
+ elseif ($f['loggedOnAddons'] == 1 && $this->logged_on_addons)
+ if (file_put_contents(_PS_MODULE_DIR_.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons))))))
+ $download_ok = true;
+
+ if (!$download_ok)
+ $this->errors[] = $this->l('Error on downloading the lastest version');
+ else
+ if(!$this->extractArchive(_PS_MODULE_DIR_.$modaddons->name.'.zip', false))
+ $this->errors[] = $this->l(sprintf("Module %s can't be upgraded: ", $modaddons->name));
}
}
}
diff --git a/controllers/admin/AdminScenesController.php b/controllers/admin/AdminScenesController.php
index 38d31e3e9..7f9ef8b91 100644
--- a/controllers/admin/AdminScenesController.php
+++ b/controllers/admin/AdminScenesController.php
@@ -206,7 +206,7 @@ class AdminScenesControllerCore extends AdminController
$this->addJqueryPlugin('autocomplete');
$this->addJqueryPlugin('imgareaselect');
$this->addJs(_PS_JS_DIR_.'admin-scene-cropping.js' );
- $image_to_map_desc .= '

';
$image_to_map_desc .= '
diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php
index a02e767dd..df8898e62 100644
--- a/controllers/admin/AdminTranslationsController.php
+++ b/controllers/admin/AdminTranslationsController.php
@@ -686,6 +686,9 @@ class AdminTranslationsControllerCore extends AdminController
if (pathinfo($file2check['filename'], PATHINFO_BASENAME) == 'index.php' && file_put_contents(_PS_TRANSLATIONS_DIR_.'../'.$file2check['filename'], Tools::getDefaultIndexContent()))
continue;
+ // Clear smarty modules cache
+ Tools::clearCache();
+
if (Validate::isLanguageFileName($filename))
{
if (!Language::checkAndAddLanguage($iso_code))
@@ -735,13 +738,14 @@ class AdminTranslationsControllerCore extends AdminController
$this->errors[] = Tools::displayError('The archive cannot be extracted.'). ' '.$error->message;
else
{
-
if (!Language::checkAndAddLanguage($arr_import_lang[0]))
$conf = 20;
else
{
// Reset cache
Language::loadLanguages();
+ // Clear smarty modules cache
+ Tools::clearCache();
AdminTranslationsController::checkAndAddMailsFiles($arr_import_lang[0], $files_list);
if ($tab_errors = AdminTranslationsController::addNewTabs($arr_import_lang[0], $files_list))
@@ -1340,6 +1344,9 @@ class AdminTranslationsControllerCore extends AdminController
foreach ($arr_files as $value)
$this->findAndWriteTranslationsIntoFile($value['file_name'], $value['files'], $value['theme'], $value['module'], $value['dir']);
+ // Clear modules cache
+ Tools::clearCache();
+
// Redirect
if (Tools::getValue('submitTranslationsModulesAndStay'))
$this->redirect(true);
diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php
index 727945eb2..f5b8563b4 100644
--- a/controllers/front/AuthController.php
+++ b/controllers/front/AuthController.php
@@ -104,12 +104,21 @@ class AuthControllerCore extends FrontController
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
else
$countries = Country::getCountries($this->context->language->id, true);
-
+
+ if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
+ {
+ $array = preg_split('/,|-/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+ if (!Validate::isLanguageIsoCode($array[0]) || !($sl_country = Country::getByIso($array[0])))
+ $sl_country = (int)Configuration::get('PS_COUNTRY_DEFAULT');
+ }
+ else
+ $sl_country = (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT'));
+
$this->context->smarty->assign(array(
'inOrderProcess' => true,
'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'),
'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'),
- 'sl_country' => (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT')),
+ 'sl_country' => (int)$sl_country,
'countries' => $countries
));
}
@@ -307,7 +316,7 @@ class AuthControllerCore extends FrontController
$this->context->cart->secure_key = $customer->secure_key;
$this->context->cart->save();
$this->context->cookie->id_cart = (int)$this->context->cart->id;
- $this->context->cookie->update();
+ $this->context->cookie->write();
$this->context->cart->autosetProductAddress();
Hook::exec('actionAuthentication');
diff --git a/controllers/front/CompareController.php b/controllers/front/CompareController.php
index 5317d6d75..410946a84 100644
--- a/controllers/front/CompareController.php
+++ b/controllers/front/CompareController.php
@@ -31,7 +31,7 @@ class CompareControllerCore extends FrontController
public function setMedia()
{
parent::setMedia();
- $this->addCSS(_THEME_CSS_DIR_.'/comparator.css');
+ $this->addCSS(_THEME_CSS_DIR_.'comparator.css');
if (Configuration::get('PS_COMPARATOR_MAX_ITEM') > 0)
$this->addJS(_THEME_JS_DIR_.'products-comparison.js');
diff --git a/controllers/front/OrderController.php b/controllers/front/OrderController.php
index 190bdd1de..37b5d90b8 100644
--- a/controllers/front/OrderController.php
+++ b/controllers/front/OrderController.php
@@ -347,7 +347,6 @@ class OrderControllerCore extends ParentOrderController
$this->context->smarty->assign(
array(
- 'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only
'is_guest' => (isset($this->context->customer->is_guest) ? $this->context->customer->is_guest : 0)
));
}
diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php
index fcc6fb222..166afebeb 100644
--- a/controllers/front/OrderOpcController.php
+++ b/controllers/front/OrderOpcController.php
@@ -190,6 +190,13 @@ class OrderOpcControllerCore extends ParentOrderController
$this->context->cart->id_address_invoice = Tools::isSubmit('same') ? $this->context->cart->id_address_delivery : (int)(Tools::getValue('id_address_invoice'));
if (!$this->context->cart->update())
$this->errors[] = Tools::displayError('An error occurred while updating your cart.');
+
+ $infos = Address::getCountryAndState((int)($this->context->cart->id_address_delivery));
+ if (isset($infos['id_country']) && $infos['id_country'])
+ {
+ $country = new Country((int)$infos['id_country']);
+ $this->context->country = $country;
+ }
// Address has changed, so we check if the cart rules still apply
CartRule::autoRemoveFromCart($this->context);
@@ -316,7 +323,7 @@ class OrderOpcControllerCore extends ParentOrderController
// If a rule offer free-shipping, force hidding shipping prices
$free_shipping = false;
foreach ($this->context->cart->getCartRules() as $rule)
- if ($rule['free_shipping'])
+ if ($rule['free_shipping'] && !$rule['carrier_restriction'])
{
$free_shipping = true;
break;
@@ -498,9 +505,19 @@ class OrderOpcControllerCore extends ParentOrderController
$wrapping_fees = $this->context->cart->getGiftWrappingPrice(false);
$wrapping_fees_tax_inc = $wrapping_fees = $this->context->cart->getGiftWrappingPrice();
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
+
+ $free_shipping = false;
+ foreach ($this->context->cart->getCartRules() as $rule)
+ {
+ if ($rule['free_shipping'] && !$rule['carrier_restriction'])
+ {
+ $free_shipping = true;
+ break;
+ }
+ }
$vars = array(
- 'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only
+ 'free_shipping' => $free_shipping,
'checkedTOS' => (int)($this->context->cookie->checkedTOS),
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
diff --git a/controllers/front/ParentOrderController.php b/controllers/front/ParentOrderController.php
index 164ba87b2..075198f2f 100644
--- a/controllers/front/ParentOrderController.php
+++ b/controllers/front/ParentOrderController.php
@@ -30,6 +30,8 @@
class FreeOrder extends PaymentModule
{
public $active = 1;
+ public $name = 'free_order';
+ public $displayName = 'free_order';
}
class ParentOrderControllerCore extends FrontController
@@ -454,15 +456,15 @@ class ParentOrderControllerCore extends FrontController
}
protected function _assignCarrier()
- {
+ {
$address = new Address($this->context->cart->id_address_delivery);
$id_zone = Address::getZoneById($address->id);
$carriers = $this->context->cart->simulateCarriersOutput();
$checked = $this->context->cart->simulateCarrierSelectedOutput();
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
$this->setDefaultCarrierSelection($delivery_option_list);
-
- $this->context->smarty->assign(array(
+
+ $this->context->smarty->assign(array(
'address_collection' => $this->context->cart->getAddressCollection(),
'delivery_option_list' => $delivery_option_list,
'carriers' => $carriers,
@@ -497,8 +499,18 @@ class ParentOrderControllerCore extends FrontController
$this->link_conditions .= '?content_only=1';
else
$this->link_conditions .= '&content_only=1';
-
+
+ $free_shipping = false;
+ foreach ($this->context->cart->getCartRules() as $rule)
+ {
+ if ($rule['free_shipping'] && !$rule['carrier_restriction'])
+ {
+ $free_shipping = true;
+ break;
+ }
+ }
$this->context->smarty->assign(array(
+ 'free_shipping' => $free_shipping,
'checkedTOS' => (int)($this->context->cookie->checkedTOS),
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
diff --git a/install-dev/classes/datas.php b/install-dev/classes/datas.php
index b6156fe9c..964d737cf 100644
--- a/install-dev/classes/datas.php
+++ b/install-dev/classes/datas.php
@@ -95,7 +95,7 @@ class Datas
),
'shop_activity' => array(
'name' => 'activity',
- 'default' => 1,
+ 'default' => 0,
'validate' => 'isInt',
),
'shop_country' => array(
diff --git a/install-dev/controllers/http/configure.php b/install-dev/controllers/http/configure.php
index ce237f7a9..1b35a3a9f 100644
--- a/install-dev/controllers/http/configure.php
+++ b/install-dev/controllers/http/configure.php
@@ -227,28 +227,29 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
{
// List of activities
$list_activities = array(
- $this->l('Lingerie and Adult'),
- $this->l('Animals and Pets'),
- $this->l('Art and Culture'),
- $this->l('Babies'),
- $this->l('Beauty and Personal Care'),
- $this->l('Cars'),
- $this->l('Computer Hardware and Software'),
- $this->l('Download'),
- $this->l('Fashion and accessories'),
- $this->l('Flowers, Gifts and Crafts'),
- $this->l('Food and beverage'),
- $this->l('HiFi, Photo and Video'),
- $this->l('Home and Garden'),
- $this->l('Home Appliances'),
- $this->l('Jewelry'),
- $this->l('Mobile and Telecom'),
- $this->l('Services'),
- $this->l('Shoes and accessories'),
- $this->l('Sports and Entertainment'),
- $this->l('Travel'),
+ 1 => $this->l('Lingerie and Adult'),
+ 2 => $this->l('Animals and Pets'),
+ 3 => $this->l('Art and Culture'),
+ 4 => $this->l('Babies'),
+ 5 => $this->l('Beauty and Personal Care'),
+ 6 => $this->l('Cars'),
+ 7 => $this->l('Computer Hardware and Software'),
+ 8 => $this->l('Download'),
+ 9 => $this->l('Fashion and accessories'),
+ 10 => $this->l('Flowers, Gifts and Crafts'),
+ 11 => $this->l('Food and beverage'),
+ 12 => $this->l('HiFi, Photo and Video'),
+ 13 => $this->l('Home and Garden'),
+ 14 => $this->l('Home Appliances'),
+ 15 => $this->l('Jewelry'),
+ 16 => $this->l('Mobile and Telecom'),
+ 17 => $this->l('Services'),
+ 18 => $this->l('Shoes and accessories'),
+ 19 => $this->l('Sports and Entertainment'),
+ 20 => $this->l('Travel'),
);
- sort($list_activities);
+
+ asort($list_activities);
$this->list_activities = $list_activities;
// Countries list
diff --git a/install-dev/controllers/http/process.php b/install-dev/controllers/http/process.php
index 047a84370..f9d98996f 100644
--- a/install-dev/controllers/http/process.php
+++ b/install-dev/controllers/http/process.php
@@ -331,8 +331,6 @@ class InstallControllerHttpProcess extends InstallControllerHttp
*/
public function display()
{
- $this->initializeContext();
-
// The installer SHOULD take less than 32M, but may take up to 35/36M sometimes. So 42M is a good value :)
$low_memory = Tools::getMemoryLimit() < Tools::getOctets('42M');
@@ -361,8 +359,15 @@ class InstallControllerHttpProcess extends InstallControllerHttp
$this->process_steps[] = $install_modules;
$install_modules = array('key' => 'installModulesAddons', 'lang' => $this->l('Install modules Addons'));
+
+ $params = array('iso_lang' => $this->language->getLanguageIso(),
+ 'iso_country' => $this->session->shop_country,
+ 'email' => $this->session->admin_email,
+ 'shop_url' => Tools::getHttpHost(),
+ 'version' => _PS_INSTALL_VERSION_);
+
if ($low_memory)
- foreach ($this->model_install->getAddonsModulesList() as $module)
+ foreach ($this->model_install->getAddonsModulesList($params) as $module)
$install_modules['subtasks'][] = array('module' => (string)$module['name'], 'id_module' => (string)$module['id_module']);
$this->process_steps[] = $install_modules;
diff --git a/install-dev/models/install.php b/install-dev/models/install.php
index f450ddc40..ca62908fc 100644
--- a/install-dev/models/install.php
+++ b/install-dev/models/install.php
@@ -557,7 +557,6 @@ class InstallModelInstall extends InstallAbstractModel
'graphvisifire',
'graphxmlswfcharts',
'gridhtml',
- 'gsitemap',
'homefeatured',
'homeslider',
'pagesnotfound',
@@ -588,10 +587,10 @@ class InstallModelInstall extends InstallAbstractModel
return $modules;
}
- public function getAddonsModulesList()
+ public function getAddonsModulesList($params = array())
{
$addons_modules = array();
- $content = Tools::addonsRequest('install-modules');
+ $content = Tools::addonsRequest('install-modules', $params);
$xml = @simplexml_load_string($content, null, LIBXML_NOCDATA);
if ($xml !== false and isset($xml->module))
diff --git a/install-dev/theme/views/configure.phtml b/install-dev/theme/views/configure.phtml
index ff9b6f95c..c67b110e7 100644
--- a/install-dev/theme/views/configure.phtml
+++ b/install-dev/theme/views/configure.phtml
@@ -26,7 +26,7 @@ var default_iso = 'session->shop_country ?>';
diff --git a/install-dev/upgrade/php/add_column_orders_reference_if_not_exists.php b/install-dev/upgrade/php/add_column_orders_reference_if_not_exists.php
index 5088f1ca7..3a5676e63 100644
--- a/install-dev/upgrade/php/add_column_orders_reference_if_not_exists.php
+++ b/install-dev/upgrade/php/add_column_orders_reference_if_not_exists.php
@@ -28,5 +28,5 @@ function add_column_orders_reference_if_not_exists()
{
$column = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'orders` LIKE "reference"');
if (empty($column))
- return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'orders` ADD COLUMN `reference` varchar(9) AFTER `id_order`');
+ return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'orders` ADD COLUMN `reference` varchar(10) AFTER `id_order`');
}
diff --git a/install-dev/upgrade/php/block_category_1521.php b/install-dev/upgrade/php/block_category_1521.php
index fe7c6825b..c6b1846f7 100644
--- a/install-dev/upgrade/php/block_category_1521.php
+++ b/install-dev/upgrade/php/block_category_1521.php
@@ -26,11 +26,11 @@
function block_category_1521()
{
- if (!Db::getInstance()->ExecuteS('SELECT `'._DB_PREFIX_.'configuration` WHERE `name`=\'BLOCK_CATEG_MAX_DEPTH\' '))
+ if (!Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\' '))
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'configuration`
(`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`)
- VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 2, NOW(), NOW())');
- else if (Db::getInstance()->ExecuteS('SELECT `'._DB_PREFIX_.'configuration` WHERE and `value` IS NOT NULL AND `value` <> 0'))
- Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = 2 WHERE `name`=\'BLOCK_CATEG_MAX_DEPTH\' ');
+ VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 4, NOW(), NOW())');
+ else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0'))
+ Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE\'BLOCK_CATEG_MAX_DEPTH\'');
}
\ No newline at end of file
diff --git a/install-dev/upgrade/php/update_order_messages.php b/install-dev/upgrade/php/update_order_messages.php
index 357f2449f..369b753d5 100644
--- a/install-dev/upgrade/php/update_order_messages.php
+++ b/install-dev/upgrade/php/update_order_messages.php
@@ -33,42 +33,38 @@ function update_order_messages()
$nb_loop = ceil($count_messages / $step);
for($i = 0; $i < $nb_loop; $i++)
{
- $sql = 'SELECT id_message, message FROM '._DB_PREFIX_.'message LIMIT '.(int)$start.', '.(int)$step;
- if ($messages = Db::getInstance()->executeS($sql))
- {
- if(is_array($messages))
- foreach($messages as $message)
+ $sql = 'SELECT id_message, message FROM `'._DB_PREFIX_.'message` WHERE message REGEXP \'
query($sql))
+ while ($message = Db::getInstance()->nextRow($messages))
+ {
+ if(is_array($message))
{
- $sql = 'UPDATE '._DB_PREFIX_.'message SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(br2nl($message['message']))).'\'
+ $sql = 'UPDATE `'._DB_PREFIX_.'message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(br2nl($message['message']))).'\'
WHERE id_message = '.(int)$message['id_message'];
$result = Db::getInstance()->execute($sql);
}
- $start += ($step + 1);
- }
+ }
}
-
- $count_messages = Db::getInstance()->getValue('SELECT count(id_customer_message) FROM '._DB_PREFIX_.'customer_message');
$nb_loop = $start = 0;
if($count_messages > 0)
$nb_loop = ceil($count_messages / $step);
for($i = 0; $i < $nb_loop; $i++)
{
- $sql = 'SELECT id_customer_message, message FROM '._DB_PREFIX_.'customer_message LIMIT '.(int)$start.', '.(int)$step;
- if ($messages = Db::getInstance()->executeS($sql))
- {
- if(is_array($messages))
- foreach($messages as $message)
- {
- $sql = 'UPDATE '._DB_PREFIX_.'customer_message SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(str_replace('&', '&', $message['message']))).'\'
+ $sql = 'SELECT id_customer_message, message FROM `'._DB_PREFIX_.'customer_message` WHERE message REGEXP \'
query($sql))
+ while ($message = Db::getInstance()->nextRow($messages))
+ {
+ if(is_array($message))
+ {
+ $sql = 'UPDATE `'._DB_PREFIX_.'customer_message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(str_replace('&', '&', $message['message']))).'\'
WHERE id_customer_message = '.(int)$message['id_customer_message'];
Db::getInstance()->execute($sql);
}
- $start += ($step + 1);
- }
+ }
}
}
function br2nl($str)
{
- return preg_replace("/
/i", "\n", $str);
+ return str_replace(array('
', '
', '
'), "\n", $str);
}
\ No newline at end of file
diff --git a/install-dev/upgrade/sql/1.5.0.13.sql b/install-dev/upgrade/sql/1.5.0.13.sql
index 65121283c..c89ae965e 100644
--- a/install-dev/upgrade/sql/1.5.0.13.sql
+++ b/install-dev/upgrade/sql/1.5.0.13.sql
@@ -23,7 +23,7 @@ INSERT INTO `PREFIX_order_invoice_payment`
-- Step 2: Add the collumn id_order_reference
ALTER TABLE `PREFIX_order_payment`
- ADD COLUMN `order_reference` VARCHAR(9) AFTER `id_order`,
+ ADD COLUMN `order_reference` VARCHAR(10) AFTER `id_order`,
ADD INDEX `order_reference`(`order_reference`);
diff --git a/install-dev/upgrade/sql/1.5.4.1.sql b/install-dev/upgrade/sql/1.5.4.1.sql
index ea631f817..4d6f37c0e 100644
--- a/install-dev/upgrade/sql/1.5.4.1.sql
+++ b/install-dev/upgrade/sql/1.5.4.1.sql
@@ -1,3 +1,11 @@
SET NAMES 'utf8';
-ALTER TABLE `PREFIX_carrier` CHANGE `max_weight` `max_weight` DECIMAL( 20, 6 ) NULL DEFAULT '0';
\ No newline at end of file
+ALTER TABLE `PREFIX_carrier` CHANGE `max_weight` `max_weight` DECIMAL( 20, 6 ) NULL DEFAULT '0';
+
+DELETE ms.*, hm.* FROM `PREFIX_module_shop` ms INNER JOIN `PREFIX_hook_module` hm USING (`id_module`) INNER JOIN `PREFIX_module` m USING (`id_module`) WHERE m.`name` LIKE 'backwardcompatibility';
+
+UPDATE `PREFIX_module` SET `active` = 0 WHERE `name` LIKE 'backwardcompatibility';
+
+ALTER TABLE `PREFIX_orders` CHANGE `reference` `reference` VARCHAR( 10 ) NULL DEFAULT NULL;
+
+ALTER TABLE `PREFIX_order_payment` CHANGE `order_reference` `order_reference` VARCHAR( 10 ) NULL DEFAULT NULL;
\ No newline at end of file
diff --git a/js/jquery/plugins/jqzoom/jquery.jqzoom.js b/js/jquery/plugins/jqzoom/jquery.jqzoom.js
index 2e03940a7..d74f8dc1c 100755
--- a/js/jquery/plugins/jqzoom/jquery.jqzoom.js
+++ b/js/jquery/plugins/jqzoom/jquery.jqzoom.js
@@ -31,9 +31,10 @@
var imageWidth = $(this).get(0).offsetWidth;
var imageHeight = $(this).get(0).offsetHeight;
- noalt = $(this).attr("alt");
+ attr = typeof($(this).attr("rel")) != 'undefined' ? "rel" : "alt";
+ noalt = $(this).attr(attr);
var bigimage = noalt;
- $(this).attr("alt", '');
+ $(this).attr(attr, '');
if($("div.zoomdiv").get().length == 0)
$(this).after("

");
@@ -67,7 +68,7 @@
$("div.zoomdiv").get(0).scrollLeft = (scrollx) * scalex ;
});
}, function() {
- $(this).attr("alt", noalt);
+ $(this).attr(attr, noalt);
$("div.zoomdiv").hide();
$(document.body).unbind("mousemove");
$(".lenszoom").remove();
diff --git a/modules/blockadvertising/config.xml b/modules/blockadvertising/config.xml
index 37f1f7221..62b227aae 100755
--- a/modules/blockadvertising/config.xml
+++ b/modules/blockadvertising/config.xml
@@ -1,9 +1,9 @@
blockadvertising
-
+
-
+
1
diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js
index 9c37e54ed..c42dc72cf 100644
--- a/modules/blockcart/ajax-cart.js
+++ b/modules/blockcart/ajax-cart.js
@@ -449,8 +449,8 @@ var ajaxCart = {
content += ' ';
else
content += '';
- if (typeof(freeShippingTranslation) != 'undefined')
- content += '' + (parseFloat(this.price_float) > 0 ? this.priceByLine : freeShippingTranslation) + '';
+ if (typeof(freeProductTranslation) != 'undefined')
+ content += '' + (parseFloat(this.price_float) > 0 ? this.priceByLine : freeProductTranslation) + '';
content += '';
if (this.hasAttributes)
content += '' + this.attributes + '';
diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl
index 45a74566a..051bcf39e 100644
--- a/modules/blockcart/blockcart.tpl
+++ b/modules/blockcart/blockcart.tpl
@@ -116,8 +116,7 @@ var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
{/if}
{l s='No products' mod='blockcart'}
- {if $discounts|@count > 0}
-
+
{foreach from=$discounts item=discount}
{if $discount.value_real > 0}
@@ -132,11 +131,9 @@ var delete_txt = '{l s='Delete' mod='blockcart' js=1}';
{/if}
- {/foreach}
+ {/foreach}
- {/if}
-
{$shipping_cost}
{l s='Shipping' mod='blockcart'}
diff --git a/modules/blockcategories/blockcategories.php b/modules/blockcategories/blockcategories.php
index 767ad74f0..bdaca904e 100644
--- a/modules/blockcategories/blockcategories.php
+++ b/modules/blockcategories/blockcategories.php
@@ -227,7 +227,7 @@ class BlockCategories extends Module
$id_product = (int)Tools::getValue('id_product', 0);
$id_category = (int)Tools::getValue('id_category', 0);
$id_lang = (int)$this->context->language->id;
- return 'blockcategories|'.$this->context->shop->id.'|'.$groups.'|'.$id_lang.'|'.$id_product.'|'.$id_category;
+ return 'blockcategories|'.(int)Tools::usingSecureMode().'|'.$this->context->shop->id.'|'.$groups.'|'.$id_lang.'|'.$id_product.'|'.$id_category;
}
public function hookFooter($params)
diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php
index 304bfb963..6b2dc1bd5 100644
--- a/modules/blocknewsletter/blocknewsletter.php
+++ b/modules/blocknewsletter/blocknewsletter.php
@@ -509,7 +509,7 @@ class Blocknewsletter extends Module
public function hookDisplayLeftColumn($params)
{
$this->_prepareHook($params);
- return $this->display(__FILE__, 'blocknewsletter.tpl', $this->getCacheId());
+ return $this->display(__FILE__, 'blocknewsletter.tpl');
}
public function hookFooter($params)
diff --git a/modules/blocknewsletter/mails/en/newsletter_voucher.html b/modules/blocknewsletter/mails/en/newsletter_voucher.html
index 1dc23f065..12b2b6513 100644
--- a/modules/blocknewsletter/mails/en/newsletter_voucher.html
+++ b/modules/blocknewsletter/mails/en/newsletter_voucher.html
@@ -20,7 +20,7 @@
|
-| Newsletter subscription |
+Newsletter subscription |
| |
@@ -32,7 +32,7 @@
|
-| {shop_name} powered by PrestaShop™ |
+{shop_name} powered by PrestaShop™ |
diff --git a/modules/blocksearch/blocksearch.php b/modules/blocksearch/blocksearch.php
index 1df62a660..48d1a70c1 100644
--- a/modules/blocksearch/blocksearch.php
+++ b/modules/blocksearch/blocksearch.php
@@ -117,11 +117,5 @@ public function hookDisplayMobileHeader($params)
return true;
}
-
- protected function getCacheId($name = null)
- {
- $cache_id = parent::getCacheId($name);
- return $cache_id.'|'.(int)Tools::usingSecureMode();
- }
}
diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php
index 25f34e570..a47f6cc35 100644
--- a/modules/blocktopmenu/blocktopmenu.php
+++ b/modules/blocktopmenu/blocktopmenu.php
@@ -89,15 +89,15 @@ class Blocktopmenu extends Module
return (Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'linksmenutop` (
`id_linksmenutop` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
- `id_shop` INT UNSIGNED NOT NULL,
+ `id_shop` INT(11) UNSIGNED NOT NULL,
`new_window` TINYINT( 1 ) NOT NULL,
INDEX (`id_shop`)
) ENGINE = '._MYSQL_ENGINE_.' CHARACTER SET utf8 COLLATE utf8_general_ci;') &&
Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'linksmenutop_lang` (
- `id_linksmenutop` INT NOT NULL,
- `id_lang` INT NOT NULL,
- `id_shop` INT NOT NULL,
+ `id_linksmenutop` INT(11) UNSIGNED NOT NULL,
+ `id_lang` INT(11) UNSIGNED NOT NULL,
+ `id_shop` INT(11) UNSIGNED NOT NULL,
`label` VARCHAR( 128 ) NOT NULL ,
`link` VARCHAR( 128 ) NOT NULL ,
INDEX ( `id_linksmenutop` , `id_lang`, `id_shop`)
@@ -717,7 +717,7 @@ class Blocktopmenu extends Module
{
parent::getCacheId($name);
$page_name = in_array($this->page_name, array('category', 'supplier', 'manufacturer', 'cms', 'product')) ? $this->page_name : 'index';
- return 'blocktopmenu|'.$page_name.'|'.(int)$this->context->shop->id.'|'.implode(', ',$this->user_groups).'|'.(int)$this->context->language->id.'|'.(int)Tools::getValue('id_category').'|'.(int)Tools::getValue('id_manufacturer').'|'.(int)Tools::getValue('id_supplier').'|'.(int)Tools::getValue('id_cms').'|'.(int)Tools::getValue('id_product');
+ return 'blocktopmenu|'.(int)Tools::usingSecureMode().'|'.$page_name.'|'.(int)$this->context->shop->id.'|'.implode(', ',$this->user_groups).'|'.(int)$this->context->language->id.'|'.(int)Tools::getValue('id_category').'|'.(int)Tools::getValue('id_manufacturer').'|'.(int)Tools::getValue('id_supplier').'|'.(int)Tools::getValue('id_cms').'|'.(int)Tools::getValue('id_product');
}
public function hookDisplayTop($param)
diff --git a/modules/blockwishlist/mails/en/wishlink.html b/modules/blockwishlist/mails/en/wishlink.html
index 6089277f2..d82bfb660 100644
--- a/modules/blockwishlist/mails/en/wishlink.html
+++ b/modules/blockwishlist/mails/en/wishlink.html
@@ -20,7 +20,7 @@
|
-| Message from {shop_name} |
+Message from {shop_name} |
| |
@@ -32,7 +32,7 @@
|
-| {shop_name} realised with PrestaShop™ |
+{shop_name} realised with PrestaShop™ |
diff --git a/modules/blockwishlist/mails/en/wishlist.html b/modules/blockwishlist/mails/en/wishlist.html
index 1deb338c9..6678d8224 100644
--- a/modules/blockwishlist/mails/en/wishlist.html
+++ b/modules/blockwishlist/mails/en/wishlist.html
@@ -20,7 +20,7 @@
|
-| Message from {shop_name} |
+Message from {shop_name} |
| |
@@ -32,7 +32,7 @@
|
-| {shop_name} Powered by PrestaShop™ |
+{shop_name} Powered by PrestaShop™ |
diff --git a/modules/followup/mails/en/followup_1.html b/modules/followup/mails/en/followup_1.html
index b49fce7bf..d6518515b 100644
--- a/modules/followup/mails/en/followup_1.html
+++ b/modules/followup/mails/en/followup_1.html
@@ -14,13 +14,13 @@
|
-| Hi {firstname} {lastname}, |
+Hi {firstname} {lastname}, |
| |
-| Your cart at {shop_name} |
+Your cart at {shop_name} |
| |
@@ -38,7 +38,7 @@
|
-| {shop_name} powered with PrestaShop™ |
+{shop_name} powered with PrestaShop™ |
diff --git a/modules/followup/mails/en/followup_2.html b/modules/followup/mails/en/followup_2.html
index 8047b701b..963414077 100644
--- a/modules/followup/mails/en/followup_2.html
+++ b/modules/followup/mails/en/followup_2.html
@@ -14,13 +14,13 @@
|
-| Hi {firstname} {lastname}, |
+Hi {firstname} {lastname}, |
| |
-| Thank you for your order at {shop_name} |
+Thank you for your order at {shop_name} |
| |
@@ -38,7 +38,7 @@
|
-| {shop_name} powered with PrestaShop™ |
+{shop_name} powered with PrestaShop™ |
diff --git a/modules/followup/mails/en/followup_3.html b/modules/followup/mails/en/followup_3.html
index 7b0a818cc..f6d033240 100644
--- a/modules/followup/mails/en/followup_3.html
+++ b/modules/followup/mails/en/followup_3.html
@@ -14,13 +14,13 @@
|
-| Hi {firstname} {lastname}, |
+Hi {firstname} {lastname}, |
| |
-| Thanks for your trust |
+Thanks for your trust |
| |
@@ -38,7 +38,7 @@
|
-| {shop_name} powered with PrestaShop™ |
+{shop_name} powered with PrestaShop™ |
diff --git a/modules/followup/mails/en/followup_4.html b/modules/followup/mails/en/followup_4.html
index ac793ea83..ff59cd920 100644
--- a/modules/followup/mails/en/followup_4.html
+++ b/modules/followup/mails/en/followup_4.html
@@ -14,13 +14,13 @@
|
-| Hi {firstname} {lastname}, |
+Hi {firstname} {lastname}, |
| |
-| Your cart at {shop_name} |
+Your cart at {shop_name} |
| |
@@ -38,7 +38,7 @@
|
-| {shop_name} powered with PrestaShop™ |
+{shop_name} powered with PrestaShop™ |
diff --git a/modules/gsitemap/config.xml b/modules/gsitemap/config.xml
deleted file mode 100755
index 8cb6e8b39..000000000
--- a/modules/gsitemap/config.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- gsitemap
-
-
-
-
-
- 1
- 0
-
-
\ No newline at end of file
diff --git a/modules/gsitemap/gsitemap-cron.php b/modules/gsitemap/gsitemap-cron.php
deleted file mode 100755
index e8ae96de2..000000000
--- a/modules/gsitemap/gsitemap-cron.php
+++ /dev/null
@@ -1,19 +0,0 @@
-link = new Link();
-
-echo $gsitemap->generateSitemapIndex();
\ No newline at end of file
diff --git a/modules/gsitemap/gsitemap.php b/modules/gsitemap/gsitemap.php
deleted file mode 100644
index c0a747e31..000000000
--- a/modules/gsitemap/gsitemap.php
+++ /dev/null
@@ -1,460 +0,0 @@
-
-* @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 (!defined('_PS_VERSION_'))
- exit;
-
-class Gsitemap extends Module
-{
- private $_html = '';
- private $_postErrors = array();
-
- public function __construct()
- {
- $this->name = 'gsitemap';
- $this->tab = 'seo';
- $this->version = '1.9';
- $this->author = 'PrestaShop';
- $this->need_instance = 0;
-
- parent::__construct();
-
- $this->displayName = $this->l('Google sitemap');
- $this->description = $this->l('Generate your Google sitemap file.');
-
- if (!defined('GSITEMAP_FILE'))
- define('GSITEMAP_FILE', dirname(__FILE__).'/../../sitemap.xml');
- }
-
- public function uninstall()
- {
- file_put_contents(GSITEMAP_FILE, '');
- return parent::uninstall();
- }
-
- private function _postValidation()
- {
- file_put_contents(GSITEMAP_FILE, '');
- if (!($fp = fopen(GSITEMAP_FILE, 'w')))
- $this->_postErrors[] = sprintf($this->l('Cannot create %ssitemap.xml file..'), realpath(dirname(__FILE__.'/../..')).'/');
- else
- fclose($fp);
- }
-
- private function getUrlWith($url, $key, $value)
- {
- if (empty($value))
- return $url;
- if (strpos($url, '?') !== false)
- return $url.'&'.$key.'='.$value;
- return $url.'?'.$key.'='.$value;
- }
-
- private function _postProcess()
- {
- Configuration::updateValue('GSITEMAP_ALL_CMS', (int)Tools::getValue('GSITEMAP_ALL_CMS'));
- Configuration::updateValue('GSITEMAP_ALL_PRODUCTS', (int)Tools::getValue('GSITEMAP_ALL_PRODUCTS'));
-
- if (Shop::isFeatureActive())
- $res = $this->generateSitemapIndex();
- else
- $res = $this->generateSitemap(Configuration::get('PS_SHOP_DEFAULT'), GSITEMAP_FILE);
-
- $this->_html .= '';
- $this->_html .= $res ? $this->l('Sitemap file generated.') : $this->l('Error while creating sitemap file.');
- $this->_html .= '
';
- }
-
- /**
- * Generate sitemap index to reference the sitemap of each shop
- *
- * @return bool
- */
- public function generateSitemapIndex()
- {
- $xmlString = <<
-
-
-XML;
- $xml = new SimpleXMLElement($xmlString);
-
- $sql = 'SELECT s.id_shop, su.domain, su.domain_ssl, CONCAT(su.physical_uri, su.virtual_uri) as uri
- FROM '._DB_PREFIX_.'shop s
- INNER JOIN '._DB_PREFIX_.'shop_url su ON s.id_shop = su.id_shop AND su.main = 1
- WHERE s.active = 1
- AND s.deleted = 0
- AND su.active = 1';
- if (!$result = Db::getInstance()->executeS($sql))
- return false;
-
- $res = true;
- foreach ($result as $row)
- {
- $info = pathinfo(GSITEMAP_FILE);
- $filename = $info['filename'].'-'.$row['id_shop'].'.'.$info['extension'];
-
- $replaceUrl = array('http://'.$row['domain'].$row['uri'], ((Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$row['domain_ssl'].$row['uri']);
-
- $last = $this->generateSitemap($row['id_shop'], $info['dirname'].'/'.$filename, $replaceUrl);
- if ($last)
- {
- $this->_addSitemapIndexNode($xml, 'http://'.$row['domain'].(($row['uri']) ? $row['uri'] : '/').$filename, date('Y-m-d'));
- }
- $res &= $last;
- }
-
- $fp = fopen(GSITEMAP_FILE, 'w');
- fwrite($fp, $xml->asXML());
- fclose($fp);
-
- return $res && file_exists(GSITEMAP_FILE);
- }
-
- /**
- * Generate a sitemap for a shop
- *
- * @param int $id_shop
- * @param string $filename
- * @return bool
- */
- private function generateSitemap($id_shop, $filename = '', $replace_url = array())
- {
- $langs = Language::getLanguages();
- $shop = new Shop($id_shop);
- if (!$shop->id)
- return false;
-
- $xmlString = <<
-
-
-XML;
-
- $xml = new SimpleXMLElement($xmlString);
-
- if (Configuration::get('PS_REWRITING_SETTINGS') && count($langs) > 1)
- foreach($langs as $lang)
- {
- $this->_addSitemapNode($xml, Tools::getShopDomain(true, true).__PS_BASE_URI__.$lang['iso_code'].'/', '1.00', 'daily', date('Y-m-d'));
- }
- else
- $this->_addSitemapNode($xml, Tools::getShopDomain(true, true).__PS_BASE_URI__, '1.00', 'daily', date('Y-m-d'));
-
- /* Product Generator */
- $sql = 'SELECT p.id_product, pl.link_rewrite, DATE_FORMAT(IF(ps.date_upd,ps.date_upd,ps.date_add), \'%Y-%m-%d\') date_upd, pl.id_lang, cl.`link_rewrite` category, ean13, i.id_image, il.legend legend_image, (
- SELECT MIN(level_depth)
- FROM '._DB_PREFIX_.'product p2
- '.Shop::addSqlAssociation('product', 'p2').'
- LEFT JOIN '._DB_PREFIX_.'category_product cp2 ON p2.id_product = cp2.id_product
- LEFT JOIN '._DB_PREFIX_.'category c2 ON cp2.id_category = c2.id_category
- WHERE p2.id_product = p.id_product AND product_shop.`active` = 1 AND c2.`active` = 1) AS level_depth
- FROM '._DB_PREFIX_.'product p
- LEFT JOIN '._DB_PREFIX_.'product_shop ps ON (ps.id_product = p.id_product AND ps.id_shop = '.(int)$id_shop.')
- LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (p.id_product = pl.id_product)
- LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (ps.id_category_default = cl.id_category AND pl.id_lang = cl.id_lang AND cl.id_shop = '.(int)$id_shop.')
- LEFT JOIN '._DB_PREFIX_.'image i ON p.id_product = i.id_product
- LEFT JOIN '._DB_PREFIX_.'image_lang il ON (i.id_image = il.id_image)
- LEFT JOIN '._DB_PREFIX_.'lang l ON (pl.id_lang = l.id_lang)
- WHERE l.`active` = 1
- AND ps.`active` = 1
- AND ps.id_shop = '.(int)$id_shop.'
- '.(Configuration::get('GSITEMAP_ALL_PRODUCTS') ? '' : 'HAVING level_depth IS NOT NULL').'
- ORDER BY pl.id_product, pl.id_lang ASC';
-
- $resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->query($sql);
-
- // array used to know which product/image was already added (blacklist)
- $done = null;
- $sitemap = null;
-
- // iterates on the products, to gather the image ids
- while ($product = Db::getInstance()->nextRow($resource))
- {
- // if the product has not been added
- $id_product = $product['id_product'];
- if (!isset($done[$id_product]['added']))
- {
- // priority
- if (($priority = 0.7 - ($product['level_depth'] / 10)) < 0.1)
- $priority = 0.1;
-
- // adds the product
- $tmpLink = $this->context->link->getProductLink((int)($product['id_product']), $product['link_rewrite'], $product['category'], $product['ean13'], (int)($product['id_lang']));
- $sitemap = $this->_addSitemapNode($xml, $tmpLink, $priority, 'weekly', substr($product['date_upd'], 0, 10));
-
- // considers the product has added
- $done[$id_product]['added'] = true;
- }
-
- // if the image has not been added
- $id_image = $product['id_image'];
- if (!isset($done[$id_product][$id_image]) && $id_image)
- {
- // adds the image
- $this->_addSitemapNodeImage($sitemap, $product);
-
- // considers the image as added
- $done[$id_product][$id_image] = true;
- }
- }
-
- /* Categories Generator */
- if (Configuration::get('PS_REWRITING_SETTINGS'))
- $categories = Db::getInstance()->executeS('
- SELECT c.id_category, c.level_depth, link_rewrite, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') AS date_upd, cl.id_lang
- FROM '._DB_PREFIX_.'category c
- LEFT JOIN '._DB_PREFIX_.'category_lang cl ON c.id_category = cl.id_category
- LEFT JOIN '._DB_PREFIX_.'lang l ON cl.id_lang = l.id_lang
- WHERE l.`active` = 1 AND c.`active` = 1 AND c.id_category != 1
- ORDER BY cl.id_category, cl.id_lang ASC');
- else
- $categories = Db::getInstance()->executeS(
- 'SELECT c.id_category, c.level_depth, DATE_FORMAT(IF(date_upd,date_upd,date_add), \'%Y-%m-%d\') AS date_upd
- FROM '._DB_PREFIX_.'category c
- ORDER BY c.id_category ASC');
-
-
- foreach($categories as $category)
- {
- if (($priority = 0.9 - ($category['level_depth'] / 10)) < 0.1)
- $priority = 0.1;
-
- $tmpLink = Configuration::get('PS_REWRITING_SETTINGS') ?
- $this->context->link->getCategoryLink((int)$category['id_category'], $category['link_rewrite'], (int)$category['id_lang'])
- : $this->context->link->getCategoryLink((int)$category['id_category']);
- $this->_addSitemapNode($xml, htmlspecialchars($tmpLink), $priority, 'weekly', substr($category['date_upd'], 0, 10));
- }
-
- /* CMS Generator */
- if (Configuration::get('GSITEMAP_ALL_CMS') || !Module::isInstalled('blockcms'))
- $sql_cms = '
- SELECT DISTINCT '.(Configuration::get('PS_REWRITING_SETTINGS') ? 'cl.id_cms, cl.link_rewrite, cl.id_lang' : 'cl.id_cms').
- ' FROM '._DB_PREFIX_.'cms_lang cl
- LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang)
- WHERE l.`active` = 1
- ORDER BY cl.id_cms, cl.id_lang ASC';
- else if (Module::isInstalled('blockcms'))
- $sql_cms = '
- SELECT DISTINCT '.(Configuration::get('PS_REWRITING_SETTINGS') ? 'cl.id_cms, cl.link_rewrite, cl.id_lang' : 'cl.id_cms').
- ' FROM '._DB_PREFIX_.'cms_block_page b
- LEFT JOIN '._DB_PREFIX_.'cms_lang cl ON (b.id_cms = cl.id_cms)
- LEFT JOIN '._DB_PREFIX_.'lang l ON (cl.id_lang = l.id_lang)
- WHERE l.`active` = 1
- ORDER BY cl.id_cms, cl.id_lang ASC';
-
- $cmss = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql_cms);
- foreach($cmss as $cms)
- {
- $tmpLink = Configuration::get('PS_REWRITING_SETTINGS') ?
- $this->context->link->getCMSLink((int)$cms['id_cms'], $cms['link_rewrite'], false, (int)$cms['id_lang'])
- : $this->context->link->getCMSLink((int)$cms['id_cms']);
- $this->_addSitemapNode($xml, $tmpLink, '0.8', 'daily');
- }
-
- /* Add classic pages (contact, best sales, new products...) */
- $pages = array(
- 'supplier' => false,
- 'manufacturer' => false,
- 'new-products' => false,
- 'prices-drop' => false,
- 'stores' => false,
- 'authentication' => true,
- 'best-sales' => false,
- 'contact-form' => true);
-
- // Don't show suppliers and manufacturers if they are disallowed
- if (!Module::getInstanceByName('blockmanufacturer')->id && !Configuration::get('PS_DISPLAY_SUPPLIERS'))
- unset($pages['manufacturer']);
-
- if (!Module::getInstanceByName('blocksupplier')->id && !Configuration::get('PS_DISPLAY_SUPPLIERS'))
- unset($pages['supplier']);
-
- // Generate nodes for pages
- if(Configuration::get('PS_REWRITING_SETTINGS'))
- foreach ($pages as $page => $ssl)
- foreach($langs as $lang)
- $this->_addSitemapNode($xml, $this->context->link->getPageLink($page, $ssl, $lang['id_lang']), '0.5', 'monthly');
- else
- foreach($pages as $page => $ssl)
- $this->_addSitemapNode($xml, $this->context->link->getPageLink($page, $ssl), '0.5', 'monthly');
-
- $xml_string = $xml->asXML();
-
- // Replace URL in XML strings by real shops URL
- if ($replace_url)
- $xml_string = str_replace(array(Tools::getShopDomain(true).__PS_BASE_URI__, Tools::getShopDomainSsl(true).__PS_BASE_URI__), $replace_url, $xml_string);
-
- $fp = fopen($filename, 'w');
- fwrite($fp, $xml_string);
- fclose($fp);
-
- return file_exists($filename);
- }
-
- private function _addSitemapIndexNode($xml, $loc, $last_mod)
- {
- $sitemap = $xml->addChild('sitemap');
- $sitemap->addChild('loc', htmlspecialchars($loc));
- $sitemap->addChild('lastmod', $last_mod);
- return $sitemap;
- }
-
- private function _addSitemapNode($xml, $loc, $priority, $change_freq, $last_mod = NULL)
- {
- $sitemap = $xml->addChild('url');
- $sitemap->addChild('loc', htmlspecialchars($loc));
- $sitemap->addChild('priority', number_format($priority,1,'.',''));
- if ($last_mod)
- $sitemap->addChild('lastmod', $last_mod);
- $sitemap->addChild('changefreq', $change_freq);
- return $sitemap;
- }
-
- private function _addSitemapNodeImage($xml, $product)
- {
- $image = $xml->addChild('image', null, 'http://www.google.com/schemas/sitemap-image/1.1');
- $image->addChild('loc', htmlspecialchars($this->context->link->getImageLink($product['link_rewrite'], (int)$product['id_product'].'-'.(int)$product['id_image'])), 'http://www.google.com/schemas/sitemap-image/1.1');
-
- $legend_image = preg_replace('/(&+)/i', '&', $product['legend_image']);
- $image->addChild('caption', $legend_image, 'http://www.google.com/schemas/sitemap-image/1.1');
- $image->addChild('title', $legend_image, 'http://www.google.com/schemas/sitemap-image/1.1');
- }
-
- private function _displaySitemap()
- {
- if (Shop::isFeatureActive())
- {
- $sql = 'SELECT s.id_shop, su.domain, su.domain_ssl, CONCAT(su.physical_uri, su.virtual_uri) as uri
- FROM '._DB_PREFIX_.'shop s
- INNER JOIN '._DB_PREFIX_.'shop_url su ON s.id_shop = su.id_shop AND su.main = 1
- WHERE s.active = 1
- AND s.deleted = 0
- AND su.active = 1';
- if (!$result = Db::getInstance()->executeS($sql))
- return '';
-
- $this->_html .= ''.$this->l('Sitemap index').'
';
- $this->_html .= ''.$this->l('Your Google sitemap file is online at the following address:').'
- '.Tools::getShopDomain(true, true).__PS_BASE_URI__.'sitemap.xml
';
-
- $info = pathinfo(GSITEMAP_FILE);
- foreach ($result as $shop)
- {
- $filename = $info['dirname'].'/'.$info['filename'].'-'.$shop['id_shop'].'.'.$info['extension'];
- if (file_exists($filename) && filesize($filename))
- {
- $fp = fopen($filename, 'r');
- $fstat = fstat($fp);
- fclose($fp);
- $xml = simplexml_load_file($filename);
-
- $nbPages = count($xml->url);
- $sitemap_uri = 'http://'.$shop['domain'].$shop['uri'].$info['filename'].'-'.$shop['id_shop'].'.'.$info['extension'];
-
- $this->_html .= ''.$this->l('Sitemap for: ').$shop['domain'].$shop['uri'].'
';
- $this->_html .= ''.$this->l('Your Google sitemap file is online at the following address:').'
- '.$sitemap_uri.'
';
-
- $this->_html .= $this->l('Update:').' '.utf8_encode(strftime('%A %d %B %Y %H:%M:%S',$fstat['mtime'])).'
';
- $this->_html .= $this->l('Filesize:').' '.number_format(($fstat['size']*.000001), 3).'MB
';
- $this->_html .= $this->l('Indexed pages:').' '.$nbPages.'
';
- }
- }
- }
- elseif (file_exists(GSITEMAP_FILE) && filesize(GSITEMAP_FILE))
- {
- $fp = fopen(GSITEMAP_FILE, 'r');
- $fstat = fstat($fp);
- fclose($fp);
- $xml = simplexml_load_file(GSITEMAP_FILE);
-
- $nbPages = count($xml->url);
-
- $this->_html .= ''.$this->l('Your Google sitemap file is online at the following address:').'
- '.Tools::getShopDomain(true, true).__PS_BASE_URI__.'sitemap.xml
';
-
- $this->_html .= $this->l('Update:').' '.utf8_encode(strftime('%A %d %B %Y %H:%M:%S',$fstat['mtime'])).'
';
- $this->_html .= $this->l('Filesize:').' '.number_format(($fstat['size']*.000001), 3).'MB
';
- $this->_html .= $this->l('Indexed pages:').' '.$nbPages.'
';
- }
- }
-
- private function _displayForm()
- {
- if (Tools::usingSecureMode())
- $domain = Tools::getShopDomainSsl(true);
- else
- $domain = Tools::getShopDomain(true);
-
- $this->_html .= '
-
- '.$this->l('Use cron job to re-build the sitemap:').'
-
- '.$domain.__PS_BASE_URI__.'modules/gsitemap/gsitemap-cron.php?&token='.substr(Tools::encrypt('gsitemap/cron'),0,10).'&GSITEMAP_ALL_CMS='.((int)Configuration::get('GSITEMAP_ALL_CMS')).'&GSITEMAP_ALL_PRODUCTS='.((int)Configuration::get('GSITEMAP_ALL_PRODUCTS')).'
-
';
- }
-
- public function getContent()
- {
- if (Tools::isSubmit('btnSubmit'))
- {
- $this->_postValidation();
- if (!count($this->_postErrors))
- $this->_postProcess();
- else
- foreach ($this->_postErrors as $err)
- $this->_html .= ''.$err.'
';
- }
-
- $this->_html .= '
- ';
- return $this->_html;
- }
-
-}
-
diff --git a/modules/gsitemap/index.php b/modules/gsitemap/index.php
deleted file mode 100644
index 3f6561f72..000000000
--- a/modules/gsitemap/index.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-* @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
-*/
-
-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;
\ No newline at end of file
diff --git a/modules/gsitemap/logo.gif b/modules/gsitemap/logo.gif
deleted file mode 100644
index d24a14a90..000000000
Binary files a/modules/gsitemap/logo.gif and /dev/null differ
diff --git a/modules/gsitemap/logo.png b/modules/gsitemap/logo.png
deleted file mode 100755
index 21c29316c..000000000
Binary files a/modules/gsitemap/logo.png and /dev/null differ
diff --git a/modules/gsitemap/translations/index.php b/modules/gsitemap/translations/index.php
deleted file mode 100644
index 3f6561f72..000000000
--- a/modules/gsitemap/translations/index.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-* @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
-*/
-
-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;
\ No newline at end of file
diff --git a/modules/homefeatured/homefeatured.php b/modules/homefeatured/homefeatured.php
index bd68293cb..4567adfa1 100644
--- a/modules/homefeatured/homefeatured.php
+++ b/modules/homefeatured/homefeatured.php
@@ -80,7 +80,7 @@ class HomeFeatured extends Module
diff --git a/modules/mailalerts/mailalerts.php b/modules/mailalerts/mailalerts.php
index 4d8e0c105..20add47cc 100644
--- a/modules/mailalerts/mailalerts.php
+++ b/modules/mailalerts/mailalerts.php
@@ -339,11 +339,11 @@ class MailAlerts extends Module
'{delivery_block_txt}' => MailAlert::getFormatedAddress($delivery, "\n"),
'{invoice_block_txt}' => MailAlert::getFormatedAddress($invoice, "\n"),
'{delivery_block_html}' => MailAlert::getFormatedAddress($delivery, '
', array(
- 'firstname' => '%s',
- 'lastname' => '%s')),
+ 'firstname' => '%s',
+ 'lastname' => '%s')),
'{invoice_block_html}' => MailAlert::getFormatedAddress($invoice, '
', array(
- 'firstname' => '%s',
- 'lastname' => '%s')),
+ 'firstname' => '%s',
+ 'lastname' => '%s')),
'{delivery_company}' => $delivery->company,
'{delivery_firstname}' => $delivery->firstname,
'{delivery_lastname}' => $delivery->lastname,
diff --git a/modules/mailalerts/mails/en/customer_qty.html b/modules/mailalerts/mails/en/customer_qty.html
index e73641fcc..d2f03253b 100644
--- a/modules/mailalerts/mails/en/customer_qty.html
+++ b/modules/mailalerts/mails/en/customer_qty.html
@@ -14,7 +14,7 @@
|
-| {product} is now available. |
+{product} is now available. |
| |
@@ -26,7 +26,7 @@
|
-| {shop_name} powered with PrestaShop™ |
+{shop_name} powered with PrestaShop™ |
diff --git a/modules/mailalerts/mails/en/productcoverage.html b/modules/mailalerts/mails/en/productcoverage.html
index 328d9077e..1d709047c 100644
--- a/modules/mailalerts/mails/en/productcoverage.html
+++ b/modules/mailalerts/mails/en/productcoverage.html
@@ -14,19 +14,19 @@
|
-| {product} is almost out of stock. |
+{product} is almost out of stock. |
| |
-The stock cover is now less than the specified minimum of {warning_coverage}.
Current stock cover: {current_coverage}
|
+The stock cover is now less than the specified minimum of {warning_coverage}.
Current stock cover: {current_coverage}
|
| |
-| {shop_name} powered with PrestaShop™ |
+{shop_name} powered with PrestaShop™ |
diff --git a/modules/mailalerts/mails/en/productoutofstock.html b/modules/mailalerts/mails/en/productoutofstock.html
index 10858effd..73d26bee3 100644
--- a/modules/mailalerts/mails/en/productoutofstock.html
+++ b/modules/mailalerts/mails/en/productoutofstock.html
@@ -14,19 +14,19 @@
|
-| {product} is nearly out of stock. |
+{product} is nearly out of stock. |
| |
-The remaining stock is now less than the specified minimum of {last_qty}.
Remaining stock: {qty}
You are advised to open the product's admin Product Page in order to replenish your inventory. |
+The remaining stock is now less than the specified minimum of {last_qty}.
Remaining stock: {qty}
You are advised to open the product's admin Product Page in order to replenish your inventory. |
| |
-| {shop_name} powered with PrestaShop™ |
+{shop_name} powered with PrestaShop™ |
diff --git a/modules/pscleaner/pscleaner.php b/modules/pscleaner/pscleaner.php
index 353f82f4f..d091230fd 100644
--- a/modules/pscleaner/pscleaner.php
+++ b/modules/pscleaner/pscleaner.php
@@ -435,7 +435,7 @@ class PSCleaner extends Module
);
foreach ($tables as $table)
$db->execute('TRUNCATE TABLE `'._DB_PREFIX_.bqSQL($table).'`');
- $db->execute('DELETE FROM `'._DB_PREFIX_.'address` WHERE id_customer > 0');
+ $db->execute('DELETE FROM `'._DB_PREFIX_.'address` WHERE id_manufacturer > 0 OR id_supplier > 0 OR id_warehouse > 0');
Image::deleteAllImages(_PS_PROD_IMG_DIR_);
if (!file_exists(_PS_PROD_IMG_DIR_))
@@ -488,7 +488,7 @@ class PSCleaner extends Module
);
foreach ($tables as $table)
$db->execute('TRUNCATE TABLE `'._DB_PREFIX_.bqSQL($table).'`');
- $db->execute('DELETE FROM `'._DB_PREFIX_.'address` WHERE id_manufacturer > 0 OR id_supplier > 0');
+ $db->execute('DELETE FROM `'._DB_PREFIX_.'address` WHERE id_customer > 0');
break;
}
}
diff --git a/modules/referralprogram/mails/en/referralprogram-congratulations.html b/modules/referralprogram/mails/en/referralprogram-congratulations.html
index 89f865423..70c65c205 100644
--- a/modules/referralprogram/mails/en/referralprogram-congratulations.html
+++ b/modules/referralprogram/mails/en/referralprogram-congratulations.html
@@ -20,7 +20,7 @@
|
-| Your referred friend, {sponsored_firstname} {sponsored_lastname} has placed his or her first order on {shop_name}! |
+Your referred friend, {sponsored_firstname} {sponsored_lastname} has placed his or her first order on {shop_name}! |
| |
@@ -38,7 +38,7 @@
|
-| {shop_name} powered by PrestaShop™ |
+{shop_name} powered by PrestaShop™ |
diff --git a/modules/referralprogram/mails/en/referralprogram-invitation.html b/modules/referralprogram/mails/en/referralprogram-invitation.html
index 7d413cef7..667344a64 100644
--- a/modules/referralprogram/mails/en/referralprogram-invitation.html
+++ b/modules/referralprogram/mails/en/referralprogram-invitation.html
@@ -14,13 +14,13 @@
|
-| {firstname_friend} {lastname_friend}, join us! |
+{firstname_friend} {lastname_friend}, join us! |
| |
-| Your friend {firstname} {lastname} wants to refer you on {shop_name}! |
+Your friend {firstname} {lastname} wants to refer you on {shop_name}! |
| |
@@ -50,7 +50,7 @@
|
-| {shop_name} powered by PrestaShop™ |
+{shop_name} powered by PrestaShop™ |
diff --git a/modules/referralprogram/mails/en/referralprogram-voucher.html b/modules/referralprogram/mails/en/referralprogram-voucher.html
index 35022e89f..499e189f7 100644
--- a/modules/referralprogram/mails/en/referralprogram-voucher.html
+++ b/modules/referralprogram/mails/en/referralprogram-voucher.html
@@ -14,13 +14,13 @@
|
-| Hi {firstname} {lastname}, |
+Hi {firstname} {lastname}, |
| |
-| Referral Program |
+Referral Program |
| |
@@ -38,7 +38,7 @@
|
-| {shop_name} powered by PrestaShop™ |
+{shop_name} powered by PrestaShop™ |
diff --git a/modules/sendtoafriend/mails/en/send_to_a_friend.html b/modules/sendtoafriend/mails/en/send_to_a_friend.html
index c30593d5e..c14aa128e 100644
--- a/modules/sendtoafriend/mails/en/send_to_a_friend.html
+++ b/modules/sendtoafriend/mails/en/send_to_a_friend.html
@@ -14,13 +14,13 @@
|
-| Hi {name}, |
+Hi {name}, |
| |
-| {customer} has sent you a link to a product that (s)he thinks may interest you. |
+{customer} has sent you a link to a product that (s)he thinks may interest you. |
| |
@@ -32,7 +32,7 @@
|
-| {shop_name} powered with PrestaShop™ |
+{shop_name} powered with PrestaShop™ |
diff --git a/themes/default/address.tpl b/themes/default/address.tpl
index f193fec91..689440edd 100644
--- a/themes/default/address.tpl
+++ b/themes/default/address.tpl
@@ -220,7 +220,7 @@ $(function(){ldelim}
-
+
diff --git a/themes/default/authentication.tpl b/themes/default/authentication.tpl
index 0249bf084..d35447f6b 100644
--- a/themes/default/authentication.tpl
+++ b/themes/default/authentication.tpl
@@ -70,7 +70,7 @@ $(document).ready(function() {
{if !isset($email_create)}{l s='Log in'}{else}{l s='Create an account'}{/if}
-
+{if !isset($back) || $back != 'my-account'}{assign var='current_step' value='login'}{include file="$tpl_dir./order-steps.tpl"}{/if}
{include file="$tpl_dir./errors.tpl"}
{assign var='stateExist' value=false}
{if !isset($email_create)}
diff --git a/themes/default/css/global.css b/themes/default/css/global.css
index 7a5115d58..b5b23061e 100644
--- a/themes/default/css/global.css
+++ b/themes/default/css/global.css
@@ -20,6 +20,8 @@ sub{vertical-align:baseline}
legend{color:#000}
input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit}
input,button,textarea,select{font-size:100%}
+
+.ie7 input, .ie7 select{line-height:18px}
a {cursor:pointer}
.clearfix:before,
@@ -345,6 +347,8 @@ ul.footer_links li .icon {
#center_column .sortPagiBar p {padding:0;}
#center_column .sortPagiBar form {display:inline-block;}
+.ie7 #center_column .sortPagiBar form {display:inline;}
+
.sortPagiBar #productsSortForm {float:right;}
.sortPagiBar select#selectPrductSort {
margin:0 0 0 10px;
@@ -406,6 +410,10 @@ ul.pagination li.disabled span {color:#ccc}
#pagination_previous {float:left}
#pagination_next {float:right}
+
+.ie7 #pagination_previous,
+.ie7 #pagination_next {float:none}
+
#pagination_previous a, #pagination_previous span,
#pagination_next a, #pagination_next span {
padding:0 8px;
@@ -612,7 +620,6 @@ div.star_hover a, div.star a:hover { background-position: 0 -32px }
.idTabs {
list-style-type: none;
margin-top: 20px;
- padding:0 5px;
border-bottom: 8px solid #f7b900
}
ul.idTabs li {
diff --git a/themes/default/css/order-opc.css b/themes/default/css/order-opc.css
index 5209953f2..568ded610 100644
--- a/themes/default/css/order-opc.css
+++ b/themes/default/css/order-opc.css
@@ -87,4 +87,7 @@
float: right;
margin-right: 20px;
padding: 0;
+}
+#address_invoice_form {
+ padding: 0px;
}
\ No newline at end of file
diff --git a/themes/default/css/product.css b/themes/default/css/product.css
index 32994d266..35b563544 100644
--- a/themes/default/css/product.css
+++ b/themes/default/css/product.css
@@ -169,7 +169,7 @@ span.view_scroll_spacer {
text-align:right;
}
-.ie7 #pb-left-column #buy_block label {margin-right:5px}
+.ie7 #pb-left-column #buy_block label {margin-right:5px;float:left}
/* short description pack */
.short_description_pack {
@@ -196,7 +196,8 @@ span.view_scroll_spacer {
.ie7 #attributes .attribute_list {
display:inline;
- zoom:1
+ zoom:1;
+ float:right
}
#attributes .attribute_list ul{
diff --git a/themes/default/header.tpl b/themes/default/header.tpl
index eb374968c..6dbd39d3e 100644
--- a/themes/default/header.tpl
+++ b/themes/default/header.tpl
@@ -23,7 +23,7 @@
* International Registered Trademark & Property of PrestaShop SA
*}
-
+
diff --git a/themes/default/js/cart-summary.js b/themes/default/js/cart-summary.js
index d8f941195..c1c0ac3c7 100644
--- a/themes/default/js/cart-summary.js
+++ b/themes/default/js/cart-summary.js
@@ -201,8 +201,9 @@ function changeAddressDelivery(obj)
function updateAddressId(id_product, id_product_attribute, old_id_address_delivery, id_address_delivery, line)
{
+
if (typeof(line) == 'undefined' || line.length == 0)
- line = $('#product_' + id_product + '_' + id_product_attribute + '_0_' + old_id_address_delivery + ', #product_' + id_product + '_' + id_product_attribute + '_nocustom_' + old_id_address_delivery);
+ line = $('#cart_summary tr[id^=product_' + id_product + '_' + id_product_attribute + '_0_], #cart_summary tr[id^=product_' + id_product + '_' + id_product_attribute + '_nocustom_]');
$('.product_customization_for_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery).each(function(){
$(this).attr('id', $(this).attr('id').replace(/_\d+$/, '_' + id_address_delivery)).removeClass('product_customization_for_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery + ' address_' + old_id_address_delivery).addClass('product_customization_for_' + id_product + '_' + id_product_attribute + '_' + id_address_delivery + ' address_' + id_address_delivery);
@@ -654,9 +655,9 @@ function updateCartSummary(json)
location.reload();
if (priceDisplayMethod !== 0)
- $('#total_discount').html(formatCurrency(json.total_discounts_tax_exc, currencyFormat, currencySign, currencyBlank));
+ $('#total_discount').html('-' + formatCurrency(json.total_discounts_tax_exc, currencyFormat, currencySign, currencyBlank));
else
- $('#total_discount').html(formatCurrency(json.total_discounts, currencyFormat, currencySign, currencyBlank));
+ $('#total_discount').html('-' + formatCurrency(json.total_discounts, currencyFormat, currencySign, currencyBlank));
$('.cart_discount').each(function(){
var idElmt = $(this).attr('id').replace('cart_discount_','');
@@ -666,10 +667,12 @@ function updateCartSummary(json)
if (json.discounts[i].id_discount == idElmt)
{
if (json.discounts[i].value_real !== '!')
+ {
if (priceDisplayMethod !== 0)
$('#cart_discount_' + idElmt + ' td.cart_discount_price span.price-discount').html(formatCurrency(json.discounts[i].value_tax_exc * -1, currencyFormat, currencySign, currencyBlank));
else
$('#cart_discount_' + idElmt + ' td.cart_discount_price span.price-discount').html(formatCurrency(json.discounts[i].value_real * -1, currencyFormat, currencySign, currencyBlank));
+ }
toDelete = false;
}
if (toDelete)
diff --git a/themes/default/js/order-opc.js b/themes/default/js/order-opc.js
index 53d1e8f46..162f95553 100644
--- a/themes/default/js/order-opc.js
+++ b/themes/default/js/order-opc.js
@@ -265,6 +265,7 @@ function confirmFreeOrder()
else
$('#opc_account-overlay').fadeIn('slow');
$('#opc_delivery_methods-overlay, #opc_payment_methods-overlay').fadeOut('slow');
+ $('#confirmOrder').attr('disabled', 'disabled');
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
@@ -275,6 +276,7 @@ function confirmFreeOrder()
data: 'ajax=true&method=makeFreeOrder&token=' + static_token ,
success: function(html)
{
+ $('#confirmOrder').attr('disabled', '');
var array_split = html.split(':');
if (array_split[0] == 'freeorder')
{
@@ -401,7 +403,6 @@ function updateNewAccountToAddressBlock()
$.each(json.summary.products, function() {
updateAddressId(this.id_product, this.id_product_attribute, '0', this.id_address_delivery);
});
- updateCartSummary(json.summary);
updateAddressesDisplay(true);
updateCarrierList(json.carrier_data);
updateCarrierSelectionAndGift();
diff --git a/themes/default/js/product.js b/themes/default/js/product.js
index e97e7446c..7bae47cc0 100644
--- a/themes/default/js/product.js
+++ b/themes/default/js/product.js
@@ -295,17 +295,28 @@ function updateDisplay()
var priceTaxExclWithoutGroupReduction = '';
// retrieve price without group_reduction in order to compute the group reduction after
- // the specific price discount (done in the JS in order to keep backward compatibility)
- if (!displayPrice && !noTaxForThisProduct)
- {
- priceTaxExclWithoutGroupReduction = ps_round(productPriceTaxExcluded, 6) * (1 / group_reduction);
- } else {
- priceTaxExclWithoutGroupReduction = ps_round(productPriceTaxExcluded, 6) * (1 / group_reduction);
- }
- var combination_add_price = selectedCombination['price'] * group_reduction;
+ // the specific price discount (done in the JS in order to keep backward compatibility)
+ priceTaxExclWithoutGroupReduction = ps_round(productPriceTaxExcluded, 6) * (1 / group_reduction);
var tax = (taxRate / 100) + 1;
+ var taxExclPrice = priceTaxExclWithoutGroupReduction + (selectedCombination['price'] * currencyRate);
+ if (selectedCombination.specific_price && selectedCombination.specific_price['id_product_attribute'])
+ {
+ if (selectedCombination.specific_price['price'] && selectedCombination.specific_price['price'] >=0)
+ var taxExclPrice = (specific_currency ? selectedCombination.specific_price['price'] : selectedCombination.specific_price['price'] * currencyRate);
+ else
+ var taxExclPrice = productBasePriceTaxExcluded * currencyRate + (selectedCombination['price'] * currencyRate);
+ }
+ else if (product_specific_price.price && product_specific_price.price >= 0)
+ var taxExclPrice = (specific_currency ? product_specific_price.price : product_specific_price.price * currencyRate) + (selectedCombination['price'] * currencyRate);
+
+ if (!displayPrice && !noTaxForThisProduct)
+ productPriceDisplay = taxExclPrice * tax; // Need to be global => no var
+ else
+ productPriceDisplay = ps_round(taxExclPrice, 2); // Need to be global => no var
+
+ productPriceWithoutReductionDisplay = productPriceDisplay * group_reduction;
var reduction = 0;
if (selectedCombination['specific_price'].reduction_price || selectedCombination['specific_price'].reduction_percent)
{
@@ -313,18 +324,26 @@ function updateDisplay()
reduction = productPriceDisplay * (parseFloat(selectedCombination['specific_price'].reduction_percent) / 100) + reduction_price;
if (reduction_price && (displayPrice || noTaxForThisProduct))
reduction = ps_round(reduction / tax, 6);
+
}
- else if (product_specific_price.reduction_price || product_specific_price.reduction_percent)
+ else if (product_specific_price && product_specific_price.reduction)
{
- reduction_price = (specific_currency ? product_specific_price.reduction_price : product_specific_price.reduction_price * currencyRate);
- reduction = productPriceDisplay * (parseFloat(product_specific_price.reduction_percent) / 100) + reduction_price;
+ if (product_specific_price.reduction_type == 'amount')
+ reduction_price = (specific_currency ? product_specific_price.reduction : product_specific_price.reduction * currencyRate);
+ else
+ reduction_price = 0;
+
+ if (product_specific_price.reduction_type == 'percentage')
+ reduction_percent = productPriceDisplay * parseFloat(product_specific_price.reduction);
+
+ reduction = reduction_price + reduction_percent;
if (reduction_price && (displayPrice || noTaxForThisProduct))
reduction = ps_round(reduction / tax, 6);
}
if (selectedCombination.specific_price)
{
- if (selectedCombination['specific_price'].reduction_type == 'percentage')
+ if (selectedCombination['specific_price'] && selectedCombination['specific_price'].reduction_type == 'percentage')
{
$('#reduction_amount').hide();
$('#reduction_percent_display').html('-' + parseFloat(selectedCombination['specific_price'].reduction_percent) + '%');
@@ -338,36 +357,20 @@ function updateDisplay()
$('#reduction_amount').hide();
}
}
- else
- if (product_specific_price['reduction_type'] == 'percentage')
- $('#reduction_percent_display').html(product_specific_price['specific_price'].reduction_percent);
if (product_specific_price['reduction_type'] != '' || selectedCombination['specific_price'].reduction_type != '')
$('#discount_reduced_price,#old_price').show();
else
$('#discount_reduced_price,#old_price').hide();
-
- if (product_specific_price['reduction_type'] == 'percentage' || selectedCombination['specific_price'].reduction_type == 'percentage')
+ if ((product_specific_price['reduction_type'] == 'percentage' && selectedCombination['specific_price'].reduction_type == 'percentage') || selectedCombination['specific_price'].reduction_type == 'percentage')
$('#reduction_percent').show();
else
$('#reduction_percent').hide();
- if (product_specific_price['price'] || selectedCombination.specific_price['price'])
+ if (product_specific_price['price'] || (selectedCombination.specific_price && selectedCombination.specific_price['price']))
$('#not_impacted_by_discount').show();
else
$('#not_impacted_by_discount').hide();
- if (selectedCombination.specific_price['price'] && selectedCombination.specific_price['price'] >=0)
- var taxExclPrice = (specific_currency ? selectedCombination.specific_price['price'] : selectedCombination.specific_price['price'] * currencyRate);
- else
- var taxExclPrice = priceTaxExclWithoutGroupReduction + (selectedCombination['price'] * currencyRate);
-
- if (!displayPrice && !noTaxForThisProduct)
- productPriceDisplay = taxExclPrice * tax; // Need to be global => no var
- else
- productPriceDisplay = ps_round(taxExclPrice, 2); // Need to be global => no var
-
- productPriceWithoutReductionDisplay = productPriceDisplay * group_reduction;
-
productPriceDisplay -= reduction;
var tmp = productPriceDisplay * group_reduction;
productPriceDisplay = ps_round(productPriceDisplay * group_reduction, 2);
@@ -421,7 +424,7 @@ function displayImage(domAAroundImgThumb, no_animation)
{
$('#bigpic').attr('src', newSrc);
if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)
- $(this).attr('alt', domAAroundImgThumb.attr('href'));
+ $('#bigpic').attr('rel', domAAroundImgThumb.attr('href'));
}
$('#views_block li a').removeClass('shown');
$(domAAroundImgThumb).addClass('shown');
@@ -525,6 +528,7 @@ $(document).ready(function()
//set jqZoom parameters if needed
if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)
{
+ $('#bigpic').attr('rel', $('#bigpic').attr('src').replace('thickbox', 'large'));
$('img.jqzoom').jqueryzoom({
xzoom: 200, //zooming div default width(default width value is 200)
yzoom: 200, //zooming div default width(default height value is 200)
@@ -719,4 +723,4 @@ function checkUrl()
window.location = url.substring(0, url.indexOf('#'));
}
}
-}
\ No newline at end of file
+}
diff --git a/themes/default/mobile/authentication-choice.tpl b/themes/default/mobile/authentication-choice.tpl
index 4bbfb00bc..7d8346a4d 100644
--- a/themes/default/mobile/authentication-choice.tpl
+++ b/themes/default/mobile/authentication-choice.tpl
@@ -13,7 +13,7 @@
-