// added upgrade files (sql and php) in new installer
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12379 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
function add_accounting_tab()
|
||||
{
|
||||
$id_parent = add_new_tab(
|
||||
'AdminAccounting',
|
||||
'en:Accounting|fr:Comptabilité|es:Accounting|de:Accounting|it:Accounting',
|
||||
0,
|
||||
true);
|
||||
|
||||
add_new_tab(
|
||||
'AdminAccountingManagement',
|
||||
'en:Account Number Management|fr:Gestion des numéros de comptes|es:Account Number Management|de:Account Number Management|it:Account Number Management',
|
||||
$id_parent);
|
||||
|
||||
add_new_tab(
|
||||
'AdminAccountingExport',
|
||||
'en:Export|fr:Export|es:Export|de:Export|it:Export',
|
||||
$id_parent);
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function add_attribute_position()
|
||||
{
|
||||
$groups = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT `id_attribute_group`
|
||||
FROM `'._DB_PREFIX_.'attribute`');
|
||||
if (count($groups) && is_array($groups))
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
$attributes = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'attribute`
|
||||
WHERE `id_attribute_group` = '. (int)($group['id_attribute_group']));
|
||||
$i = 0;
|
||||
if (count($attributes) && is_array($attributes))
|
||||
foreach ($attributes as $attribute)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'attribute`
|
||||
SET `position` = '.$i++.'
|
||||
WHERE `id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
AND `id_attribute_group` = '.(int)$attribute['id_attribute_group']);
|
||||
}
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function add_carrier_position()
|
||||
{
|
||||
$carriers = Db::getInstance()->executeS('
|
||||
SELECT `id_carrier`
|
||||
FROM `'._DB_PREFIX_.'carrier`
|
||||
WHERE `deleted` = 0');
|
||||
if (count($carriers) && is_array($carriers))
|
||||
{
|
||||
$i = 0;
|
||||
foreach ($carriers as $carrier)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'carrier`
|
||||
SET `position` = '.$i++.'
|
||||
WHERE `id_carrier` = '.(int)$carrier['id_carrier']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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: 10056 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function add_default_restrictions_modules_groups()
|
||||
{
|
||||
$groups = Db::getInstance()->executeS('
|
||||
SELECT `id_group`
|
||||
FROM `'._DB_PREFIX_.'group`');
|
||||
$modules = Db::getInstance()->executeS('
|
||||
SELECT m.*
|
||||
FROM `'._DB_PREFIX_.'module` m');
|
||||
$shops = Db::getInstance()->executeS('
|
||||
SELECT `id_shop`
|
||||
FROM `'._DB_PREFIX_.'shop`');
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
if (!is_array($modules))
|
||||
return false;
|
||||
else
|
||||
{
|
||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'module_group` (`id_module`, `id_shop`, `id_group`) VALUES ';
|
||||
foreach ($modules as $mod)
|
||||
foreach ($shops as $s)
|
||||
$sql .= '("'.(int)$mod['id_module'].'", "'.(int)$s.'", "'.(int)$group['id_group'].'"),';
|
||||
// removing last comma to avoid SQL error
|
||||
$sql = substr($sql, 0, strlen($sql) - 1);
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function add_feature_position()
|
||||
{
|
||||
$features = Db::getInstance()->executeS('
|
||||
SELECT `id_feature`
|
||||
FROM `'._DB_PREFIX_.'feature`');
|
||||
$i = 0;
|
||||
if (sizeof($features) && is_array($features))
|
||||
foreach ($features as $feature)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'feature`
|
||||
SET `position` = '.$i++.'
|
||||
WHERE `id_feature` = '.(int)$feature['id_feature']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function add_group_attribute_position()
|
||||
{
|
||||
$groups = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'attribute_group`');
|
||||
$i = 0;
|
||||
if (sizeof($groups) && is_array($groups))
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'attribute_group`
|
||||
SET `position` = '.$i++.'
|
||||
WHERE `id_attribute_group` = '.(int)$group['id_attribute_group']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function add_missing_rewrite_value()
|
||||
{
|
||||
$pages = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'meta` m
|
||||
LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.`id_meta` = ml.`id_meta`)
|
||||
WHERE ml.`url_rewrite` = \'\'
|
||||
AND m.`page` != "index"
|
||||
');
|
||||
if (sizeof($pages) && is_array($pages))
|
||||
foreach ($pages as $page)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'meta_lang`
|
||||
SET `url_rewrite` = "'.pSQL(Tools::str2url($page['title'])).'"
|
||||
WHERE `id_meta` = '.(int)$page['id_meta'].'
|
||||
AND `id_lang` = '.(int)$page['id_lang']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function add_module_to_hook($module_name, $hook_name)
|
||||
{
|
||||
$result = false;
|
||||
|
||||
$id_module = Db::getInstance()->getValue('
|
||||
SELECT `id_module` FROM `'._DB_PREFIX_.'module`
|
||||
WHERE `name` = \''.pSQL($module_name).'\''
|
||||
);
|
||||
|
||||
if ((int)$id_module > 0)
|
||||
{
|
||||
$id_hook = Db::getInstance()->getValue('
|
||||
SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = \''.pSQL($hook_name).'\'
|
||||
');
|
||||
|
||||
if ((int)$id_hook > 0)
|
||||
{
|
||||
$result = Db::getInstance()->execute('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`)
|
||||
VALUES (
|
||||
'.(int)$id_module.',
|
||||
'.(int)$id_hook.',
|
||||
(SELECT IFNULL(
|
||||
(SELECT max_position from (SELECT MAX(position)+1 as max_position FROM `'._DB_PREFIX_.'hook_module` WHERE `id_hook` = '.(int)$id_hook.') AS max_position), 1))
|
||||
)');
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function add_new_groups($french, $standard)
|
||||
{
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'group` (`id_group`, `date_add`, `date_upd`) VALUES (NULL, NOW(), NOW())');
|
||||
$last_id = Db::getInstance()->Insert_ID();
|
||||
|
||||
$languages = Db::getInstance()->executeS('SELECT id_lang, iso_code FROM `'._DB_PREFIX_.'lang`');
|
||||
|
||||
$sql = '';
|
||||
foreach ($languages as $lang)
|
||||
if (strtolower($lang['iso_code']) == 'fr')
|
||||
$sql .= '('.(int)$last_id.', '.(int)$lang['id_lang'].', "'.pSQL($french).'"),';
|
||||
else
|
||||
$sql .= '('.(int)$last_id.', '.(int)$lang['id_lang'].', "'.pSQL($standard).'"),';
|
||||
$sql = substr($sql, 0, strlen($sql) - 1);
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'group_lang` (`id_group`, `id_lang`, `name`) VALUES '.$sql);
|
||||
// we add the different id_group in the configuration
|
||||
if (strtolower($standard) == 'unidentified')
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'configuration` (`id_configuration`, `name`, `value`, `date_add`, `date_upd`) VALUES (NULL, "PS_UNIDENTIFIED_GROUP", "'.(int)$last_id.'", NOW(), NOW())');
|
||||
else if (strtolower($standard) == 'guest')
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'configuration` (`id_configuration`, `name`, `value`, `date_add`, `date_upd`) VALUES (NULL, "PS_GUEST_GROUP", "'.(int)$last_id.'", NOW(), NOW())');
|
||||
else if (strtolower($standard) == 'test')
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'configuration` (`id_configuration`, `name`, `value`, `date_add`, `date_upd`) VALUES (NULL, "PS_TEST", "'.(int)$last_id.'", NOW(), NOW())');
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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: 7450 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function add_new_tab($className, $name, $id_parent, $returnId = false)
|
||||
{
|
||||
$array = array();
|
||||
foreach (explode('|', $name) AS $item)
|
||||
{
|
||||
$temp = explode(':', $item);
|
||||
$array[$temp[0]] = $temp[1];
|
||||
}
|
||||
|
||||
if (!(int)Db::getInstance()->getValue('SELECT count(id_tab) FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($className).'\' '))
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'tab` (`id_parent`, `class_name`, `module`, `position`) VALUES ('.(int)$id_parent.', \''.pSQL($className).'\', \'\',
|
||||
(SELECT IFNULL(MAX(t.position),0)+ 1 FROM `'._DB_PREFIX_.'tab` t WHERE t.id_parent = '.(int)$id_parent.'))');
|
||||
|
||||
$languages = Db::getInstance()->executeS('SELECT id_lang, iso_code FROM `'._DB_PREFIX_.'lang`');
|
||||
foreach ($languages AS $lang)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'tab_lang` (`id_lang`, `id_tab`, `name`)
|
||||
VALUES ('.(int)$lang['id_lang'].', (
|
||||
SELECT `id_tab`
|
||||
FROM `'._DB_PREFIX_.'tab`
|
||||
WHERE `class_name` = \''.pSQL($className).'\' LIMIT 0,1
|
||||
), \''.pSQL(isset($array[$lang['iso_code']]) ? $array[$lang['iso_code']] : $array['en']).'\')
|
||||
');
|
||||
}
|
||||
|
||||
Db::getInstance()->execute('INSERT IGNORE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`)
|
||||
(SELECT `id_profile`, (
|
||||
SELECT `id_tab`
|
||||
FROM `'._DB_PREFIX_.'tab`
|
||||
WHERE `class_name` = \''.pSQL($className).'\' LIMIT 0,1
|
||||
), 1, 1, 1, 1 FROM `'._DB_PREFIX_.'profile` )');
|
||||
|
||||
if($returnId) {
|
||||
return (int)Db::getInstance()->getValue('SELECT `id_tab`
|
||||
FROM `'._DB_PREFIX_.'tab`
|
||||
WHERE `class_name` = \''.pSQL($className).'\'');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
function add_order_state($conf_name, $name, $invoice, $send_email, $color, $unremovable, $logable, $delivery, $template = null)
|
||||
{
|
||||
$name_lang = array();
|
||||
$template_lang = array();
|
||||
foreach (explode('|', $name) AS $item)
|
||||
{
|
||||
$temp = explode(':', $item);
|
||||
$name_lang[$temp[0]] = $temp[1];
|
||||
}
|
||||
|
||||
if ($template)
|
||||
foreach (explode('|', $template) AS $item)
|
||||
{
|
||||
$temp = explode(':', $item);
|
||||
$template_lang[$temp[0]] = $temp[1];
|
||||
}
|
||||
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'order_state` (`invoice`, `send_email`, `color`, `unremovable`, `logable`, `delivery`)
|
||||
VALUES ('.(int)$invoice.', '.(int)$send_email.', \''.pSQL($color).'\', '.(int)$unremovable.', '.(int)$logable.', '.(int)$delivery.')');
|
||||
|
||||
$id_order_state = Db::getInstance()->getValue('
|
||||
SELECT MAX(`id_order_state`)
|
||||
FROM `'._DB_PREFIX_.'order_state`
|
||||
');
|
||||
|
||||
foreach (Language::getLanguages() AS $lang)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'order_state_lang` (`id_lang`, `id_order_state`, `name`, `template`)
|
||||
VALUES ('.(int)$lang['id_lang'].', '.(int)$id_order_state.', \''.pSQL(isset($name_lang[$lang['iso_code']]) ? $name_lang[$lang['iso_code']] : $name_lang['en']).'\', \''.pSQL(isset($template_lang[$lang['iso_code']]) ? $template_lang[$lang['iso_code']] : (isset($template_lang['en']) ? $template_lang['en'] : '')).'\')
|
||||
');
|
||||
}
|
||||
|
||||
Configuration::updateValue($conf_name, $id_order_state);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?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: 7387 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'add_new_tab.php');
|
||||
|
||||
function add_stock_tab()
|
||||
{
|
||||
// Patch for the 1.0.1 sql update
|
||||
Db::getInstance()->query('
|
||||
DELETE
|
||||
FROM `'._DB_PREFIX_.'tab`
|
||||
WHERE id_parent = 1
|
||||
AND class_name = "AdminStocks"');
|
||||
|
||||
// Create new tabs
|
||||
$id_parent = add_new_tab(
|
||||
'AdminStock',
|
||||
'en:Stock|fr:Stock|es:Stock|de:Stock|it:Stock',
|
||||
0,
|
||||
true);
|
||||
|
||||
add_new_tab(
|
||||
'AdminWarehouses',
|
||||
'en:Warehouses|fr:Entrepôts|es:Warehouses|de:Warehouses|it:Warehouses',
|
||||
$id_parent);
|
||||
|
||||
add_new_tab(
|
||||
'AdminStockManagement',
|
||||
'en:Stock Management|fr:Gestion du stock|es:Stock Management|de:Stock Management|it:Stock Management',
|
||||
$id_parent);
|
||||
|
||||
add_new_tab(
|
||||
'AdminStockMvt',
|
||||
'en:Stock Movement|fr:Mouvements de Stock|es:Stock Movement|de:Stock Movement|it:Stock Movement',
|
||||
$id_parent);
|
||||
|
||||
add_new_tab(
|
||||
'AdminStockInstantState',
|
||||
'en:Stock instant state|fr:Etat instantané du stock|es:Stock instant state|de:Stock instant state|it:Stock instant state',
|
||||
$id_parent);
|
||||
|
||||
add_new_tab(
|
||||
'AdminStockCover',
|
||||
'en:Stock cover|fr:Couverture du stock|es:Stock cover|de:Stock cover|it:Stock cover',
|
||||
$id_parent);
|
||||
|
||||
add_new_tab(
|
||||
'AdminSupplyOrders',
|
||||
'en:Supply orders|fr:Commandes fournisseurs|es:Supply orders|de:Supply orders|it:Supply orders',
|
||||
$id_parent);
|
||||
|
||||
add_new_tab(
|
||||
'AdminStockConfiguration',
|
||||
'en:Configuration|fr:Configuration|es:Configuration|de:Configuration|it:Configuration',
|
||||
$id_parent);
|
||||
}
|
||||
@@ -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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function alter_blocklink()
|
||||
{
|
||||
// No one will know if the table does not exist :] Thanks Damien for your solution ;)
|
||||
DB::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'blocklink_lang` CHANGE `id_link` `id_blocklink` INT( 10 ) UNSIGNED NOT NULL');
|
||||
|
||||
DB::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'blocklink` CHANGE `id_link` `id_blocklink` INT( 10 ) UNSIGNED NOT NULL');
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function alter_cms_block()
|
||||
{
|
||||
// No one will know if the table does not exist :] Thanks Damien for your solution ;)
|
||||
DB::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'cms_block_lang` CHANGE `id_block_cms` `id_cms_block` INT( 10 ) UNSIGNED NOT NULL');
|
||||
|
||||
DB::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'cms_block` CHANGE `id_block_cms` `id_cms_block` INT( 10 ) UNSIGNED NOT NULL');
|
||||
|
||||
DB::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'cms_block_page` CHANGE `id_block_cms` `id_cms_block` INT( 10 ) UNSIGNED NOT NULL');
|
||||
|
||||
DB::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'cms_block_page` CHANGE `id_block_cms_page` `id_cms_block_page` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT');
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
function alter_productcomments_guest_index()
|
||||
{
|
||||
Configuration::loadConfiguration();
|
||||
$productcomments = Module::getInstanceByName('productcomments');
|
||||
if (!$productcomments->id)
|
||||
return;
|
||||
|
||||
DB::getInstance()->Execute('
|
||||
ALTER TABLE `'._DB_PREFIX_.'product_comment`
|
||||
DROP INDEX `id_guest`, ADD INDEX `id_guest` (`id_guest`);');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function blocknewsletter()
|
||||
{
|
||||
// No one will know if the table does not exist :]
|
||||
DB::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'newsletter ADD `http_referer` VARCHAR(255) NULL');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Check if all needed columns in webservice_account table exists.
|
||||
* These columns are used for the WebserviceRequest overriding.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function check_webservice_account_table()
|
||||
{
|
||||
$sql = 'SHOW COLUMNS FROM '._DB_PREFIX_.'webservice_account';
|
||||
$return = DB::getInstance()->executeS($sql);
|
||||
if (count($return) < 7)
|
||||
{
|
||||
$sql = 'ALTER TABLE `'._DB_PREFIX_.'webservice_account` ADD `is_module` TINYINT( 2 ) NOT NULL DEFAULT \'0\' AFTER `class_name` ,
|
||||
ADD `module_name` VARCHAR( 50 ) NULL DEFAULT NULL AFTER `is_module`';
|
||||
DB::getInstance()->executeS($sql);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
function cms_block()
|
||||
{
|
||||
if (!Db::getInstance()->execute('SELECT `display_store` FROM `'._DB_PREFIX_.'cms_block` LIMIT 1'))
|
||||
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'cms_block` ADD `display_store` TINYINT NOT NULL DEFAULT \'1\'');
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function configuration_double_cleaner()
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT name, MIN(id_configuration) AS minid
|
||||
FROM '._DB_PREFIX_.'configuration
|
||||
GROUP BY name
|
||||
HAVING count(name) > 1');
|
||||
foreach ($result as $row)
|
||||
{
|
||||
DB::getInstance()->Execute('
|
||||
DELETE FROM '._DB_PREFIX_.'configuration
|
||||
WHERE name = \''.addslashes($row['name']).'\'
|
||||
AND id_configuration != '.(int)($row['minid']));
|
||||
}
|
||||
DB::getInstance()->Execute('
|
||||
DELETE FROM '._DB_PREFIX_.'configuration_lang
|
||||
WHERE id_configuration NOT IN (
|
||||
SELECT id_configuration
|
||||
FROM '._DB_PREFIX_.'configuration)');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,278 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
$timezones = array(
|
||||
'AD' => 'Europe/Andorra',
|
||||
'AE' => 'Asia/Dubai',
|
||||
'AF' => 'Asia/Kabul',
|
||||
'AG' => 'America/Antigua',
|
||||
'AI' => 'America/Anguilla',
|
||||
'AL' => 'Europe/Tirane',
|
||||
'AM' => 'Asia/Yerevan',
|
||||
'AN' => 'America/Curacao',
|
||||
'AO' => 'Africa/Luanda',
|
||||
'AQ' => 'Antarctica/McMurdo',
|
||||
'AR' => 'America/Argentina/Buenos_Aires',
|
||||
'AS' => 'Pacific/Pago_Pago',
|
||||
'AT' => 'Europe/Vienna',
|
||||
'AU' => 'Australia/Lord_Howe',
|
||||
'AW' => 'America/Aruba',
|
||||
'AX' => 'Europe/Mariehamn',
|
||||
'AZ' => 'Asia/Baku',
|
||||
'BA' => 'Europe/Sarajevo',
|
||||
'BB' => 'America/Barbados',
|
||||
'BD' => 'Asia/Dhaka',
|
||||
'BE' => 'Europe/Brussels',
|
||||
'BF' => 'Africa/Ouagadougou',
|
||||
'BG' => 'Europe/Sofia',
|
||||
'BH' => 'Asia/Bahrain',
|
||||
'BI' => 'Africa/Bujumbura',
|
||||
'BJ' => 'Africa/Porto-Novo',
|
||||
'BL' => 'America/St_Barthelemy',
|
||||
'BM' => 'Atlantic/Bermuda',
|
||||
'BN' => 'Asia/Brunei',
|
||||
'BO' => 'America/La_Paz',
|
||||
'BR' => 'America/Noronha',
|
||||
'BS' => 'America/Nassau',
|
||||
'BT' => 'Asia/Thimphu',
|
||||
'BV' => '',
|
||||
'BW' => 'Africa/Gaborone',
|
||||
'BY' => 'Europe/Minsk',
|
||||
'BZ' => 'America/Belize',
|
||||
'CA' => 'America/Toronto',
|
||||
'CC' => 'Indian/Cocos',
|
||||
'CD' => 'Africa/Kinshasa',
|
||||
'CF' => 'Africa/Bangui',
|
||||
'CG' => 'Africa/Brazzaville',
|
||||
'CH' => 'Europe/Zurich',
|
||||
'CI' => 'Africa/Abidjan',
|
||||
'CK' => 'Pacific/Rarotonga',
|
||||
'CL' => 'America/Santiago',
|
||||
'CM' => 'Africa/Douala',
|
||||
'CN' => 'Asia/Shanghai',
|
||||
'CO' => 'America/Bogota',
|
||||
'CR' => 'America/Costa_Rica',
|
||||
'CU' => 'America/Havana',
|
||||
'CV' => 'Atlantic/Cape_Verde',
|
||||
'CX' => 'Indian/Christmas',
|
||||
'CY' => 'Asia/Nicosia',
|
||||
'CZ' => 'Europe/Prague',
|
||||
'DE' => 'Europe/Berlin',
|
||||
'DJ' => 'Africa/Djibouti',
|
||||
'DK' => 'Europe/Copenhagen',
|
||||
'DM' => 'America/Dominica',
|
||||
'DO' => 'America/Santo_Domingo',
|
||||
'DZ' => 'Africa/Algiers',
|
||||
'EC' => 'America/Guayaquil',
|
||||
'EE' => 'Europe/Tallinn',
|
||||
'EG' => 'Africa/Cairo',
|
||||
'EH' => 'Africa/El_Aaiun',
|
||||
'ER' => 'Africa/Asmara',
|
||||
'ES' => 'Europe/Madrid',
|
||||
'ET' => 'Africa/Addis_Ababa',
|
||||
'FI' => 'Europe/Helsinki',
|
||||
'FJ' => 'Pacific/Fiji',
|
||||
'FK' => 'Atlantic/Stanley',
|
||||
'FM' => 'Pacific/Chuuk',
|
||||
'FO' => 'Atlantic/Faroe',
|
||||
'FR' => 'Europe/Paris',
|
||||
'GA' => 'Africa/Libreville',
|
||||
'GB' => 'Europe/London',
|
||||
'GD' => 'America/Grenada',
|
||||
'GE' => 'Asia/Tbilisi',
|
||||
'GF' => 'America/Cayenne',
|
||||
'GG' => 'Europe/Guernsey',
|
||||
'GH' => 'Africa/Accra',
|
||||
'GI' => 'Europe/Gibraltar',
|
||||
'GL' => 'America/Godthab',
|
||||
'GM' => 'Africa/Banjul',
|
||||
'GN' => 'Africa/Conakry',
|
||||
'GP' => 'America/Guadeloupe',
|
||||
'GQ' => 'Africa/Malabo',
|
||||
'GR' => 'Europe/Athens',
|
||||
'GS' => 'Atlantic/South_Georgia',
|
||||
'GT' => 'America/Guatemala',
|
||||
'GU' => 'Pacific/Guam',
|
||||
'GW' => 'Africa/Bissau',
|
||||
'GY' => 'America/Guyana',
|
||||
'HK' => 'Asia/Hong_Kong',
|
||||
'HM' => '',
|
||||
'HN' => 'America/Tegucigalpa',
|
||||
'HR' => 'Europe/Zagreb',
|
||||
'HT' => 'America/Port-au-Prince',
|
||||
'HU' => 'Europe/Budapest',
|
||||
'ID' => 'Asia/Jakarta',
|
||||
'IE' => 'Europe/Dublin',
|
||||
'IL' => 'Asia/Jerusalem',
|
||||
'IM' => 'Europe/Isle_of_Man',
|
||||
'IN' => 'Asia/Kolkata',
|
||||
'IO' => 'Indian/Chagos',
|
||||
'IQ' => 'Asia/Baghdad',
|
||||
'IR' => 'Asia/Tehran',
|
||||
'IS' => 'Atlantic/Reykjavik',
|
||||
'IT' => 'Europe/Rome',
|
||||
'JE' => 'Europe/Jersey',
|
||||
'JM' => 'America/Jamaica',
|
||||
'JO' => 'Asia/Amman',
|
||||
'JP' => 'Asia/Tokyo',
|
||||
'KE' => 'Africa/Nairobi',
|
||||
'KG' => 'Asia/Bishkek',
|
||||
'KH' => 'Asia/Phnom_Penh',
|
||||
'KI' => 'Pacific/Tarawa',
|
||||
'KM' => 'Indian/Comoro',
|
||||
'KN' => 'America/St_Kitts',
|
||||
'KP' => 'Asia/Pyongyang',
|
||||
'KR' => 'Asia/Seoul',
|
||||
'KW' => 'Asia/Kuwait',
|
||||
'KY' => 'America/Cayman',
|
||||
'KZ' => 'Asia/Almaty',
|
||||
'LA' => 'Asia/Vientiane',
|
||||
'LB' => 'Asia/Beirut',
|
||||
'LC' => 'America/St_Lucia',
|
||||
'LI' => 'Europe/Vaduz',
|
||||
'LK' => 'Asia/Colombo',
|
||||
'LR' => 'Africa/Monrovia',
|
||||
'LS' => 'Africa/Maseru',
|
||||
'LT' => 'Europe/Vilnius',
|
||||
'LU' => 'Europe/Luxembourg',
|
||||
'LV' => 'Europe/Riga',
|
||||
'LY' => 'Africa/Tripoli',
|
||||
'MA' => 'Africa/Casablanca',
|
||||
'MC' => 'Europe/Monaco',
|
||||
'MD' => 'Europe/Chisinau',
|
||||
'ME' => 'Europe/Podgorica',
|
||||
'MF' => 'America/Marigot',
|
||||
'MG' => 'Indian/Antananarivo',
|
||||
'MH' => 'Pacific/Majuro',
|
||||
'MK' => 'Europe/Skopje',
|
||||
'ML' => 'Africa/Bamako',
|
||||
'MM' => 'Asia/Rangoon',
|
||||
'MN' => 'Asia/Ulaanbaatar',
|
||||
'MO' => 'Asia/Macau',
|
||||
'MP' => 'Pacific/Saipan',
|
||||
'MQ' => 'America/Martinique',
|
||||
'MR' => 'Africa/Nouakchott',
|
||||
'MS' => 'America/Montserrat',
|
||||
'MT' => 'Europe/Malta',
|
||||
'MU' => 'Indian/Mauritius',
|
||||
'MV' => 'Indian/Maldives',
|
||||
'MW' => 'Africa/Blantyre',
|
||||
'MX' => 'America/Mexico_City',
|
||||
'MY' => 'Asia/Kuala_Lumpur',
|
||||
'MZ' => 'Africa/Maputo',
|
||||
'NA' => 'Africa/Windhoek',
|
||||
'NC' => 'Pacific/Noumea',
|
||||
'NE' => 'Africa/Niamey',
|
||||
'NF' => 'Pacific/Norfolk',
|
||||
'NG' => 'Africa/Lagos',
|
||||
'NI' => 'America/Managua',
|
||||
'NL' => 'Europe/Amsterdam',
|
||||
'NO' => 'Europe/Oslo',
|
||||
'NP' => 'Asia/Kathmandu',
|
||||
'NR' => 'Pacific/Nauru',
|
||||
'NU' => 'Pacific/Niue',
|
||||
'NZ' => 'Pacific/Auckland',
|
||||
'OM' => 'Asia/Muscat',
|
||||
'PA' => 'America/Panama',
|
||||
'PE' => 'America/Lima',
|
||||
'PF' => 'Pacific/Tahiti',
|
||||
'PG' => 'Pacific/Port_Moresby',
|
||||
'PH' => 'Asia/Manila',
|
||||
'PK' => 'Asia/Karachi',
|
||||
'PL' => 'Europe/Warsaw',
|
||||
'PM' => 'America/Miquelon',
|
||||
'PN' => 'Pacific/Pitcairn',
|
||||
'PR' => 'America/Puerto_Rico',
|
||||
'PS' => 'Asia/Gaza',
|
||||
'PT' => 'Europe/Lisbon',
|
||||
'PW' => 'Pacific/Palau',
|
||||
'PY' => 'America/Asuncion',
|
||||
'QA' => 'Asia/Qatar',
|
||||
'RE' => 'Indian/Reunion',
|
||||
'RO' => 'Europe/Bucharest',
|
||||
'RS' => 'Europe/Belgrade',
|
||||
'RU' => 'Europe/Moscow',
|
||||
'RW' => 'Africa/Kigali',
|
||||
'SA' => 'Asia/Riyadh',
|
||||
'SB' => 'Pacific/Guadalcanal',
|
||||
'SC' => 'Indian/Mahe',
|
||||
'SD' => 'Africa/Khartoum',
|
||||
'SE' => 'Europe/Stockholm',
|
||||
'SG' => 'Asia/Singapore',
|
||||
'SI' => 'Europe/Ljubljana',
|
||||
'SJ' => 'Arctic/Longyearbyen',
|
||||
'SK' => 'Europe/Bratislava',
|
||||
'SL' => 'Africa/Freetown',
|
||||
'SM' => 'Europe/San_Marino',
|
||||
'SN' => 'Africa/Dakar',
|
||||
'SO' => 'Africa/Mogadishu',
|
||||
'SR' => 'America/Paramaribo',
|
||||
'ST' => 'Africa/Sao_Tome',
|
||||
'SV' => 'America/El_Salvador',
|
||||
'SY' => 'Asia/Damascus',
|
||||
'SZ' => 'Africa/Mbabane',
|
||||
'TC' => 'America/Grand_Turk',
|
||||
'TD' => 'Africa/Ndjamena',
|
||||
'TF' => 'Indian/Kerguelen',
|
||||
'TG' => 'Africa/Lome',
|
||||
'TH' => 'Asia/Bangkok',
|
||||
'TJ' => 'Asia/Dushanbe',
|
||||
'TK' => 'Pacific/Fakaofo',
|
||||
'TL' => 'Asia/Dili',
|
||||
'TM' => 'Asia/Ashgabat',
|
||||
'TN' => 'Africa/Tunis',
|
||||
'TO' => 'Pacific/Tongatapu',
|
||||
'TR' => 'Europe/Istanbul',
|
||||
'TT' => 'America/Port_of_Spain',
|
||||
'TV' => 'Pacific/Funafuti',
|
||||
'TW' => 'Asia/Taipei',
|
||||
'TZ' => 'Africa/Dar_es_Salaam',
|
||||
'UA' => 'Europe/Kiev',
|
||||
'UG' => 'Africa/Kampala',
|
||||
'US' => 'US/Eastern',
|
||||
'UY' => 'America/Montevideo',
|
||||
'UZ' => 'Asia/Samarkand',
|
||||
'VA' => 'Europe/Vatican',
|
||||
'VC' => 'America/St_Vincent',
|
||||
'VE' => 'America/Caracas',
|
||||
'VG' => 'America/Tortola',
|
||||
'VI' => 'America/St_Thomas',
|
||||
'VN' => 'Asia/Ho_Chi_Minh',
|
||||
'VU' => 'Pacific/Efate',
|
||||
'WF' => 'Pacific/Wallis',
|
||||
'WS' => 'Pacific/Apia',
|
||||
'YE' => 'Asia/Aden',
|
||||
'YT' => 'Indian/Mayotte',
|
||||
'ZA' => 'Africa/Johannesburg',
|
||||
'ZM' => 'Africa/Lusaka',
|
||||
'ZW' => 'Africa/Harare',
|
||||
);
|
||||
|
||||
|
||||
if (isset($timezones[$_GET['country']]) && $timezones[$_GET['country']])
|
||||
die($timezones[$_GET['country']]);
|
||||
die('');
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'add_new_tab.php');
|
||||
|
||||
function create_multistore()
|
||||
{
|
||||
$res = true;
|
||||
|
||||
$themes = scandir(dirname(__FILE__).'/../../themes');
|
||||
foreach ($themes AS $theme)
|
||||
if (is_dir(dirname(__FILE__).'/../../themes/'.$theme) && $theme[0] != '.' && $theme != 'prestashop')
|
||||
$res &= Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'theme (`id_theme`, `name`) VALUES(\'\', \''.pSQL($theme).'\')');
|
||||
$res &= Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'shop
|
||||
SET
|
||||
name = (SELECT value
|
||||
FROM '._DB_PREFIX_.'configuration
|
||||
WHERE name = "PS_SHOP_NAME"
|
||||
),
|
||||
id_theme = (SELECT id_theme FROM '._DB_PREFIX_.'theme WHERE name=\''.pSQL(_THEME_NAME_).'\')
|
||||
WHERE id_shop = 1');
|
||||
$shop_domain = Db::getInstance()->getValue('SELECT `value`
|
||||
FROM `'._DB_PREFIX_.'_configuration`
|
||||
WHERE `name`=\'PS_SHOP_DOMAIN\'');
|
||||
$shop_domain_ssl = Db::getInstance()->getValue('SELECT `value`
|
||||
FROM `'._DB_PREFIX_.'_configuration`
|
||||
WHERE `name`=\'PS_SHOP_DOMAIN_SSL\'');
|
||||
if(empty($shop_domain))
|
||||
{
|
||||
$shop_domain = Tools::getHttpHost();
|
||||
$shop_domain_ssl = Tools::getHttpHost();
|
||||
}
|
||||
|
||||
$_PS_DIRECTORY_ = trim(str_replace(' ', '%20', INSTALLER__PS_BASE_URI), '/');
|
||||
$_PS_DIRECTORY_ = ($_PS_DIRECTORY_) ? '/'.$_PS_DIRECTORY_.'/' : '/';
|
||||
$res &= Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'shop_url` (`id_shop`, `domain`, `domain_ssl`, `physical_uri`, `virtual_uri`, `main`, `active`)
|
||||
VALUES(1, \''.pSQL($shop_domain).'\', \''.pSQL($shop_domain_ssl).'\', \''.pSQL($_PS_DIRECTORY_).'\', \'\', 1, 1)');
|
||||
|
||||
// Stock conversion
|
||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'.stock` (`id_product`, `id_product_attribute`, `id_group_shop`, `id_shop`, `quantity`)
|
||||
VALUES (SELECT `p.id_product`, 0, 1, 1, `p.quantity` FROM `'._DB_PREFIX_.'.product` p);';
|
||||
$res &= Db::getInstance()->execute($sql);
|
||||
|
||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'.stock` (`id_product`, `id_product_attribute`, `id_group_shop`, `id_shop`, `quantity`)
|
||||
VALUES (SELECT `id_product`, `id_product_attribute`, 1, 1, `quantity` FROM `'._DB_PREFIX_.'product_attribute` p);';
|
||||
$res &= Db::getInstance()->execute($sql);
|
||||
|
||||
// Add admin tabs
|
||||
$shopTabId = add_new_tab('AdminShop', 'it:Shops|es:Shops|fr:Boutiques|de:Shops|en:Shops', 0, true);
|
||||
add_new_tab('AdminGroupShop', 'it:Group Shops|es:Group Shops|fr:Groupes de boutique|de:Group Shops|en:Group Shops', $shopTabId);
|
||||
add_new_tab('AdminShopUrl', 'it:Shop Urls|es:Shop Urls|fr:URLs de boutique|de:Shop Urls|en:Shop Urls', $shopTabId);
|
||||
|
||||
return $res;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
define('_CONTAINS_REQUIRED_FIELD_', 2);
|
||||
|
||||
function add_required_customization_field_flag()
|
||||
{
|
||||
if (($result = Db::getInstance()->executeS('SELECT `id_product` FROM `'._DB_PREFIX_.'customization_field` WHERE `required` = 1')) === false)
|
||||
return false;
|
||||
if (Db::getInstance()->numRows())
|
||||
{
|
||||
$productIds = array();
|
||||
foreach ($result AS $row)
|
||||
$productIds[] = (int)($row['id_product']);
|
||||
if (!Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'product` SET `customizable` = '._CONTAINS_REQUIRED_FIELD_.' WHERE `id_product` IN ('.implode(', ', $productIds).')'))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function group_reduction_column_fix()
|
||||
{
|
||||
if (!Db::getInstance()->execute('SELECT `group_reduction` FROM `'._DB_PREFIX_.'order_detail` LIMIT 1'))
|
||||
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `group_reduction` DECIMAL(10, 2) NOT NULL AFTER `reduction_amount`');
|
||||
return true;
|
||||
}
|
||||
|
||||
function ecotax_tax_application_fix()
|
||||
{
|
||||
if (!Db::getInstance()->execute('SELECT `ecotax_tax_rate` FROM `'._DB_PREFIX_.'order_detail` LIMIT 1'))
|
||||
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `ecotax_tax_rate` DECIMAL(5, 3) NOT NULL AFTER `ecotax`');
|
||||
return true;
|
||||
}
|
||||
|
||||
function id_currency_country_fix()
|
||||
{
|
||||
if (!Db::getInstance()->execute('SELECT `id_currency` FROM `'._DB_PREFIX_.'country` LIMIT 1'))
|
||||
return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'country` ADD `id_currency` INT NOT NULL DEFAULT \'0\' AFTER `id_zone`');
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?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: 7389 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function deactivate_custom_modules()
|
||||
{
|
||||
$db = Db::getInstance();
|
||||
$modulesDirOnDisk = Module::getModulesDirOnDisk();
|
||||
|
||||
$module_list_xml = _PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'modules_list.xml';
|
||||
$nativeModules = simplexml_load_file($module_list_xml);
|
||||
$nativeModules = $nativeModules->modules;
|
||||
foreach ($nativeModules as $nativeModulesType)
|
||||
if (in_array($nativeModulesType['type'],array('native','partner')))
|
||||
{
|
||||
$arrNativeModules[] = '""';
|
||||
foreach ($nativeModulesType->module as $module)
|
||||
$arrNativeModules[] = '"'.pSQL($module['name']).'"';
|
||||
}
|
||||
|
||||
$arrNonNative = $db->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'module` m
|
||||
WHERE name NOT IN ('.implode(',',$arrNativeModules).') ');
|
||||
|
||||
$uninstallMe = array("undefined-modules");
|
||||
if (is_array($arrNonNative))
|
||||
foreach($arrNonNative as $aModule)
|
||||
$uninstallMe[] = $aModule['name'];
|
||||
|
||||
if (!is_array($uninstallMe))
|
||||
$uninstallMe = array($uninstallMe);
|
||||
|
||||
foreach ($uninstallMe as $k=>$v)
|
||||
$uninstallMe[$k] = '"'.pSQL($v).'"';
|
||||
|
||||
return Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'module`
|
||||
SET `active`= 0
|
||||
WHERE `name` IN ('.implode(',',$uninstallMe).')');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function delivery_number_set()
|
||||
{
|
||||
Configuration::loadConfiguration();
|
||||
$number = 1;
|
||||
|
||||
// Update each order with a number
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT id_order
|
||||
FROM '._DB_PREFIX_.'orders
|
||||
ORDER BY id_order');
|
||||
foreach ($result as $row)
|
||||
{
|
||||
$order = new Order((int)($row['id_order']));
|
||||
$history = $order->getHistory(false);
|
||||
foreach ($history as $row2)
|
||||
{
|
||||
$oS = new OrderState((int)($row2['id_order_state']), Configuration::get('PS_LANG_DEFAULT'));
|
||||
if ($oS->delivery)
|
||||
{
|
||||
Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET delivery_number = '.(int)($number++).', `delivery_date` = `date_add` WHERE id_order = '.(int)($order->id));
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add configuration var
|
||||
Configuration::updateValue('PS_DELIVERY_NUMBER', (int)($number));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
function drop_image_type_non_unique_index()
|
||||
{
|
||||
$index = Db::getInstance()->executeS('SHOW index FROM ps_image_type where column_name = "name" and non_unique=1');
|
||||
// do not use pSql, this function is not defined
|
||||
Db::getInstance()->execute('ALTER TABLE `PREFIX_image_type` DROP INDEX "'.$index.'"');
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function editorial_update()
|
||||
{
|
||||
/*Table creation*/
|
||||
|
||||
if (Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name`="editorial"'))
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE `'._DB_PREFIX_.'editorial` (
|
||||
`id_editorial` int(10) unsigned NOT NULL auto_increment,
|
||||
`body_home_logo_link` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id_editorial`))
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8');
|
||||
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE `'._DB_PREFIX_.'editorial_lang` (
|
||||
`id_editorial` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`body_title` varchar(255) NOT NULL,
|
||||
`body_subheading` varchar(255) NOT NULL,
|
||||
`body_paragraph` text NOT NULL,
|
||||
`body_logo_subheading` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id_editorial`, `id_lang`))
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8');
|
||||
|
||||
if (file_exists(dirname(__FILE__).'/../../modules/editorial/editorial.xml'))
|
||||
{
|
||||
$xml = simplexml_load_file(dirname(__FILE__).'/../../modules/editorial/editorial.xml');
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'editorial`(`id_editorial`, `body_home_logo_link`) VALUES(1, "'.(isset($xml->body->home_logo_link) ? pSQL($xml->body->home_logo_link) : '').'")');
|
||||
|
||||
|
||||
$languages = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'lang`');
|
||||
foreach ($languages as $language)
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'editorial_lang` (`id_editorial`, `id_lang`, `body_title`, `body_subheading`, `body_paragraph`, `body_logo_subheading`)
|
||||
VALUES (1, '.(int)($language['id_lang']).',
|
||||
"'.(isset($xml->body->{'title_'.$language['id_lang']}) ? pSQL($xml->body->{'title_'.$language['id_lang']}) : '').'",
|
||||
"'.(isset($xml->body->{'subheading_'.$language['id_lang']}) ? pSQL($xml->body->{'subheading_'.$language['id_lang']}) : '').'",
|
||||
"'.(isset($xml->body->{'paragraph_'.$language['id_lang']}) ? pSQL($xml->body->{'paragraph_'.$language['id_lang']}, true) : '').'",
|
||||
"'.(isset($xml->body->{'logo_subheading_'.$language['id_lang']}) ? pSQL($xml->body->{'logo_subheading_'.$language['id_lang']}) : '').'")');
|
||||
|
||||
unlink(dirname(__FILE__).'/../../modules/editorial/editorial.xml');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function generate_ntree()
|
||||
{
|
||||
Category::regenerateEntireNtree();
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
function generate_order_reference()
|
||||
{
|
||||
// Get all orders
|
||||
$orders = Db::getInstance()->executeS('SELECT id_order FROM '._DB_PREFIX_.'orders');
|
||||
foreach ($orders as $order)
|
||||
{
|
||||
$random_ref = '';
|
||||
for ($i = 0, $passwd = ''; $i < 9; $i++)
|
||||
$random_ref .= substr('ABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(0,25), 1);
|
||||
Db::getInstance()->execute('
|
||||
UPDATE '._DB_PREFIX_.'orders
|
||||
SET reference = \''.$random_ref.'\'
|
||||
WHERE id_order = '.(int)$order['id_order']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
function generate_tax_rules()
|
||||
{
|
||||
$taxes = Tax::getTaxes(Configuration::get('PS_LANG_DEFAULT'), true);
|
||||
$countries = Country::getCountries(Configuration::get('PS_LANG_DEFAULT'));
|
||||
|
||||
foreach ($taxes AS $tax)
|
||||
{
|
||||
$insert = '';
|
||||
$id_tax = $tax['id_tax'];
|
||||
|
||||
$group = new TaxRulesGroup();
|
||||
$group->active = 1;
|
||||
$group->name = 'Rule '.$tax['rate'].'%';
|
||||
$group->save();
|
||||
$id_tax_rules_group = $group->id;
|
||||
|
||||
|
||||
$countries = Db::getInstance()->executeS('
|
||||
SELECT * FROM `'._DB_PREFIX_.'country` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'zone` z ON (c.`id_zone` = z.`id_zone`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'tax_zone` tz ON (tz.`id_zone` = z.`id_zone`)
|
||||
WHERE `id_tax` = '.(int)$id_tax
|
||||
);
|
||||
if ($countries)
|
||||
{
|
||||
foreach ($countries AS $country)
|
||||
{
|
||||
$res = Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'tax_rule` (`id_tax_rules_group`, `id_country`, `id_state`, `state_behavior`, `id_tax`)
|
||||
VALUES (
|
||||
'.(int)$group->id.',
|
||||
'.(int)$country['id_country'].',
|
||||
0,
|
||||
0,
|
||||
'.(int)$id_tax.
|
||||
')');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$states = Db::getInstance()->executeS('
|
||||
SELECT * FROM `'._DB_PREFIX_.'states s
|
||||
LEFT JOIN `'._DB_PREFIX_.'tax_state ts ON (ts.`id_state` = s.`id_state`)
|
||||
WHERE `id_tax` = '.(int)$id_tax
|
||||
);
|
||||
|
||||
if ($states)
|
||||
{
|
||||
foreach ($states AS $state)
|
||||
{
|
||||
if (!in_array($state['tax_behavior'], array(PS_PRODUCT_TAX, PS_STATE_TAX, PS_BOTH_TAX)))
|
||||
$tax_behavior = PS_PRODUCT_TAX;
|
||||
else
|
||||
$tax_behavior = $state['tax_behavior'];
|
||||
|
||||
$res = Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'tax_rule` (`id_tax_rules_group`, `id_country`, `id_state`, `state_behavior`, `id_tax`)
|
||||
VALUES (
|
||||
'.(int)$group->id.',
|
||||
'.(int)$state['id_country'].',
|
||||
'.(int)$state['id_state'].',
|
||||
'.(int)$tax_behavior.',
|
||||
'.(int)$id_tax.
|
||||
')');
|
||||
}
|
||||
}
|
||||
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'product`
|
||||
SET `id_tax_rules_group` = '.(int)$group->id.'
|
||||
WHERE `id_tax` = '.(int)$id_tax
|
||||
);
|
||||
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'carrier`
|
||||
SET `id_tax_rules_group` = '.(int)$group->id.'
|
||||
WHERE `id_tax` = '.(int)$id_tax
|
||||
);
|
||||
|
||||
|
||||
if (Configuration::get('SOCOLISSIMO_OVERCOST_TAX') == $id_tax)
|
||||
Configuration::updateValue('SOCOLISSIMO_OVERCOST_TAX', $group->id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/** remove the uncompatible module gridextjs (1.4.0.8 upgrade)
|
||||
*/
|
||||
function gridextjs_deprecated()
|
||||
{
|
||||
// if exists, use _PS_MODULE_DIR_ or _PS_ROOT_DIR_
|
||||
// instead of guessing the modules dir
|
||||
if (defined('_PS_MODULE_DIR_'))
|
||||
$gridextjs_path = _PS_MODULE_DIR_ . 'gridextjs';
|
||||
else
|
||||
if (defined('_PS_ROOT_DIR_'))
|
||||
$gridextjs_path = _PS_ROOT_DIR_ . '/modules/gridextjs';
|
||||
else
|
||||
$gridextjs_path = dirname(__FILE__).'/../../modules/gridextjs';
|
||||
|
||||
if (file_exists($gridextjs_path))
|
||||
return rename($gridextjs_path, str_replace('gridextjs', 'gridextjs.deprecated', $gridextjs_path));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
function hook_blocksearch_on_header()
|
||||
{
|
||||
if ($id_module = Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \'blocksearch\''))
|
||||
{
|
||||
$id_hook = Db::getInstance()->getValue('
|
||||
SELECT `id_hook`
|
||||
FROM `'._DB_PREFIX_.'hook`
|
||||
WHERE `name` = \'header\'
|
||||
');
|
||||
|
||||
$position = Db::getInstance()->getValue('
|
||||
SELECT MAX(`position`)
|
||||
FROM `'._DB_PREFIX_.'hook_module`
|
||||
WHERE `id_hook` = '.(int)$id_hook.'
|
||||
');
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`)
|
||||
VALUES ('.(int)$id_module.', '.(int)$id_hook.', '.($position+1).')
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function invoice_number_set()
|
||||
{
|
||||
Configuration::loadConfiguration();
|
||||
$number = 1;
|
||||
|
||||
// Update each order with a number
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT id_order
|
||||
FROM '._DB_PREFIX_.'orders
|
||||
ORDER BY id_order');
|
||||
foreach ($result as $row)
|
||||
{
|
||||
$order = new Order((int)($row['id_order']));
|
||||
$history = $order->getHistory(false);
|
||||
foreach ($history as $row2)
|
||||
{
|
||||
$oS = new OrderState((int)($row2['id_order_state']), Configuration::get('PS_LANG_DEFAULT'));
|
||||
if ($oS->invoice)
|
||||
{
|
||||
Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET invoice_number = '.(int)($number++).', `invoice_date` = `date_add` WHERE id_order = '.(int)($order->id));
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add configuration var
|
||||
Configuration::updateValue('PS_INVOICE_NUMBER', (int)($number));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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: 6594 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function migrate_block_info_to_cms_block()
|
||||
{
|
||||
//get ids cms of block information
|
||||
$id_blockinfos = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name = \'blockinfos\'');
|
||||
//get ids cms of block information
|
||||
$ids_cms = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'block_cms` WHERE `id_block` = '.(int)$id_blockinfos);
|
||||
//check if block info is installed and active
|
||||
if (sizeof($ids_cms))
|
||||
{
|
||||
//install module blockcms
|
||||
if (Module::getInstanceByName('blockcms')->install())
|
||||
{
|
||||
//add new block in new cms block
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'cms_block` (`id_cms_category`, `name`, `location`, `position`) VALUES( 1, \'\', 0, 0)');
|
||||
$id_block = Db::getInstance()->Insert_ID();
|
||||
|
||||
$languages = Language::getLanguages(false);
|
||||
foreach($languages AS $language)
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'cms_block_lang` (`id_cms_block`, `id_lang`, `name`) VALUES ('.(int)$id_block.', '.(int)$language['id_lang'].', \'Information\')');
|
||||
|
||||
//save ids cms of block information in new module cms bloc
|
||||
foreach($ids_cms AS $id_cms)
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'cms_block_page` (`id_cms_block`, `id_cms`, `is_category`) VALUES ('.(int)$id_block.', '.(int)$id_cms['id_cms'].', 0)');
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
function migrate_orders()
|
||||
{
|
||||
if (!defined('PS_TAX_EXC'))
|
||||
define('PS_TAX_EXC', 1);
|
||||
|
||||
if (!defined('PS_TAX_INC'))
|
||||
define('PS_TAX_INC', 0);
|
||||
|
||||
$values_order_detail = array();
|
||||
$insert_order_detail = 'INSERT INTO `'._DB_PREFIX_.'order_detail_2`
|
||||
(`id_order_detail`, `id_order`, `id_order_invoice`, `id_warehouse`, `product_id`, `product_attribute_id`, `product_name`, `product_quantity`, `product_quantity_in_stock`, `product_quantity_refunded`, `product_quantity_return`, `product_quantity_reinjected`, `product_price`, `reduction_percent`, `reduction_amount`, `reduction_amount_tax_incl`, `reduction_amount_tax_excl`, `group_reduction`, `product_quantity_discount`, `product_ean13`, `product_upc`, `product_reference`, `product_supplier_reference`, `product_weight`, `tax_computation_method`, `tax_name`, `tax_rate`, `ecotax`, `ecotax_tax_rate`, `discount_quantity_applied`, `download_hash`, `download_nb`, `download_deadline`, `total_price_tax_incl`, `total_price_tax_excl`, `unit_price_tax_incl`, `unit_price_tax_excl`, `total_shipping_price_tax_incl`, `total_shipping_price_tax_excl`, `purchase_supplier_price`, `original_product_price`)
|
||||
VALUES ';
|
||||
|
||||
$values_order = array();
|
||||
$insert_order = 'INSERT INTO `'._DB_PREFIX_.'orders_2` (`id_order`, `reference`, `id_group_shop`, `id_shop`, `id_carrier`, `id_lang`, `id_customer`, `id_cart`, `id_currency`, `id_address_delivery`, `id_address_invoice`, `secure_key`, `payment`, `conversion_rate`, `module`, `recyclable`, `gift`, `gift_message`, `shipping_number`, `total_discounts`, `total_discounts_tax_incl`, `total_discounts_tax_excl`, `total_paid`, `total_paid_tax_incl`, `total_paid_tax_excl`, `total_paid_real`, `total_products`, `total_products_wt`, `total_shipping`, `total_shipping_tax_incl`, `total_shipping_tax_excl`, `carrier_tax_rate`, `total_wrapping`, `total_wrapping_tax_incl`, `total_wrapping_tax_excl`, `invoice_number`, `delivery_number`, `invoice_date`, `delivery_date`, `valid`, `date_add`, `date_upd`) VALUES ';
|
||||
|
||||
// create temporary tables
|
||||
mo_duplicateTables();
|
||||
|
||||
$order_res = Db::getInstance()->query(
|
||||
'SELECT *
|
||||
FROM `'._DB_PREFIX_.'orders`');
|
||||
|
||||
$cpt = 0;
|
||||
$flush_limit = 1000;
|
||||
while ($order = Db::getInstance()->nextRow($order_res))
|
||||
{
|
||||
$sum_total_products = 0;
|
||||
$sum_tax_amount = 0;
|
||||
$default_group_id = mo_getCustomerDefaultGroup((int)$order['id_customer']);
|
||||
$price_display_method = mo_getPriceDisplayMethod((int)$default_group_id);
|
||||
|
||||
$order_details_list = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'order_detail` od
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON p.id_product = od.product_id
|
||||
WHERE od.`id_order` = '.(int)($order['id_order']));
|
||||
|
||||
foreach ($order_details_list as $order_details)
|
||||
{
|
||||
// we don't want to erase order_details data in order to create the insert query
|
||||
$products = mo_setProductPrices($order_details, $price_display_method);
|
||||
$tax_rate = 1 + ((float)$products['tax_rate'] / 100);
|
||||
$reduction_amount_tax_incl = (float)$products['reduction_amount'];
|
||||
|
||||
// cart::getTaxesAverageUsed equivalent
|
||||
$sum_total_products += $products['total_wt'];
|
||||
$sum_tax_amount += $products['total_wt'] - $products['total_price'];
|
||||
|
||||
$order_details['reduction_amount_tax_incl']= $reduction_amount_tax_incl;
|
||||
$order_details['reduction_amount_tax_excl']= (float)mo_ps_round($reduction_amount_tax_incl / $tax_rate);
|
||||
$order_details['total_price_tax_incl']= (float)$products['total_wt'];
|
||||
$order_details['total_price_tax_excl']= (float)$products['total_price'];
|
||||
$order_details['unit_price_tax_incl']= (float)$products['product_price_wt'];
|
||||
$order_details['unit_price_tax_excl']= (float)$products['product_price'];
|
||||
$values_order_detail[] = '(\''.$order_details['id_order_detail'].'\', \''.$order_details['id_order'].'\', \''.$order_details['id_order_invoice'].'\', \''.$order_details['id_warehouse'].'\', \''.$order_details['product_id'].'\', \''.$order_details['product_attribute_id'].'\', \''.$order_details['product_name'].'\', \''.$order_details['product_quantity'].'\', \''.$order_details['product_quantity_in_stock'].'\', \''.$order_details['product_quantity_refunded'].'\', \''.$order_details['product_quantity_return'].'\', \''.$order_details['product_quantity_reinjected'].'\', \''.$order_details['product_price'].'\', \''.$order_details['reduction_percent'].'\', \''.$order_details['reduction_amount'].'\', \''.$order_details['reduction_amount_tax_incl'].'\', \''.$order_details['reduction_amount_tax_excl'].'\', \''.$order_details['group_reduction'].'\', \''.$order_details['product_quantity_discount'].'\', \''.$order_details['product_ean13'].'\', \''.$order_details['product_upc'].'\', \''.$order_details['product_reference'].'\', \''.$order_details['product_supplier_reference'].'\', \''.$order_details['product_weight'].'\', \''.$order_details['tax_computation_method'].'\', \''.$order_details['tax_name'].'\', \''.$order_details['tax_rate'].'\', \''.$order_details['ecotax'].'\', \''.$order_details['ecotax_tax_rate'].'\', \''.$order_details['discount_quantity_applied'].'\', \''.$order_details['download_hash'].'\', \''.$order_details['download_nb'].'\', \''.$order_details['download_deadline'].'\', \''.$order_details['total_price_tax_incl'].'\', \''.$order_details['total_price_tax_excl'].'\', \''.$order_details['unit_price_tax_incl'].'\', \''.$order_details['unit_price_tax_excl'].'\', \''.$order_details['total_shipping_price_tax_incl'].'\', \''.$order_details['total_shipping_price_tax_excl'].'\', \''.$order_details['purchase_supplier_price'].'\', \''.$order_details['original_product_price'].'\')';
|
||||
}
|
||||
|
||||
$average_tax_used = 1;
|
||||
if ($sum_total_products > 0)
|
||||
$average_tax_used += ($sum_tax_amount / $sum_total_products) * 0.01;
|
||||
|
||||
// this was done like that previously
|
||||
$wrapping_tax_rate = 1 + (float)Db::getInstance()->getValue('SELECT value
|
||||
FROM `'._DB_PREFIX_.'configuration`
|
||||
WHERE name = "PS_GIFT_WRAPPING_TAX"') / 100;
|
||||
$carrier_tax_rate = 1 + ((float)$order['carrier_tax_rate'] / 100);
|
||||
|
||||
$total_discount_tax_excl = $order['total_discounts'] / $average_tax_used;
|
||||
|
||||
$order['total_discounts_tax_incl'] = (float)$order['total_discounts'];
|
||||
$order['total_discounts_tax_excl'] = (float)$total_discount_tax_excl;
|
||||
$order['total_paid_tax_incl'] = (float)$order['total_paid'];
|
||||
$order['total_paid_tax_excl'] = (float)$order['total_paid'];
|
||||
$order['total_shipping_tax_incl'] = (float)$order['total_shipping'];
|
||||
$order['total_shipping_tax_excl'] = (float)($order['total_shipping'] / $carrier_tax_rate);
|
||||
$order['total_wrapping_tax_incl'] = (float)$order['total_wrapping'];
|
||||
$order['total_wrapping_tax_excl'] = ((float)$order['total_wrapping'] / $wrapping_tax_rate);
|
||||
$values_order[] = '(\''.$order['id_order'].'\', \''.$order['reference'].'\', \''.$order['id_group_shop'].'\', \''.$order['id_shop'].'\', \''.$order['id_carrier'].'\', \''.$order['id_lang'].'\', \''.$order['id_customer'].'\', \''.$order['id_cart'].'\', \''.$order['id_currency'].'\', \''.$order['id_address_delivery'].'\', \''.$order['id_address_invoice'].'\', \''.$order['secure_key'].'\', \''.$order['payment'].'\', \''.$order['conversion_rate'].'\', \''.$order['module'].'\', \''.$order['recyclable'].'\', \''.$order['gift'].'\', \''.$order['gift_message'].'\', \''.$order['shipping_number'].'\', \''.$order['total_discounts'].'\', \''.$order['total_discounts_tax_incl'].'\', \''.$order['total_discounts_tax_excl'].'\', \''.$order['total_paid'].'\', \''.$order['total_paid_tax_incl'].'\', \''.$order['total_paid_tax_excl'].'\', \''.$order['total_paid_real'].'\', \''.$order['total_products'].'\', \''.$order['total_products_wt'].'\', \''.$order['total_shipping'].'\', \''.$order['total_shipping_tax_incl'].'\', \''.$order['total_shipping_tax_excl'].'\', \''.$order['carrier_tax_rate'].'\', \''.$order['total_wrapping'].'\', \''.$order['total_wrapping_tax_incl'].'\', \''.$order['total_wrapping_tax_excl'].'\', \''.$order['invoice_number'].'\', \''.$order['delivery_number'].'\', \''.$order['invoice_date'].'\', \''.$order['delivery_date'].'\', \''.$order['valid'].'\', \''.$order['date_add'].'\', \''.$order['date_upd'].'\')';
|
||||
|
||||
unset($order);
|
||||
$cpt++;
|
||||
|
||||
if ($cpt >= $flush_limit)
|
||||
{
|
||||
$cpt = 0;
|
||||
Db::getInstance()->execute($insert_order_detail. implode(',', $values_order_detail));
|
||||
Db::getInstance()->execute($insert_order. implode(',', $values_order));
|
||||
$values_order = array();
|
||||
$values_order_detail = array();
|
||||
}
|
||||
}
|
||||
|
||||
if ($cpt> 0)
|
||||
{
|
||||
Db::getInstance()->execute($insert_order_detail. implode(',', $values_order_detail));
|
||||
Db::getInstance()->execute($insert_order. implode(',', $values_order));
|
||||
}
|
||||
|
||||
mo_renameTables();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* mo_ps_round is a simplification of Tools::ps_round:
|
||||
* - round is always 2
|
||||
* - no call to Configuration class
|
||||
*
|
||||
* @param mixed $val
|
||||
* @return void
|
||||
*/
|
||||
function mo_ps_round($val){
|
||||
static $ps_price_round_mode;
|
||||
if (empty($ps_price_round_mode))
|
||||
{
|
||||
$ps_price_round_mode = Db::getInstance()->getValue('SELECT value
|
||||
FROM `'._DB_PREFIX_.'configuration`
|
||||
WHERE name = "PS_PRICE_ROUND_MODE"');
|
||||
}
|
||||
|
||||
switch ($ps_price_round_mode)
|
||||
{
|
||||
case PS_ROUND_UP:
|
||||
return ceil($val * 100)/100;
|
||||
case PS_ROUND_DOWN:
|
||||
return floor($val * 100)/100;
|
||||
default:
|
||||
return round($val, 2);
|
||||
}
|
||||
}
|
||||
|
||||
function mo_duplicateTables()
|
||||
{
|
||||
Db::getInstance()->execute('CREATE TABLE `'._DB_PREFIX_.'orders_2` LIKE `'._DB_PREFIX_.'orders`');
|
||||
Db::getInstance()->execute('CREATE TABLE `'._DB_PREFIX_.'order_detail_2` LIKE `'._DB_PREFIX_.'order_detail`');
|
||||
}
|
||||
|
||||
function mo_renameTables()
|
||||
{
|
||||
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'orders`');
|
||||
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'order_detail`');
|
||||
|
||||
Db::getInstance()->execute('RENAME TABLE `'._DB_PREFIX_.'orders_2` TO `'._DB_PREFIX_.'orders`');
|
||||
Db::getInstance()->execute('RENAME TABLE `'._DB_PREFIX_.'order_detail_2` TO `'._DB_PREFIX_.'order_detail`');
|
||||
}
|
||||
|
||||
function mo_getCustomerDefaultGroup($id_customer)
|
||||
{
|
||||
static $cache;
|
||||
if (!isset($cache[$id_customer]))
|
||||
$cache[$id_customer] = Db::getInstance()->getValue('SELECT `id_default_group` FROM `'._DB_PREFIX_.'customer` WHERE `id_customer` = '.(int)$id_customer);
|
||||
|
||||
return $cache[$id_customer];
|
||||
}
|
||||
|
||||
function mo_getPriceDisplayMethod($id_group)
|
||||
{
|
||||
static $cache;
|
||||
|
||||
if (!isset($cache[$id_group]))
|
||||
$cache[$id_group] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT `price_display_method`
|
||||
FROM `'._DB_PREFIX_.'group`
|
||||
WHERE `id_group` = '.(int)$id_group);
|
||||
|
||||
return $cache[$id_group];
|
||||
}
|
||||
|
||||
function mo_setProductPrices($row, $tax_calculation_method)
|
||||
{
|
||||
if ($tax_calculation_method == PS_TAX_EXC)
|
||||
$row['product_price'] = mo_ps_round($row['product_price']);
|
||||
else
|
||||
$row['product_price_wt'] = mo_ps_round($row['product_price'] * (1 + $row['tax_rate'] / 100));
|
||||
|
||||
$group_reduction = 1;
|
||||
if ($row['group_reduction'] > 0)
|
||||
$group_reduction = 1 - $row['group_reduction'] / 100;
|
||||
|
||||
if ($row['reduction_percent'] != 0)
|
||||
{
|
||||
if ($tax_calculation_method == PS_TAX_EXC)
|
||||
$row['product_price'] = ($row['product_price'] - $row['product_price'] * ($row['reduction_percent'] * 0.01));
|
||||
else
|
||||
{
|
||||
$reduction = mo_ps_round($row['product_price_wt'] * ($row['reduction_percent'] * 0.01));
|
||||
$row['product_price_wt'] = mo_ps_round(($row['product_price_wt'] - $reduction));
|
||||
}
|
||||
}
|
||||
|
||||
if ($row['reduction_amount'] != 0)
|
||||
{
|
||||
if ($tax_calculation_method == PS_TAX_EXC)
|
||||
$row['product_price'] = ($row['product_price'] - ($row['reduction_amount'] / (1 + $row['tax_rate'] / 100)));
|
||||
else
|
||||
$row['product_price_wt'] = mo_ps_round(($row['product_price_wt'] - $row['reduction_amount']));
|
||||
}
|
||||
|
||||
if ($row['group_reduction'] > 0)
|
||||
{
|
||||
if ($tax_calculation_method == PS_TAX_EXC)
|
||||
$row['product_price'] = $row['product_price'] * $group_reduction;
|
||||
else
|
||||
$row['product_price_wt'] = mo_ps_round($row['product_price_wt'] * $group_reduction);
|
||||
}
|
||||
|
||||
if (($row['reduction_percent'] OR $row['reduction_amount'] OR $row['group_reduction']) AND $tax_calculation_method == PS_TAX_EXC)
|
||||
$row['product_price'] = mo_ps_round($row['product_price']);
|
||||
|
||||
if ($tax_calculation_method == PS_TAX_EXC)
|
||||
$row['product_price_wt'] = mo_ps_round($row['product_price'] * (1 + ($row['tax_rate'] * 0.01))) + mo_ps_round($row['ecotax'] * (1 + $row['ecotax_tax_rate'] / 100));
|
||||
else
|
||||
{
|
||||
$row['product_price_wt_but_ecotax'] = $row['product_price_wt'];
|
||||
$row['product_price_wt'] = mo_ps_round($row['product_price_wt'] + $row['ecotax'] * (1 + $row['ecotax_tax_rate'] / 100));
|
||||
}
|
||||
|
||||
$row['total_wt'] = $row['product_quantity'] * $row['product_price_wt'];
|
||||
$row['total_price'] = $row['product_quantity'] * $row['product_price'];
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function moduleReinstaller($moduleName, $force = false)
|
||||
{
|
||||
$module = Module::getInstanceByName($moduleName);
|
||||
if (!is_object($module))
|
||||
die(Tools::displayError());
|
||||
if ($module->uninstall() OR $force)
|
||||
return $module->install();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
function move_crossselling()
|
||||
{
|
||||
|
||||
if (Db::getInstance()->executeS('SELECT FROM `'._DB_PREFIX_.'module` WHERE `name` = \'crossselling\''))
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`)
|
||||
VALUES ((SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \'crossselling\'), 9, (SELECT max_position FROM (SELECT MAX(position)+1 as max_position FROM `'._DB_PREFIX_.'hook_module` WHERE `id_hook` = 9) tmp))');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/* Convert product prices from the PS < 1.3 wrong rounding system to the new 1.3 one */
|
||||
function convert_product_price()
|
||||
{
|
||||
$taxes = Tax::getTaxes();
|
||||
$taxRates = array();
|
||||
foreach ($taxes as $data)
|
||||
$taxRates[$data['id_tax']] = (float)($data['rate']) / 100;
|
||||
$results = DB::getInstance()->executeS('SELECT `id_product`, `price`, `id_tax` FROM `'._DB_PREFIX_.'product`');
|
||||
foreach ($results as $row)
|
||||
if ($row['id_tax'])
|
||||
{
|
||||
$price = $row['price'] * (1 + $taxRates[$row['id_tax']]);
|
||||
$decimalPart = $price - (int)$price;
|
||||
if ($decimalPart < 0.000001)
|
||||
{
|
||||
$newPrice = (float)(number_format($price, 6, '.', ''));
|
||||
$newPrice = Tools::floorf($newPrice / (1 + $taxRates[$row['id_tax']]), 6);
|
||||
DB::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET `price` = '.$newPrice.' WHERE `id_product` = '.(int)$row['id_product']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Regenerate the entire category tree level_depth
|
||||
*/
|
||||
function regenerate_level_depth()
|
||||
{
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'category` SET `level_depth` = 0 WHERE `id_category` = 1');
|
||||
regenerate_children_categories(1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively regenerate the level_depth of this category's children
|
||||
*
|
||||
* @param int $id_category
|
||||
* @param int $level_depth
|
||||
*/
|
||||
function regenerate_children_categories($id_category, $level_depth)
|
||||
{
|
||||
$categories = Db::getInstance()->executeS('SELECT `id_category` FROM `'._DB_PREFIX_.'category` WHERE `id_parent` = '.(int)$id_category);
|
||||
if (!$categories)
|
||||
return;
|
||||
$new_depth = (int)$level_depth + 1;
|
||||
$cat_ids = "";
|
||||
foreach($categories as $category)
|
||||
{
|
||||
$cat_ids .= (string)$category['id_category'].',';
|
||||
regenerate_children_categories($category['id_category'], $new_depth);
|
||||
}
|
||||
$cat_ids = substr($cat_ids, 0, -1);
|
||||
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'category` SET `level_depth` = '.(int)$new_depth.' WHERE `id_category` IN ('.$cat_ids.')');
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* Removes duplicates from table category_group caused by a bug in category importing in PS < 1.4.2
|
||||
*/
|
||||
function remove_duplicate_category_groups()
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT `id_category`, `id_group`, COUNT(*) as `count`
|
||||
FROM `'._DB_PREFIX_.'category_group`
|
||||
GROUP BY `id_category`, `id_group`
|
||||
ORDER BY `count` DESC');
|
||||
|
||||
foreach($result as $row)
|
||||
{
|
||||
if ((int)$row['count'] > 1)
|
||||
{
|
||||
$limit = (int)$row['count'] - 1;
|
||||
$result = Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'category_group`
|
||||
WHERE `id_category` = '.$row['id_category'].' AND `id_group` = '.$row['id_group'].'
|
||||
LIMIT '.$limit);
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function remove_module_from_hook($module_name, $hook_name)
|
||||
{
|
||||
$result = false;
|
||||
|
||||
$id_module = Db::getInstance()->getValue('
|
||||
SELECT `id_module` FROM `'._DB_PREFIX_.'module`
|
||||
WHERE `name` = \''.pSQL($module_name).'\''
|
||||
);
|
||||
|
||||
if ((int)$id_module > 0)
|
||||
{
|
||||
$id_hook = Db::getInstance()->getValue('
|
||||
SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = \''.pSQL($hook_name).'\'
|
||||
');
|
||||
|
||||
if ((int)$id_hook > 0)
|
||||
{
|
||||
$result = Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'hook_module`
|
||||
WHERE `id_module` = '.(int)$id_module.' AND `id_hook` = '.(int)$id_hook);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
|
||||
function remove_tab($tabname)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
DELETE t, l
|
||||
FROM `'._DB_PREFIX_.'tab` t LEFT JOIN `'._DB_PREFIX_.'tab_lang` l ON (t.id_tab = l.id_tab)
|
||||
WHERE t.`class_name` = '.pSQL($tabname));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
<?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: 7040 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function reorderpositions()
|
||||
{
|
||||
/* Clean products positions */
|
||||
if ($cat = Category::getCategories(1, false, false))
|
||||
foreach($cat AS $i => $categ)
|
||||
Product::cleanPositions((int)$categ['id_category']);
|
||||
|
||||
//clean Category position and delete old position system
|
||||
Language::loadLanguages();
|
||||
$language = Language::getLanguages();
|
||||
$cat_parent = Db::getInstance()->executeS('SELECT DISTINCT c.id_parent FROM `'._DB_PREFIX_.'category` c WHERE id_category != 1');
|
||||
foreach($cat_parent AS $parent)
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT c.*, cl.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)(Configuration::get('PS_LANG_DEFAULT')).')
|
||||
WHERE c.id_parent = '.(int)($parent['id_parent']).'
|
||||
ORDER BY name ASC');
|
||||
foreach($result AS $i => $categ)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'category`
|
||||
SET `position` = '.(int)($i).'
|
||||
WHERE `id_parent` = '.(int)($categ['id_parent']).'
|
||||
AND `id_category` = '.(int)($categ['id_category']));
|
||||
}
|
||||
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT c.*, cl.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`)
|
||||
WHERE c.id_parent = '.(int)($parent['id_parent']).'
|
||||
ORDER BY name ASC');
|
||||
|
||||
// Remove number from category name
|
||||
foreach($result AS $i => $categ)
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`)
|
||||
SET `name` = \''.preg_replace('/^[0-9]+\./', '',$categ['name']).'\'
|
||||
WHERE c.id_category = '.(int)($categ['id_category']).' AND id_lang = \''.(int)($categ['id_lang']).'\'');
|
||||
}
|
||||
|
||||
/* Clean CMS positions */
|
||||
if ($cms_cat = CMSCategory::getCategories(1, false, false))
|
||||
foreach($cms_cat AS $i => $categ)
|
||||
CMS::cleanPositions((int)($categ['id_cms_category']));
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
function set_product_suppliers()
|
||||
{
|
||||
$ps_currency_default = Db::getInstance()->getValue('SELECT value
|
||||
FROM `'._DB_PREFIX_.'configuration` WHERE name="PS_CURRENCY_DEFAULT"');
|
||||
|
||||
//Get all products with positive quantity
|
||||
$resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->query('
|
||||
SELECT id_supplier, id_product, supplier_reference, wholesale_price
|
||||
FROM `'._DB_PREFIX_.'product`
|
||||
WHERE `id_supplier` > 0
|
||||
');
|
||||
|
||||
while ($row = Db::getInstance()->nextRow($resource))
|
||||
{
|
||||
//Set default supplier for product
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'product_supplier`
|
||||
(`id_product`, `id_product_attribute`, `id_supplier`,
|
||||
`product_supplier_reference`, `product_supplier_price_te`,
|
||||
`id_currency`)
|
||||
VALUES
|
||||
("'.(int)$row['id_product'].'", "0", "'.(int)$row['id_supplier'].'",
|
||||
"'.(int)$row['supplier_reference'].'", "'.(int)$row['wholesale_price'].'",
|
||||
"'.(int)$ps_currency_default.'"
|
||||
');
|
||||
|
||||
//Try to get product attribues
|
||||
$attributes = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT id_product_attribute, supplier_reference, wholesale_price
|
||||
FROM `'._DB_PREFIX_.'product_attribute`
|
||||
WHERE `id_product` = '.(int)$row['id_product']
|
||||
);
|
||||
|
||||
//Add each attribute to stock_available
|
||||
foreach ($attributes as $attribute)
|
||||
{
|
||||
// set supplier for attribute
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'product_supplier`
|
||||
(`id_product`, `id_product_attribute`,
|
||||
`id_supplier`, `product_supplier_reference`,
|
||||
`product_supplier_price_te`, `id_currency`)
|
||||
VALUES
|
||||
("'.(int)$row['id_product'].'", "'.(int)$attribute['id_product_attribute'].'",
|
||||
"'.(int)$row['id_supplier'].'", "'.(int)$attribute['supplier_reference'].'",
|
||||
"'.(int)$attribute['wholesale_price'].'", "'.(int)$ps_currency_default.'")
|
||||
');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
function set_stock_available()
|
||||
{
|
||||
//Get all products with positive quantity
|
||||
$resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->query('
|
||||
SELECT quantity, id_product, out_of_stock
|
||||
FROM `'._DB_PREFIX_.'product`
|
||||
WHERE `active` = 1
|
||||
');
|
||||
|
||||
while ($row = Db::getInstance()->nextRow($resource))
|
||||
{
|
||||
$quantity = 0;
|
||||
|
||||
//Try to get product attribues
|
||||
$attributes = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT quantity, id_product_attribute
|
||||
FROM `'._DB_PREFIX_.'product_attribute`
|
||||
WHERE `id_product` = '.(int)$row['id_product']
|
||||
);
|
||||
|
||||
//Add each attribute to stock_available
|
||||
foreach ($attributes as $attribute)
|
||||
{
|
||||
// add to global quantity
|
||||
$quantity += $attribute['quantity'];
|
||||
|
||||
//add stock available for attributes
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'stock_available`
|
||||
(`id_product`, `id_product_attribute`, `id_shop`, `id_group_shop`, `quantity`, `depends_on_stock`, `out_of_stock`)
|
||||
VALUES
|
||||
("'.(int)$row['id_product'].'", "'.(int)$attribute['id_product_attribute'].'", "1", "0", "'.(int)$attribute['quantity'].'", "0", "'.(int)$row['out_of_stock'].'")
|
||||
');
|
||||
}
|
||||
|
||||
if (count($attributes) == 0)
|
||||
$quantity = (int)$row['quantity'];
|
||||
|
||||
if ($quantity == 0)
|
||||
continue;
|
||||
|
||||
//Add stock available for product
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'stock_available`
|
||||
(`id_product`, `id_product_attribute`, `id_shop`, `id_group_shop`, `quantity`, `depends_on_stock`, `out_of_stock`)
|
||||
VALUES
|
||||
("'.(int)$row['id_product'].'", "0", "1", "0", "'.(int)$quantity.'", "0", "'.(int)$row['out_of_stock'].'")
|
||||
');
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function setAllGroupsOnHomeCategory()
|
||||
{
|
||||
$results = Group::getGroups(Configuration::get('PS_LANG_DEFAULT'));
|
||||
$groups = array();
|
||||
foreach ($results AS $result)
|
||||
$groups[] = $result['id_group'];
|
||||
if (is_array($groups) && sizeof($groups))
|
||||
{
|
||||
$category = new Category(1);
|
||||
$category->cleanGroups();
|
||||
$category->addGroups($groups);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function set_discount_category()
|
||||
{
|
||||
$discounts = Db::getInstance()->executeS('SELECT `id_discount` FROM `'._DB_PREFIX_.'discount`');
|
||||
$categories = Db::getInstance()->executeS('SELECT `id_category` FROM `'._DB_PREFIX_.'category`');
|
||||
foreach ($discounts AS $discount)
|
||||
foreach ($categories AS $category)
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'discount_category` (`id_discount`,`id_category`) VALUES ('.(int)($discount['id_discount']).','.(int)($category['id_category']).')');
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function set_payment_module()
|
||||
{
|
||||
// Get all modules then select only payment ones
|
||||
$modules = Module::getModulesInstalled();
|
||||
foreach ($modules AS $module)
|
||||
{
|
||||
$file = _PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php';
|
||||
if (!file_exists($file))
|
||||
continue;
|
||||
$fd = fopen($file, 'r');
|
||||
if (!$fd)
|
||||
continue ;
|
||||
$content = fread($fd, filesize($file));
|
||||
if (preg_match_all('/extends PaymentModule/U', $content, $matches))
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'module_country` (id_module, id_country)
|
||||
SELECT '.(int)($module['id_module']).', id_country FROM `'._DB_PREFIX_.'country` WHERE active = 1');
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'module_currency` (id_module, id_currency)
|
||||
SELECT '.(int)($module['id_module']).', id_currency FROM `'._DB_PREFIX_.'currency` WHERE deleted = 0');
|
||||
}
|
||||
fclose($fd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function set_payment_module_group()
|
||||
{
|
||||
// Get all modules then select only payment ones
|
||||
$modules = Module::getModulesInstalled();
|
||||
foreach ($modules AS $module)
|
||||
{
|
||||
$file = _PS_MODULE_DIR_.$module['name'].'/'.$module['name'].'.php';
|
||||
if (!file_exists($file))
|
||||
continue;
|
||||
$fd = @fopen($file, 'r');
|
||||
if (!$fd)
|
||||
continue ;
|
||||
$content = fread($fd, filesize($file));
|
||||
if (preg_match_all('/extends PaymentModule/U', $content, $matches))
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'module_group` (id_module, id_group)
|
||||
SELECT '.(int)($module['id_module']).', id_group FROM `'._DB_PREFIX_.'group`');
|
||||
}
|
||||
fclose($fd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function shop_url()
|
||||
{
|
||||
if (!($host = Configuration::get('CANONICAL_URL')))
|
||||
$host = Tools::getHttpHost();
|
||||
Configuration::updateValue('PS_SHOP_DOMAIN', $host);
|
||||
Configuration::updateValue('PS_SHOP_DOMAIN_SSL', $host);
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function update_carrier_url()
|
||||
{
|
||||
// Get all carriers
|
||||
$sql = '
|
||||
SELECT c.`id_carrier`, c.`url`
|
||||
FROM `'._DB_PREFIX_.'carrier` c';
|
||||
$carriers = Db::getInstance()->executeS($sql);
|
||||
|
||||
// Check each one and erase carrier URL if not correct URL
|
||||
foreach ($carriers as $carrier)
|
||||
if (!Validate::isAbsoluteUrl($carrier['url']))
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'carrier`
|
||||
SET `url` = \'\'
|
||||
WHERE `id_carrier`= '.(int)($carrier['id_carrier']));
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
function update_feature_detachable_cache()
|
||||
{
|
||||
$array_features = array(
|
||||
'PS_SPECIFIC_PRICE_FEATURE_ACTIVE' => 'specific_price',
|
||||
'PS_SCENE_FEATURE_ACTIVE' => 'scene',
|
||||
'PS_PRODUCT_DOWNLOAD_FEATURE_ACTIVE' => 'product_download',
|
||||
'PS_CUSTOMIZATION_FEATURE_ACTIVE' => 'customization_field',
|
||||
'PS_CART_RULE_FEATURE_ACTIVE' => 'cart_rule',
|
||||
'PS_GROUP_FEATURE_ACTIVE' => 'group',
|
||||
'PS_PACK_FEATURE_ACTIVE' => 'pack',
|
||||
'PS_ALIAS_FEATURE_ACTIVE' => 'alias',
|
||||
);
|
||||
$res = true;
|
||||
foreach ($array_features as $config_key => $feature)
|
||||
{
|
||||
// array_features is an array defined above, so please don't add bqSql !
|
||||
$count = (int)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.$feature.'`');
|
||||
$res &= Db::getInstance()->execute('REPLACE INTO `'._DB_PREFIX_.'configuration` (name, value) values ("'.$config_key.'", "'.$count.'"');
|
||||
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
function update_for_13version()
|
||||
{
|
||||
global $oldversion;
|
||||
|
||||
if (version_compare($oldversion, '1.4.0.1') >= 0)
|
||||
return; // if the old version is a 1.4 version
|
||||
|
||||
// Disable the Smarty 3
|
||||
Configuration::updateValue('PS_FORCE_SMARTY_2', 1);
|
||||
// Disable the URL rewritting
|
||||
Configuration::updateValue('PS_REWRITING_SETTINGS', 0);
|
||||
// Disable Canonical redirection
|
||||
Configuration::updateValue('PS_CANONICAL_REDIRECT', 0);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function update_image_size_in_db()
|
||||
{
|
||||
if (file_exists(realpath(INSTALL_PATH.'/../img').'/logo.jpg'))
|
||||
{
|
||||
list($width, $height, $type, $attr) = getimagesize(realpath(INSTALL_PATH.'/../img').'/logo.jpg');
|
||||
Configuration::updateValue('SHOP_LOGO_WIDTH', (int)round($width));
|
||||
Configuration::updateValue('SHOP_LOGO_HEIGHT', (int)round($height));
|
||||
}
|
||||
if (file_exists(realpath(INSTALL_PATH.'/../modules/editorial').'/homepage_logo.jpg'))
|
||||
{
|
||||
list($width, $height, $type, $attr) = getimagesize(realpath(INSTALL_PATH.'/../modules/editorial').'/homepage_logo.jpg');
|
||||
Configuration::updateValue('EDITORIAL_IMAGE_WIDTH', (int)round($width));
|
||||
Configuration::updateValue('EDITORIAL_IMAGE_HEIGHT', (int)round($height));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function update_module_followup()
|
||||
{
|
||||
Configuration::loadConfiguration();
|
||||
$followup = Module::getInstanceByName('followup');
|
||||
if (!$followup->id)
|
||||
return;
|
||||
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'log_email` ADD INDEX `date_add`(`date_add`), ADD INDEX `id_cart`(`id_cart`);');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
// backward compatibility vouchers should be available in all categories
|
||||
function update_module_loyalty()
|
||||
{
|
||||
if (Configuration::get('PS_LOYALTY_POINT_VALUE') !== false)
|
||||
{
|
||||
$category_list = '';
|
||||
|
||||
foreach(Category::getSimpleCategories(Configuration::get('PS_LANG_DEFAULT')) as $category)
|
||||
$category_list .= $category['id_category'].',';
|
||||
|
||||
if (!empty($category_list))
|
||||
{
|
||||
$category_list = rtrim($category_list, ',');
|
||||
Configuration::updateValue('PS_LOYALTY_VOUCHER_CATEGORY', $category_list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
function update_modules_multishop()
|
||||
{
|
||||
$block_cms_installed = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'module` WHERE name = "blockcms"');
|
||||
if($block_cms_installed)
|
||||
{
|
||||
Db::getInstance()->execute('CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'blocklink_shop` (
|
||||
`id_blocklink` int(2) NOT NULL AUTO_INCREMENT,
|
||||
`id_shop` varchar(255) NOT NULL,
|
||||
PRIMARY KEY(`id_blocklink`, `id_shop`))
|
||||
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8');
|
||||
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_shop` (
|
||||
`id_cms_block` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_shop` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_cms_block`, `id_shop`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8');
|
||||
|
||||
Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'cms_block_shop (cms_block, id_shop)
|
||||
(SELECT id_cms_block, 1 FROM '._DB_PREFIX_.'cms_block)');
|
||||
}
|
||||
|
||||
$block_link_installed = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'module` WHERE name = "blocklink"');
|
||||
if($block_link_installed)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'blocklink_shop` (
|
||||
`id_blocklink` int(2) NOT NULL AUTO_INCREMENT,
|
||||
`id_shop` varchar(255) NOT NULL,
|
||||
PRIMARY KEY(`id_blocklink`, `id_shop`))
|
||||
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8');
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'blocklink_shop` (id_blocklink, id_shop)
|
||||
(SELECT id_blocklink, 1 FROM `'._DB_PREFIX_.'blocklink`)');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
function update_order_canada()
|
||||
{
|
||||
$sql ='SHOW TABLES LIKE \''._DB_PREFIX_.'order_tax\'';
|
||||
$table = Db::getInstance()->ExecuteS($sql);
|
||||
|
||||
if (!count($table))
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'order_tax` (
|
||||
`id_order` int(11) NOT NULL,
|
||||
`tax_name` varchar(40) NOT NULL,
|
||||
`tax_rate` decimal(6,3) NOT NULL,
|
||||
`amount` decimal(20,6) NOT NULL
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8');
|
||||
|
||||
|
||||
$address_field = Configuration::get('PS_TAX_ADDRESS_TYPE');
|
||||
$sql = 'SELECT `id_order`
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
LEFT JOIN `'._DB_PREFIX_.'address` a ON (a.`id_address` = o.`'.bqSQL($address_field).'`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'country` c ON (c.`id_country` = a.`id_country`)
|
||||
WHERE c.`iso_code` = "CA"';
|
||||
|
||||
$id_order_list = Db::getInstance()->ExecuteS($sql);
|
||||
|
||||
$values = '';
|
||||
foreach ($id_order_list as $id_order)
|
||||
{
|
||||
$amount = array();
|
||||
$id_order = $id_order['id_order'];
|
||||
$order = new Order((int)$id_order);
|
||||
if (!Validate::isLoadedObject($order))
|
||||
continue;
|
||||
|
||||
$products = $order->getProducts();
|
||||
foreach ($products as $product)
|
||||
{
|
||||
if (!array_key_exists($product['tax_name'], $amount))
|
||||
$amount[$product['tax_name']] = array('amount' => 0, 'rate' => $product['tax_rate']);
|
||||
|
||||
if ($order->getTaxCalculationMethod() == PS_TAX_EXC)
|
||||
{
|
||||
$total_product = $product['product_price'] * $product['product_quantity'];
|
||||
$amount_tmp = Tools::ps_round($total_product * ($product['tax_rate'] / 100), 2);
|
||||
$amount[$product['tax_name']]['amount'] += Tools::ps_round($total_product * ($product['tax_rate'] / 100), 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$total_product = $product['product_price'] * $product['product_quantity'];
|
||||
$amount_tmp = Tools::ps_round($total_product - ($total_product / (1 + ($product['tax_rate'] / 100))), 2);
|
||||
$amount[$product['tax_name']]['amount'] += Tools::ps_round($total_product - ($total_product / (1 + ($product['tax_rate'] / 100))), 2);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($amount as $tax_name => $tax_infos)
|
||||
$values .= '('.(int)$order->id.', \''.pSQL($tax_name).'\', \''.pSQL($tax_infos['rate']).'\', '.(float)$tax_infos['amount'].'),';
|
||||
unset($order);
|
||||
}
|
||||
|
||||
if (!empty($values))
|
||||
{
|
||||
$values = rtrim($values, ",");
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'order_tax` (id_order, tax_name, tax_rate, amount)
|
||||
VALUES '.$values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
function update_order_detail_taxes()
|
||||
{
|
||||
$order_detail_taxes = Db::getInstance()->executeS('
|
||||
SELECT `id_order_detail`, `tax_name`, `tax_rate` FROM `'._DB_PREFIX_.'order_detail`
|
||||
');
|
||||
$id_lang_list = Db::getInstance()->executeS('SELECT id_lang FROM `'._DB_PREFIX_.'lang`');
|
||||
|
||||
foreach ($order_detail_taxes as $order_detail_tax)
|
||||
{
|
||||
if ($order_detail_tax['tax_rate'] == '0.000')
|
||||
continue;
|
||||
|
||||
$alternative_tax_name = 'Tax '.$order_detail_tax['tax_rate'];
|
||||
$create_tax = true;
|
||||
$id_tax = (int)Db::getInstance()->getValue('SELECT t.`id_tax`
|
||||
FROM `'._DB_PREFIX_.'tax` t
|
||||
LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (tl.id_tax = t.id_tax)
|
||||
WHERE tl.`name` = \''.pSQL($order_detail_tax['tax_name']).'\' ');
|
||||
$id_tax_alt = (int)Db::getInstance()->getValue('SELECT t.`id_tax`
|
||||
FROM `'._DB_PREFIX_.'tax` t
|
||||
LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (tl.id_tax = t.id_tax)
|
||||
WHERE tl.`name` = \''.pSQL($alternative_tax_name).'\' ');
|
||||
|
||||
if ( $id_tax || $id_tax_alt)
|
||||
{
|
||||
$create_tax = !(bool)Db::getInstance()->getValue('SELECT count(*)
|
||||
FROM `'._DB_PREFIX_.'tax`
|
||||
WHERE id_tax = '. (int)$id_tax .'
|
||||
AND rate = "'.pSql($order_detail_tax['tax_rate']).'"
|
||||
');
|
||||
}
|
||||
|
||||
if ($create_tax)
|
||||
{
|
||||
$tax_name = (isset($order_detail_tax['tax_name']) ? $order_detail_tax['tax_name'] : $alternative_tax_name);
|
||||
|
||||
Db::getInstance()->Execute(
|
||||
'INSERT INTO `'._DB_PREFIX_.'tax` (`rate`, `active`, `deleted`)
|
||||
VALUES (\''.(float)$order_detail_tax['tax_rate'].'\', 0, 1)'
|
||||
);
|
||||
|
||||
$id_tax = Db::getInstance()->Insert_ID();
|
||||
foreach ($id_lang_list as $id_lang)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'tax_lang` (`id_tax`, `id_lang`, `name`)
|
||||
VALUES ('.(int)$id_tax.','.(int)$id_lang['id_lang'].',\''.pSQL($tax_name).'\')
|
||||
');
|
||||
}
|
||||
}
|
||||
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'order_detail_tax` (`id_order_detail`, `id_tax`)
|
||||
VALUES ('.(int)$order_detail_tax['id_order_detail'].','.$id_tax.')
|
||||
');
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function update_order_details()
|
||||
{
|
||||
$res = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'order_detail` LIKE \'reduction_percent\'');
|
||||
|
||||
if (sizeof($res) == 0)
|
||||
{
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `reduction_percent` DECIMAL(10, 2) NOT NULL default \'0.00\' AFTER `product_price`');
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `reduction_amount` DECIMAL(20, 6) NOT NULL default \'0.000000\' AFTER `reduction_percent`');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function update_products_ecotax_v133()
|
||||
{
|
||||
global $oldversion;
|
||||
if($oldversion < '1.3.3.0')
|
||||
{
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'product` SET `ecotax` = \'0\' WHERE 1');
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'order_detail` SET `ecotax` = \'0\' WHERE 1;');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
function update_stock_mvt_reason()
|
||||
{
|
||||
//Get all stock mvts reasons already presents in the solution (from 1.4.x)
|
||||
//Remove standard movements to keep only custom movement
|
||||
$mvts = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT smr.*
|
||||
FROM `'._DB_PREFIX_.'stock_mvt_reason`
|
||||
WHERE `id` > 5
|
||||
');
|
||||
|
||||
//Get all stock mvts reasons language traduction already presents in the solution (from 1.4.x)
|
||||
//Remove standard movements to keep only custom movement
|
||||
$mvts_lang = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT smrl.*
|
||||
FROM `'._DB_PREFIX_.'stock_movement_reason_lang`
|
||||
WHERE `id_stock_mvt_reason` > 5
|
||||
');
|
||||
|
||||
//Clean table
|
||||
Db::getInstance()->query('TRUNCATE TABLE `'._DB_PREFIX_.'stock_movement_reason`');
|
||||
Db::getInstance()->query('TRUNCATE TABLE `'._DB_PREFIX_.'stock_movement_reason_lang`');
|
||||
|
||||
//Recreate new standards movements
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `PREFIX_stock_mvt_reason` (`id_stock_mvt_reason`, `sign`, `date_add`, `date_upd`)
|
||||
VALUES
|
||||
(1, 1, NOW(), NOW()),
|
||||
(2, -1, NOW(), NOW()),
|
||||
(3, -1, NOW(), NOW()),
|
||||
(4, -1, NOW(), NOW()),
|
||||
(5, 1, NOW(), NOW()),
|
||||
(6, -1, NOW(), NOW()),
|
||||
(7, 1, NOW(), NOW()),
|
||||
(8, 1, NOW(), NOW())
|
||||
');
|
||||
|
||||
Db::getInstance()->execute("
|
||||
INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason`, `id_lang`, `name`)
|
||||
VALUES
|
||||
(1, 1, 'Increase'),
|
||||
(1, 2, 'Augmenter'),
|
||||
(1, 3, 'Aumentar'),
|
||||
(1, 4, 'Erhöhen'),
|
||||
(1, 5, 'Increase'),
|
||||
(2, 1, 'Decrease'),
|
||||
(2, 2, 'Diminuer'),
|
||||
(2, 3, 'Disminuir'),
|
||||
(2, 4, 'Reduzieren'),
|
||||
(2, 5, 'Decrease'),
|
||||
(3, 1, 'Customer Order'),
|
||||
(3, 2, 'Commande client'),
|
||||
(3, 3, 'Pedido'),
|
||||
(3, 4, 'Bestellung'),
|
||||
(3, 5, 'Ordine'),
|
||||
(4, 1, 'Regulation following an inventory of stock'),
|
||||
(4, 2, 'Régularisation du stock suite à un inventaire'),
|
||||
(4, 3, 'Regulation following an inventory of stock'),
|
||||
(4, 4, 'Regulation following an inventory of stock'),
|
||||
(4, 5, 'Regulation following an inventory of stock'),
|
||||
(5, 1, 'Regulation following an inventory of stock'),
|
||||
(5, 2, 'Régularisation du stock suite à un inventaire'),
|
||||
(5, 3, 'Regulation following an inventory of stock'),
|
||||
(5, 4, 'Regulation following an inventory of stock'),
|
||||
(5, 5, 'Regulation following an inventory of stock'),
|
||||
(6, 1, 'Transfer to another warehouse'),
|
||||
(6, 2, 'Transfert vers un autre entrepôt'),
|
||||
(6, 3, 'Transfer to another warehouse'),
|
||||
(6, 4, 'Transfer to another warehouse'),
|
||||
(6, 5, 'Transfer to another warehouse'),
|
||||
(7, 1, 'Transfer from another warehouse'),
|
||||
(7, 2, 'Transfert depuis un autre entrepôt'),
|
||||
(7, 3, 'Transfer from another warehouse'),
|
||||
(7, 4, 'Transfer from another warehouse'),
|
||||
(7, 5, 'Transfer from another warehouse'),
|
||||
(8, 1, 'Supply Order'),
|
||||
(8, 2, 'Commande fournisseur'),
|
||||
(8, 3, 'Supply Order'),
|
||||
(8, 4, 'Supply Order'),
|
||||
(8, 5, 'Supply Order')
|
||||
");
|
||||
|
||||
//Add custom movements
|
||||
if (is_array($mvts))
|
||||
{
|
||||
foreach ($mvts as $mvt)
|
||||
{
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `PREFIX_stock_mvt_reason` (`sign`, `date_add`, `date_upd`)
|
||||
VALUES ("'.(int)$mvt['sign'].'", "'.pSQL($mvt['date_add']).'", "'.pSQL($mvt['date_upd']).'")
|
||||
');
|
||||
|
||||
$row_id = Db::getInstance()->Insert_ID();
|
||||
|
||||
foreach ($mvts_lang as $mvt_lang)
|
||||
{
|
||||
if ($mvt_lang['id_stock_mvt_reason'] != $mvt['id'])
|
||||
continue;
|
||||
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason`, `id_lang`, `name`)
|
||||
VALUES ("'.(int)$row_id.'", "'.(int)$mvt_lang['id_lang'].'", "'.pSQL($mvt_lang['name']).'")
|
||||
');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function update_modules_sql()
|
||||
{
|
||||
Configuration::loadConfiguration();
|
||||
$blocklink = Module::getInstanceByName('blocklink');
|
||||
if ($blocklink->id)
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'blocklink_lang` ADD PRIMARY KEY (`id_link`, `id_lang`);');
|
||||
$productComments = Module::getInstanceByName('productcomments');
|
||||
if ($productComments->id)
|
||||
{
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_grade` ADD PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`);');
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_criterion` DROP PRIMARY KEY, ADD PRIMARY KEY (`id_product_comment_criterion`, `id_lang`);');
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_criterion_product` ADD PRIMARY KEY(`id_product`, `id_product_comment_criterion`);');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function updateproductcomments()
|
||||
{
|
||||
if (Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'product_comment') !== false)
|
||||
{
|
||||
Db::getInstance()->execute('CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'product_comment_criterion_lang (
|
||||
`id_product_comment_criterion` INT( 11 ) UNSIGNED NOT NULL ,
|
||||
`id_lang` INT(11) UNSIGNED NOT NULL ,
|
||||
`name` VARCHAR(64) NOT NULL ,
|
||||
PRIMARY KEY ( `id_product_comment_criterion` , `id_lang` )
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8');
|
||||
Db::getInstance()->execute('CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'product_comment_criterion_category (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product_comment_criterion`, `id_category`),
|
||||
KEY `id_category` (`id_category`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `id_guest` INT(11) NULL AFTER `id_customer`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `customer_name` varchar(64) NULL AFTER `content`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `deleted` tinyint(1) NOT NULL AFTER `validate`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_customer)');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_guest)');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_product)');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion DROP `id_lang`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion DROP `name`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion ADD `id_product_comment_criterion_type` tinyint(1) NOT NULL AFTER `id_product_comment_criterion`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion ADD `active` tinyint(1) NOT NULL AFTER `id_product_comment_criterion_type`');
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment` ADD `title` VARCHAR(64) NULL AFTER `id_guest`;');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
function updatetabicon_from_11version()
|
||||
{
|
||||
global $oldversion;
|
||||
if (version_compare($oldversion,'1.5.0.0','<'))
|
||||
{
|
||||
|
||||
$rows = Db::getInstance()->executeS('SELECT `id_tab`,`class_name` FROM '._DB_PREFIX_.'tab');
|
||||
if (sizeof($rows))
|
||||
{
|
||||
$img_dir = scandir(_PS_IMG_DIR_.'/t/');
|
||||
$result = true;
|
||||
foreach ($rows as $tab)
|
||||
{
|
||||
if (file_exists(_PS_IMG_DIR_.'/t/'.$tab['id_tab'].'.gif')
|
||||
AND !file_exists(_PS_IMG_DIR_.'/t/'.$tab['class_name'].'.gif'))
|
||||
$result &= rename(_PS_IMG_DIR_.'/t/'.$tab['id_tab'].'.gif',_PS_IMG_DIR_.'/t/'.$tab['class_name'].'.gif');
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
<?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: 6844 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if(!defined('_PS_MAGIC_QUOTES_GPC_'))
|
||||
define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc());
|
||||
|
||||
function latin1_database_to_utf8()
|
||||
{
|
||||
global $requests, $warningExist;
|
||||
|
||||
$tables = array(
|
||||
array('name' => 'address', 'id' => 'id_address', 'fields' => array('alias', 'company', 'name', 'surname', 'address1', 'address2', 'postcode', 'city', 'other', 'phone', 'phone_mobile')),
|
||||
array('name' => 'alias', 'id' => 'id_alias', 'fields' => array('alias', 'search')),
|
||||
array('name' => 'attribute_group_lang', 'id' => 'id_attribute_group', 'lang' => true, 'fields' => array('name', 'public_name')),
|
||||
array('name' => 'attribute_lang', 'id' => 'id_attribute', 'lang' => true, 'fields' => array('name')),
|
||||
array('name' => 'carrier', 'id' => 'id_carrier', 'fields' => array('name', 'url')),
|
||||
array('name' => 'carrier_lang', 'id' => 'id_carrier', 'lang' => true, 'fields' => array('delay')),
|
||||
array('name' => 'cart', 'id' => 'id_cart', 'fields' => array('gift_message')),
|
||||
array('name' => 'category_lang', 'id' => 'id_category', 'lang' => true, 'fields' => array('name', 'description', 'link_rewrite', 'meta_title', 'meta_keywords', 'meta_description')),
|
||||
array('name' => 'configuration', 'id' => 'id_configuration', 'fields' => array('name', 'value')),
|
||||
array('name' => 'configuration_lang', 'id' => 'id_configuration', 'lang' => true, 'fields' => array('value')),
|
||||
array('name' => 'contact', 'id' => 'id_contact', 'fields' => array('email')),
|
||||
array('name' => 'contact_lang', 'id' => 'id_contact', 'lang' => true, 'fields' => array('name', 'description')),
|
||||
array('name' => 'country', 'id' => 'id_country', 'fields' => array('iso_code')),
|
||||
array('name' => 'country_lang', 'id' => 'id_country', 'lang' => true, 'fields' => array('name')),
|
||||
array('name' => 'currency', 'id' => 'id_currency', 'fields' => array('name', 'iso_code', 'sign')),
|
||||
array('name' => 'customer', 'id' => 'id_customer', 'fields' => array('email', 'passwd', 'name', 'surname')),
|
||||
array('name' => 'discount', 'id' => 'id_discount', 'fields' => array('name')),
|
||||
array('name' => 'discount_lang', 'id' => 'id_discount', 'lang' => true, 'fields' => array('description')),
|
||||
array('name' => 'discount_type_lang', 'id' => 'id_discount_type', 'lang' => true, 'fields' => array('name')),
|
||||
array('name' => 'employee', 'id' => 'id_employee', 'fields' => array('name', 'surname', 'email', 'passwd')),
|
||||
array('name' => 'feature_lang', 'id' => 'id_feature', 'lang' => true, 'fields' => array('name')),
|
||||
array('name' => 'feature_value_lang', 'id' => 'id_feature_value', 'lang' => true, 'fields' => array('value')),
|
||||
array('name' => 'hook', 'id' => 'id_hook', 'fields' => array('name', 'title', 'description')),
|
||||
array('name' => 'hook_module_exceptions', 'id' => 'id_hook_module_exceptions', 'fields' => array('file_name')),
|
||||
array('name' => 'image_lang', 'id' => 'id_image', 'lang' => true, 'fields' => array('legend')),
|
||||
array('name' => 'image_type', 'id' => 'id_image_type', 'fields' => array('name')),
|
||||
array('name' => 'lang', 'id' => 'id_lang', 'fields' => array('name', 'iso_code')),
|
||||
array('name' => 'manufacturer', 'id' => 'id_manufacturer', 'fields' => array('name')),
|
||||
array('name' => 'message', 'id' => 'id_message', 'fields' => array('message')),
|
||||
array('name' => 'module', 'id' => 'id_module', 'fields' => array('name')),
|
||||
array('name' => 'orders', 'id' => 'id_order', 'fields' => array('payment', 'module', 'gift_message', 'shipping_number')),
|
||||
array('name' => 'order_detail', 'id' => 'id_order_detail', 'fields' => array('product_name', 'product_reference', 'tax_name', 'download_hash')),
|
||||
array('name' => 'order_discount', 'id' => 'id_order_discount', 'fields' => array('name')),
|
||||
array('name' => 'order_state', 'id' => 'id_order_state', 'fields' => array('color')),
|
||||
array('name' => 'order_state_lang', 'id' => 'id_order_state', 'lang' => true, 'fields' => array('name', 'template')),
|
||||
array('name' => 'product', 'id' => 'id_product', 'fields' => array('ean13', 'reference')),
|
||||
array('name' => 'product_attribute', 'id' => 'id_product_attribute', 'fields' => array('reference', 'ean13')),
|
||||
array('name' => 'product_download', 'id' => 'id_product_download', 'fields' => array('display_filename', 'filename')),
|
||||
array('name' => 'product_lang', 'id' => 'id_product', 'lang' => true, 'fields' => array('description', 'description_short', 'link_rewrite', 'meta_description', 'meta_keywords', 'meta_title', 'name', 'availability')),
|
||||
array('name' => 'profile_lang', 'id' => 'id_profile', 'lang' => true, 'fields' => array('name')),
|
||||
array('name' => 'quick_access', 'id' => 'id_quick_access', 'fields' => array('link')),
|
||||
array('name' => 'quick_access_lang', 'id' => 'id_quick_access', 'lang' => true, 'fields' => array('name')),
|
||||
array('name' => 'supplier', 'id' => 'id_supplier', 'fields' => array('name')),
|
||||
array('name' => 'tab', 'id' => 'id_tab', 'fields' => array('class_name')),
|
||||
array('name' => 'tab_lang', 'id' => 'id_tab', 'lang' => true, 'fields' => array('name')),
|
||||
array('name' => 'tag', 'id' => 'id_tag', 'fields' => array('name')),
|
||||
array('name' => 'tax_lang', 'id' => 'id_tax', 'lang' => true, 'fields' => array('name')),
|
||||
array('name' => 'zone', 'id' => 'id_zone', 'fields' => array('name'))
|
||||
);
|
||||
|
||||
foreach ($tables AS $table)
|
||||
{
|
||||
/* Latin1 datas' selection */
|
||||
if (!Db::getInstance()->execute('SET NAMES latin1'))
|
||||
echo 'Cannot change the sql encoding to latin1!';
|
||||
$query = 'SELECT `'.$table['id'].'`';
|
||||
foreach ($table['fields'] AS $field)
|
||||
$query .= ', `'.$field.'`';
|
||||
if (isset($table['lang']) AND $table['lang'])
|
||||
$query .= ', `id_lang`';
|
||||
$query .= ' FROM `'._DB_PREFIX_.$table['name'].'`';
|
||||
$latin1Datas = Db::getInstance()->executeS($query);
|
||||
if ($latin1Datas === false)
|
||||
{
|
||||
$warningExist = true;
|
||||
$requests .= '
|
||||
<request result="fail">
|
||||
<sqlQuery><![CDATA['.htmlentities($query).']]></sqlQuery>
|
||||
<sqlMsgError><![CDATA['.htmlentities(Db::getInstance()->getMsgError()).']]></sqlMsgError>
|
||||
<sqlNumberError><![CDATA['.htmlentities(Db::getInstance()->getNumberError()).']]></sqlNumberError>
|
||||
</request>'."\n";
|
||||
}
|
||||
|
||||
if (Db::getInstance()->NumRows())
|
||||
{
|
||||
/* Utf-8 datas' restitution */
|
||||
if (!Db::getInstance()->execute('SET NAMES utf8'))
|
||||
echo 'Cannot change the sql encoding to utf8!';
|
||||
foreach ($latin1Datas AS $latin1Data)
|
||||
{
|
||||
$query = 'UPDATE `'._DB_PREFIX_.$table['name'].'` SET';
|
||||
foreach ($table['fields'] AS $field)
|
||||
$query .= ' `'.$field.'` = \''.pSQL($latin1Data[$field]).'\',';
|
||||
$query = rtrim($query, ',');
|
||||
$query .= ' WHERE `'.$table['id'].'` = '.(int)($latin1Data[$table['id']]);
|
||||
if (isset($table['lang']) AND $table['lang'])
|
||||
$query .= ' AND `id_lang` = '.(int)($latin1Data['id_lang']);
|
||||
if (!Db::getInstance()->execute($query))
|
||||
{
|
||||
$warningExist = true;
|
||||
$requests .= '
|
||||
<request result="fail">
|
||||
<sqlQuery><![CDATA['.htmlentities($query).']]></sqlQuery>
|
||||
<sqlMsgError><![CDATA['.htmlentities(Db::getInstance()->getMsgError()).']]></sqlMsgError>
|
||||
<sqlNumberError><![CDATA['.htmlentities(Db::getInstance()->getNumberError()).']]></sqlNumberError>
|
||||
</request>'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/* STRUCTURE */
|
||||
CREATE TABLE `PREFIX_product_sale` (
|
||||
`id_product` INT( 10 ) UNSIGNED NOT NULL ,
|
||||
`quantity` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`nb_vente` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',
|
||||
`date_upd` DATE NOT NULL ,
|
||||
PRIMARY KEY ( `id_product` )
|
||||
) ENGINE = MYISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `PREFIX_image_type`
|
||||
ADD `manufacturers` BOOL NOT NULL DEFAULT '1' AFTER `categories`;
|
||||
|
||||
ALTER TABLE `PREFIX_address`
|
||||
ADD `id_manufacturer` INT( 10 ) UNSIGNED NOT NULL AFTER `id_customer` ;
|
||||
|
||||
ALTER TABLE `PREFIX_address`
|
||||
ADD `id_supplier` INT( 10 ) UNSIGNED NOT NULL AFTER `id_manufacturer` ;
|
||||
|
||||
ALTER TABLE `PREFIX_order_discount`
|
||||
ADD `id_discount` INT( 10 ) UNSIGNED NOT NULL AFTER `id_order` ;
|
||||
|
||||
ALTER TABLE `PREFIX_discount`
|
||||
ADD `quantity_per_user` INT( 10 ) UNSIGNED NOT NULL DEFAULT '1' AFTER `quantity` ;
|
||||
|
||||
ALTER TABLE `PREFIX_contact` CHANGE `position` `position` TINYINT( 2 ) UNSIGNED NOT NULL DEFAULT '0';
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* STRUCTURE */
|
||||
ALTER TABLE `PREFIX_product` CHANGE `price` `price` DECIMAL(13,6) NOT NULL DEFAULT '0.000000';
|
||||
|
||||
/* CONTENTS */
|
||||
DELETE FROM `PREFIX_carrier_lang` WHERE `id_carrier` = (SELECT c.`id_carrier` FROM `PREFIX_carrier` c WHERE c.`name` = 'My download manager' LIMIT 1);
|
||||
DELETE FROM `PREFIX_carrier` WHERE `name` = 'My download manager';
|
||||
|
||||
/* Conf vars */
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_TAX_NO', '0', NOW(), NOW());
|
||||
@@ -0,0 +1,66 @@
|
||||
/* STRUCTURE */
|
||||
ALTER TABLE `PREFIX_order_state`
|
||||
ADD `logable` TINYINT(1) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `PREFIX_product_sale`
|
||||
CHANGE `nb_vente` `sale_nbr` INT(10) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `PREFIX_carrier`
|
||||
CHANGE `tax` `id_tax` INT(10) UNSIGNED NULL DEFAULT 0 AFTER `id_carrier`;
|
||||
ALTER TABLE `PREFIX_carrier`
|
||||
ADD `shipping_handling` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 AFTER `deleted`;
|
||||
ALTER TABLE `PREFIX_address`
|
||||
CHANGE `id_country` `id_country` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
CHANGE `id_customer` `id_customer` INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||
CHANGE `id_manufacturer` `id_manufacturer` INT(10) UNSIGNED NOT NULL DEFAULT 0;
|
||||
RENAME TABLE `PREFIX_product_attribute_combinaison` TO `PREFIX_product_attribute_combination`;
|
||||
ALTER TABLE `PREFIX_product_attribute_combination`
|
||||
DROP INDEX `product_attribute_combinaison_index`,
|
||||
ADD PRIMARY KEY (`id_attribute`, `id_product_attribute`);
|
||||
|
||||
CREATE TABLE `PREFIX_carrier_zone` (
|
||||
id_carrier int(10) unsigned NOT NULL,
|
||||
id_zone int(10) unsigned NOT NULL,
|
||||
INDEX carrier_zone_index(id_carrier, id_zone)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `PREFIX_tax_zone` (
|
||||
id_tax int(10) unsigned NOT NULL,
|
||||
id_zone int(10) unsigned NOT NULL,
|
||||
INDEX tax_zone_index(id_tax, id_zone)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
/* Rename old tab */
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Produits'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminPPreferences')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Emails'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminEmails')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Images'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminImages')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
|
||||
/* New BankWire state */
|
||||
UPDATE `PREFIX_order_state` SET `logable` = 1 WHERE `id_order_state` < 6 AND `id_order_state` > 1;
|
||||
INSERT INTO `PREFIX_order_state` (`id_order_state`, `invoice`, `send_email`, `color`, `unremovable`, `logable`) VALUES (10, 0, 1, 'lightblue', 1, 0);
|
||||
INSERT INTO `PREFIX_order_state_lang` (`id_order_state`, `id_lang`, `name`, `template`) VALUES
|
||||
(10, 1, 'Awaiting bank wire payment', 'bankwire'),
|
||||
(10, 2, 'En attente du paiement par virement bancaire', 'bankwire');
|
||||
|
||||
/* New hook */
|
||||
INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES ('updateOrderStatus', 'Order''s status update event', 'Launch modules when the order''s status of an order change.', 0);
|
||||
|
||||
/* Adding zones for tax/carrier */
|
||||
INSERT INTO `PREFIX_tax_zone` (id_tax, id_zone) (SELECT id_tax, id_zone FROM `PREFIX_tax` CROSS JOIN `PREFIX_zone`);
|
||||
INSERT INTO `PREFIX_carrier_zone` (id_carrier, id_zone) (SELECT id_carrier, id_zone FROM `PREFIX_carrier` CROSS JOIN `PREFIX_zone`);
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES
|
||||
('PREFIX_PURCHASE_MINIMUM', '0', NOW(), NOW()),
|
||||
('PREFIX_SHOP_ENABLE', '1', NOW(), NOW());
|
||||
|
||||
/* Adding tab Contact */
|
||||
/* PHP:add_new_tab(AdminContact, fr:Coordonnées|es:Datos|en:Contact Information|de:Kontaktinformation|it:Informazioni di contatto, 8); */;
|
||||
@@ -0,0 +1,5 @@
|
||||
/* STRUCTURE */
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
@@ -0,0 +1,51 @@
|
||||
/* STRUCTURE */
|
||||
|
||||
CREATE TABLE `PREFIX_alias` (
|
||||
alias varchar(255) NOT NULL,
|
||||
search varchar(255) NOT NULL,
|
||||
active tinyint(1) NOT NULL default 1,
|
||||
id_alias int(10) NOT NULL auto_increment,
|
||||
PRIMARY KEY (id_alias),
|
||||
UNIQUE KEY alias (alias)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `PREFIX_configuration`
|
||||
ADD UNIQUE `name` (`name`);
|
||||
ALTER TABLE `PREFIX_product`
|
||||
ADD `wholesale_price` DECIMAL( 13, 6 ) NOT NULL AFTER `price`;
|
||||
ALTER TABLE `PREFIX_range_weight`
|
||||
CHANGE `delimiter1` `delimiter1` DECIMAL( 13, 6 ) NOT NULL DEFAULT '0.000000';
|
||||
ALTER TABLE `PREFIX_range_weight`
|
||||
CHANGE `delimiter2` `delimiter2` DECIMAL( 13, 6 ) NOT NULL DEFAULT '0.000000';
|
||||
ALTER TABLE `PREFIX_discount_type_lang`
|
||||
CHANGE `name` `name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
|
||||
ALTER TABLE `PREFIX_product`
|
||||
CHANGE `bargain` `on_sale` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `PREFIX_image_type`
|
||||
ADD `suppliers` BOOL NOT NULL DEFAULT 1;
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
/* Adding tab alias */
|
||||
INSERT INTO `PREFIX_tab` (`id_parent`, `class_name`, `position`) VALUES ((SELECT tmp.id_tab FROM (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminAliases', 9);
|
||||
INSERT INTO `PREFIX_tab_lang` (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminAliases' LIMIT 1),
|
||||
'Alias' FROM `PREFIX_lang`);
|
||||
INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`)
|
||||
VALUES ('1', (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminAliases' LIMIT 1), '1', '1', '1', '1');
|
||||
|
||||
/* Adding tab import */
|
||||
INSERT INTO `PREFIX_tab` (`id_parent`, `class_name`, `position`) VALUES ((SELECT tmp.id_tab FROM (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminImport', 10);
|
||||
INSERT INTO `PREFIX_tab_lang` (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminImport' LIMIT 1),
|
||||
'Import' FROM `PREFIX_lang`);
|
||||
INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`)
|
||||
VALUES ('1', (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminImport' LIMIT 1), '1', '1', '1', '1');
|
||||
|
||||
INSERT INTO `PREFIX_hook` (`name`, `title`, `description`)
|
||||
VALUES ('adminOrder', 'Display in Back-Office, tab AdminOrder', 'Launch modules when the tab AdminOrder is displayed on back-office.');
|
||||
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
@@ -0,0 +1,7 @@
|
||||
/* STRUCTURE */
|
||||
|
||||
ALTER TABLE `PREFIX_product` CHANGE `wholesale_price` `wholesale_price` DECIMAL(13, 6) NULL;
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
@@ -0,0 +1,14 @@
|
||||
/* STRUCTURE */
|
||||
|
||||
ALTER TABLE `PREFIX_module` ADD INDEX (`name`);
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
INSERT INTO `PREFIX_hook` (`name` , `title`, `description`, `position`) VALUES
|
||||
('footer', 'Footer', 'Add block in footer', 1),
|
||||
('PDFInvoice', 'PDF Invoice', 'Allow the display of extra informations into the PDF invoice', 0);
|
||||
UPDATE `PREFIX_hook` SET `description` = 'Add blocks in the header', `position` = '1' WHERE `name` = 'header' LIMIT 1 ;
|
||||
UPDATE `PREFIX_currency` SET `iso_code` = 'XXX' WHERE `iso_code` IS NULL;
|
||||
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
@@ -0,0 +1,21 @@
|
||||
/* STRUCTURE */
|
||||
|
||||
CREATE TABLE `PREFIX_discount_quantity` (
|
||||
id_discount_quantity INT UNSIGNED NOT NULL auto_increment,
|
||||
id_discount_type INT UNSIGNED NOT NULL,
|
||||
id_product INT UNSIGNED NOT NULL,
|
||||
id_product_attribute INT UNSIGNED NULL,
|
||||
quantity INT UNSIGNED NOT NULL,
|
||||
value DECIMAL(10,2) UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (id_discount_quantity)
|
||||
) ENGINE=MYISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `PREFIX_product` ADD quantity_discount BOOL NULL DEFAULT 0 AFTER out_of_stock;
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
|
||||
UPDATE `PREFIX_configuration` SET name = 'PS_TAX', value = 1 WHERE name = 'PS_TAX_NO' AND value = 0;
|
||||
UPDATE `PREFIX_configuration` SET name = 'PS_TAX', value = 0 WHERE name = 'PS_TAX_NO' AND value = 1;
|
||||
@@ -0,0 +1,39 @@
|
||||
/* STRUCTURE */
|
||||
|
||||
ALTER TABLE `PREFIX_currency` ADD `iso_code` VARCHAR( 3 ) NOT NULL DEFAULT '0' AFTER `name`;
|
||||
ALTER TABLE `PREFIX_product_attribute` ADD `default_on` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `weight`;
|
||||
ALTER TABLE `PREFIX_carrier` ADD `tax` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `deleted`;
|
||||
|
||||
ALTER TABLE `PREFIX_order_detail`
|
||||
ADD `download_hash` VARCHAR(255) default NULL AFTER `tax_rate`,
|
||||
ADD `download_nb` INT(10) unsigned default 0 AFTER `tax_rate`,
|
||||
ADD `download_deadline` DATETIME DEFAULT NULL AFTER `tax_rate`;
|
||||
|
||||
CREATE TABLE `PREFIX_product_download` (
|
||||
`id_product_download` INT(10) unsigned NOT NULL auto_increment,
|
||||
`id_product` INT(10) unsigned NOT NULL,
|
||||
`display_filename` VARCHAR(255) default NULL,
|
||||
`physically_filename` VARCHAR(255) default NULL,
|
||||
`date_deposit` DATETIME NOT NULL,
|
||||
`date_expiration` DATETIME default NULL,
|
||||
`nb_days_accessible` int(10) unsigned default NULL,
|
||||
`nb_downloadable` int(10) unsigned default 1,
|
||||
PRIMARY KEY (`id_product_download`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
/* Adding tab Appearance */
|
||||
UPDATE `PREFIX_tab` SET `class_name` = 'AdminAppearance' WHERE class_name = 'AdminHomepage';
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Appearance'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminAppearance');
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Apparence'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminAppearance')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
|
||||
/* Adding iso_code to currency */
|
||||
UPDATE `PREFIX_currency` SET `iso_code` = 'XXX';
|
||||
|
||||
/* Conf vars */
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_DISPLAY_QTIES', '1', NOW(), NOW());
|
||||
@@ -0,0 +1,122 @@
|
||||
/* PHP */
|
||||
/* PHP:latin1_database_to_utf8(); */;
|
||||
|
||||
/* STRUCTURE */
|
||||
SET NAMES 'utf8';
|
||||
|
||||
CREATE TABLE PREFIX_attribute_impact (
|
||||
id_attribute_impact int(11) NOT NULL AUTO_INCREMENT,
|
||||
id_product int(11) NOT NULL,
|
||||
id_attribute int(11) NOT NULL,
|
||||
weight float NOT NULL,
|
||||
price decimal(10,2) NOT NULL,
|
||||
PRIMARY KEY (id_attribute_impact),
|
||||
UNIQUE KEY id_product (id_product,id_attribute)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_supplier_lang (
|
||||
id_supplier INTEGER UNSIGNED NOT NULL,
|
||||
id_lang INTEGER UNSIGNED NOT NULL,
|
||||
description TEXT NULL,
|
||||
INDEX supplier_lang_index(id_supplier, id_lang)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_manufacturer_lang (
|
||||
id_manufacturer INTEGER UNSIGNED NOT NULL,
|
||||
id_lang INTEGER UNSIGNED NOT NULL,
|
||||
description TEXT NULL,
|
||||
INDEX manufacturer_lang_index(id_manufacturer, id_lang)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_state (
|
||||
id_state int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
id_country int(11) NOT NULL,
|
||||
name varchar(64) NOT NULL,
|
||||
iso_code varchar(3) NOT NULL,
|
||||
active tinyint(1) NOT NULL default 0,
|
||||
PRIMARY KEY (id_state)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE PREFIX_customer ADD secure_key VARCHAR(32) NOT NULL DEFAULT '-1' AFTER id_gender;
|
||||
ALTER TABLE PREFIX_orders ADD secure_key VARCHAR(32) NOT NULL DEFAULT '-1' AFTER id_address_invoice;
|
||||
ALTER TABLE PREFIX_product ADD id_category_default INT NULL AFTER id_tax;
|
||||
ALTER TABLE PREFIX_category_product ADD position INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER id_product;
|
||||
ALTER TABLE PREFIX_product ADD INDEX (id_category_default);
|
||||
ALTER TABLE PREFIX_order_detail ADD ecotax DECIMAL(10, 2) NOT NULL DEFAULT 0 AFTER tax_rate;
|
||||
ALTER TABLE PREFIX_employee
|
||||
CHANGE name lastname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
CHANGE surname firstname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
|
||||
ALTER TABLE PREFIX_address
|
||||
CHANGE name lastname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
CHANGE surname firstname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
|
||||
ALTER TABLE PREFIX_customer
|
||||
CHANGE name lastname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
|
||||
CHANGE surname firstname VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
|
||||
ALTER TABLE PREFIX_quick_access ADD new_window TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER id_quick_access;
|
||||
|
||||
/* CONTENTS */
|
||||
UPDATE PREFIX_hook_module SET id_hook = 14 WHERE id_hook = 9;
|
||||
UPDATE PREFIX_quick_access SET new_window = 1 WHERE id_quick_access = 2 LIMIT 1;
|
||||
INSERT INTO PREFIX_hook (name, title, description, position) VALUES ('orderConfirmation', 'Order confirmation page', 'Called on order confirmation page', 0);
|
||||
UPDATE PREFIX_order_detail odt
|
||||
SET product_price = (
|
||||
odt.product_price * (
|
||||
SELECT conversion_rate FROM PREFIX_currency c, PREFIX_orders o WHERE o.id_order = odt.id_order AND c.id_currency = o.id_currency
|
||||
)
|
||||
);
|
||||
UPDATE PREFIX_product p SET p.id_category_default = (SELECT id_category FROM PREFIX_category_product cp WHERE cp.id_product = p.id_product GROUP BY id_product ORDER BY cp.id_category ASC);
|
||||
UPDATE PREFIX_category_product cp SET cp.position= cp.id_product;
|
||||
|
||||
/* NEW TABS */
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminPrintPDF', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminPrintPDF' LIMIT 1),
|
||||
'Print invoices' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Impression factures'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminPrintPDF')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminPrintPDF' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES (-1, 'AdminSearch', 2);
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSearch' LIMIT 1),
|
||||
'Search' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Recherche'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminSearch')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSearch' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp), 'AdminLocalization', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminLocalization' LIMIT 1),
|
||||
'Localization' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Localisation'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminLocalization')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminLocalization' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminShipping' LIMIT 1) AS tmp), 'AdminStates', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminShipping' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminStates' LIMIT 1),
|
||||
'States' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Etats'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminStates')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (`id_profile`, `id_tab`, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminStates' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_image_type (`name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`) VALUES ('home', 129, 129, 1, 0, 0, 0);
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_NB_DAYS_NEW_PRODUCT', 20, NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_WEIGHT_UNIT', 'kg', NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_BLOCK_CART_AJAX', '1', NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_FO_PROTOCOL', 'http://', NOW(), NOW());
|
||||
UPDATE PREFIX_configuration SET name = 'PS_MAIL_SMTP_PORT', value = 25 WHERE name = 'PS_MAIL_SMTP_PORT' AND value = 'default';
|
||||
UPDATE PREFIX_configuration SET name = 'PS_MAIL_SMTP_PORT', value = 465 WHERE name = 'PS_MAIL_SMTP_PORT' AND value = 'secure';
|
||||
|
||||
/* PHP:add_new_tab(AdminPDF, fr:PDF|es:PDF|en:PDF|de:PDF|it:PDF, 3); */;
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
/* STRUCTURE */
|
||||
SET NAMES 'utf8';
|
||||
|
||||
ALTER TABLE PREFIX_currency CHANGE COLUMN conversion_rate conversion_rate DECIMAL(10,6) NOT NULL;
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
INSERT INTO PREFIX_image_type (`name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`) VALUES ('thickbox', 600, 600, 1, 0, 0, 0);
|
||||
INSERT INTO PREFIX_image_type (`name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`) VALUES ('category', 600, 150, 0, 1, 0, 0);
|
||||
INSERT INTO PREFIX_image_type (`name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`) VALUES ('thickbox', 129, 129, 1, 0, 0, 0);
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
@@ -0,0 +1,441 @@
|
||||
/* STRUCTURE */
|
||||
SET NAMES 'utf8';
|
||||
|
||||
ALTER TABLE PREFIX_attribute_group_lang DROP INDEX attribute_group_lang_index, ADD PRIMARY KEY (id_attribute_group, id_lang);
|
||||
ALTER TABLE PREFIX_discount_lang DROP INDEX discount_lang_index, ADD PRIMARY KEY (id_discount, id_lang);
|
||||
ALTER TABLE PREFIX_discount_type_lang DROP INDEX discount_type_lang_index, ADD PRIMARY KEY (id_discount_type, id_lang);
|
||||
ALTER TABLE PREFIX_manufacturer_lang DROP INDEX manufacturer_lang_index, ADD PRIMARY KEY (id_manufacturer, id_lang);
|
||||
ALTER TABLE PREFIX_supplier_lang DROP INDEX supplier_lang_index, ADD PRIMARY KEY (id_supplier, id_lang);
|
||||
ALTER TABLE PREFIX_profile_lang DROP INDEX profile_lang_index, ADD PRIMARY KEY (id_profile, id_lang);
|
||||
ALTER TABLE PREFIX_configuration_lang DROP INDEX configuration_lang_index, ADD PRIMARY KEY (id_configuration, id_lang);
|
||||
ALTER TABLE PREFIX_tab_lang DROP INDEX tab_lang, ADD PRIMARY KEY (id_tab, id_lang);
|
||||
|
||||
ALTER TABLE PREFIX_product ADD id_color_default INT UNSIGNED NULL AFTER id_category_default;
|
||||
ALTER TABLE PREFIX_attribute_group ADD is_color_group TINYINT(1) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE PREFIX_attribute ADD color VARCHAR(32) NULL DEFAULT NULL;
|
||||
ALTER TABLE PREFIX_currency CHANGE conversion_rate conversion_rate DECIMAL(13, 6) NOT NULL ;
|
||||
ALTER TABLE PREFIX_address ADD id_state INT NULL AFTER id_country;
|
||||
ALTER TABLE PREFIX_state ADD id_zone INT NULL AFTER id_country;
|
||||
ALTER TABLE PREFIX_country ADD contains_states tinyint(1) NOT NULL DEFAULT 0;
|
||||
|
||||
UPDATE PREFIX_customer SET secure_key = MD5(RAND()) WHERE secure_key = '-1';
|
||||
UPDATE PREFIX_orders o SET secure_key = (SELECT secure_key FROM PREFIX_customer c WHERE c.id_customer = o.id_customer);
|
||||
|
||||
CREATE TABLE PREFIX_order_return (
|
||||
id_order_return INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
id_customer INTEGER UNSIGNED NOT NULL,
|
||||
id_order INTEGER UNSIGNED NOT NULL,
|
||||
state tinyint(1) unsigned NOT NULL DEFAULT 0,
|
||||
question TEXT NOT NULL,
|
||||
date_add DATETIME NOT NULL,
|
||||
date_upd DATETIME NOT NULL,
|
||||
PRIMARY KEY(id_order_return),
|
||||
INDEX order_return_customer(id_customer)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_order_return_detail (
|
||||
id_order_return INTEGER UNSIGNED NOT NULL,
|
||||
id_order_detail INTEGER UNSIGNED NOT NULL,
|
||||
product_quantity int(10) unsigned NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY (id_order_return,id_order_detail)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_order_return_state (
|
||||
id_order_return_state int(10) unsigned NOT NULL auto_increment,
|
||||
color varchar(32) default NULL,
|
||||
PRIMARY KEY (`id_order_return_state`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_order_return_state_lang (
|
||||
id_order_return_state int(10) unsigned NOT NULL,
|
||||
id_lang int(10) unsigned NOT NULL,
|
||||
name varchar(64) NOT NULL,
|
||||
UNIQUE KEY `order_state_lang_index` (`id_order_return_state`,`id_lang`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_order_slip (
|
||||
id_order_slip INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
id_customer INTEGER UNSIGNED NOT NULL,
|
||||
id_order INTEGER UNSIGNED NOT NULL,
|
||||
date_add DATETIME NOT NULL,
|
||||
date_upd DATETIME NOT NULL,
|
||||
PRIMARY KEY(id_order_slip),
|
||||
INDEX order_slip_customer(id_customer)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_order_slip_detail (
|
||||
id_order_slip INTEGER UNSIGNED NOT NULL,
|
||||
id_order_detail INTEGER UNSIGNED NOT NULL,
|
||||
product_quantity int(10) unsigned NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id_order_slip`,`id_order_detail`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_tax_state (
|
||||
id_tax int(10) unsigned NOT NULL,
|
||||
id_state int(10) unsigned NOT NULL,
|
||||
INDEX tax_state_index(id_tax, id_state)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
INSERT INTO PREFIX_order_return_state (`id_order_return_state`, `color`) VALUES
|
||||
(1, '#ADD8E6'),
|
||||
(2, '#EEDDFF'),
|
||||
(3, '#DDFFAA'),
|
||||
(4, '#FFD3D3'),
|
||||
(5, '#FFFFBB');
|
||||
|
||||
INSERT INTO PREFIX_order_return_state_lang (`id_order_return_state`, `id_lang`, `name`) VALUES
|
||||
(1, 1, 'Waiting for confirmation'),
|
||||
(2, 1, 'Waiting for package'),
|
||||
(3, 1, 'Package received'),
|
||||
(4, 1, 'Return denied'),
|
||||
(5, 1, 'Return completed'),
|
||||
(1, 2, 'En attente de confirmation'),
|
||||
(2, 2, 'En attente du colis'),
|
||||
(3, 2, 'Colis reçu'),
|
||||
(4, 2, 'Retour refusé'),
|
||||
(5, 2, 'Retour terminé');
|
||||
|
||||
UPDATE PREFIX_country SET contains_states = 1 WHERE id_country = 21;
|
||||
|
||||
INSERT INTO `PREFIX_state` (`id_state`, `id_country`, `id_zone`, `name`, `iso_code`, `active`) VALUES
|
||||
(1, 21, 2, 'Alabama', 'AL', 1),
|
||||
(2, 21, 2, 'Alaska', 'AK', 1),
|
||||
(3, 21, 2, 'Arizona', 'AZ', 1),
|
||||
(4, 21, 2, 'Arkansas', 'AR', 1),
|
||||
(5, 21, 2, 'California', 'CA', 1),
|
||||
(6, 21, 2, 'Colorado', 'CO', 1),
|
||||
(7, 21, 2, 'Connecticut', 'CT', 1),
|
||||
(8, 21, 2, 'Delaware', 'DE', 1),
|
||||
(9, 21, 2, 'Florida', 'FL', 1),
|
||||
(10, 21, 2, 'Georgia', 'GA', 1),
|
||||
(11, 21, 2, 'Hawaii', 'HI', 1),
|
||||
(12, 21, 2, 'Idaho', 'ID', 1),
|
||||
(13, 21, 2, 'Illinois', 'IL', 1),
|
||||
(14, 21, 2, 'Indiana', 'IN', 1),
|
||||
(15, 21, 2, 'Iowa', 'IA', 1),
|
||||
(16, 21, 2, 'Kansas', 'KS', 1),
|
||||
(17, 21, 2, 'Kentucky', 'KY', 1),
|
||||
(18, 21, 2, 'Louisiana', 'LA', 1),
|
||||
(19, 21, 2, 'Maine', 'ME', 1),
|
||||
(20, 21, 2, 'Maryland', 'MD', 1),
|
||||
(21, 21, 2, 'Massachusetts', 'MA', 1),
|
||||
(22, 21, 2, 'Michigan', 'MI', 1),
|
||||
(23, 21, 2, 'Minnesota', 'MN', 1),
|
||||
(24, 21, 2, 'Mississippi', 'MS', 1),
|
||||
(25, 21, 2, 'Missouri', 'MO', 1),
|
||||
(26, 21, 2, 'Montana', 'MT', 1),
|
||||
(27, 21, 2, 'Nebraska', 'NE', 1),
|
||||
(28, 21, 2, 'Nevada', 'NV', 1),
|
||||
(29, 21, 2, 'New Hampshire', 'NH', 1),
|
||||
(30, 21, 2, 'New Jersey', 'NJ', 1),
|
||||
(31, 21, 2, 'New Mexico', 'NM', 1),
|
||||
(32, 21, 2, 'New York', 'NY', 1),
|
||||
(33, 21, 2, 'North Carolina', 'NC', 1),
|
||||
(34, 21, 2, 'North Dakota', 'ND', 1),
|
||||
(35, 21, 2, 'Ohio', 'OH', 1),
|
||||
(36, 21, 2, 'Oklahoma', 'OK', 1),
|
||||
(37, 21, 2, 'Oregon', 'OR', 1),
|
||||
(38, 21, 2, 'Pennsylvania', 'PA', 1),
|
||||
(39, 21, 2, 'Rhode Island', 'RI', 1),
|
||||
(40, 21, 2, 'South Carolina', 'SC', 1),
|
||||
(41, 21, 2, 'South Dakota', 'SD', 1),
|
||||
(42, 21, 2, 'Tennessee', 'TN', 1),
|
||||
(43, 21, 2, 'Texas', 'TX', 1),
|
||||
(44, 21, 2, 'Utah', 'UT', 1),
|
||||
(45, 21, 2, 'Vermont', 'VT', 1),
|
||||
(46, 21, 2, 'Virginia', 'VA', 1),
|
||||
(47, 21, 2, 'Washington', 'WA', 1),
|
||||
(48, 21, 2, 'West Virginia', 'WV', 1),
|
||||
(49, 21, 2, 'Wisconsin', 'WI', 1),
|
||||
(50, 21, 2, 'Wyoming', 'WY', 1),
|
||||
(51, 21, 2, 'Puerto Rico', 'PR', 1),
|
||||
(52, 21, 2, 'US Virgin Islands', 'VI', 1);
|
||||
|
||||
INSERT INTO `PREFIX_lang` (`name`, `active`, `iso_code`) VALUES
|
||||
('Deutsch (German)', 1, 'de'),
|
||||
('Español (Spanish)', 1, 'es'),
|
||||
('Nederlands (Dutch)', 1, 'nl'),
|
||||
('Bahasa Indonesia (Indonesian)', 1, 'id'),
|
||||
('Italiano (Italian)', 1, 'it'),
|
||||
('Język polski (Polish)', 1, 'pl'),
|
||||
('Português (Portuguese)', 1, 'pt'),
|
||||
('Čeština (Czech)', 1, 'cs'),
|
||||
('Pусский язык (Russian)', 0, 'ru'),
|
||||
('Türkçe (Turkish)', 0, 'tr'),
|
||||
('Tiếng Việt (Vietnamese)', 0, 'vn');
|
||||
|
||||
/* NEW LANGS */
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_tab_lang` (`id_tab`, `id_lang`, `name`)
|
||||
(SELECT `id_tab`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_tab_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_tab`=`PREFIX_tab`.`id_tab`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_tab`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_country_lang` (`id_country`, `id_lang`, `name`)
|
||||
(SELECT `id_country`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_country_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_country`=`PREFIX_country`.`id_country`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_country`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_quick_access_lang` (`id_quick_access`, `id_lang`, `name`)
|
||||
(SELECT `id_quick_access`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_quick_access_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_quick_access`=`PREFIX_quick_access`.`id_quick_access`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_quick_access`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_attribute_group_lang` (`id_attribute_group`, `id_lang`, `name`, `public_name`)
|
||||
(SELECT `id_attribute_group`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_attribute_group_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_attribute_group`=`PREFIX_attribute_group`.`id_attribute_group`),
|
||||
(SELECT tl.`public_name`
|
||||
FROM `PREFIX_attribute_group_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_attribute_group`=`PREFIX_attribute_group`.`id_attribute_group`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_attribute_group`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_attribute_lang` (`id_attribute`, `id_lang`, `name`)
|
||||
(SELECT `id_attribute`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_attribute_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_attribute`=`PREFIX_attribute`.`id_attribute`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_attribute`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_carrier_lang` (`id_carrier`, `id_lang`, `delay`)
|
||||
(SELECT `id_carrier`, id_lang, (SELECT tl.`delay`
|
||||
FROM `PREFIX_carrier_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_carrier`=`PREFIX_carrier`.`id_carrier`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_carrier`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_contact_lang` (`id_contact`, `id_lang`, `name`, `description`)
|
||||
(SELECT `id_contact`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_contact_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_contact`=`PREFIX_contact`.`id_contact`),
|
||||
(SELECT tl.`description`
|
||||
FROM `PREFIX_contact_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_contact`=`PREFIX_contact`.`id_contact`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_contact`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_discount_lang` (`id_discount`, `id_lang`, `description`)
|
||||
(SELECT `id_discount`, id_lang, (SELECT tl.`description`
|
||||
FROM `PREFIX_discount_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_discount`=`PREFIX_discount`.`id_discount`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_discount`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_discount_type_lang` (`id_discount_type`, `id_lang`, `name`)
|
||||
(SELECT `id_discount_type`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_discount_type_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_discount_type`=`PREFIX_discount_type`.`id_discount_type`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_discount_type`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_feature_lang` (`id_feature`, `id_lang`, `name`)
|
||||
(SELECT `id_feature`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_feature_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_feature`=`PREFIX_feature`.`id_feature`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_feature`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_feature_value_lang` (`id_feature_value`, `id_lang`, `value`)
|
||||
(SELECT `id_feature_value`, id_lang, (SELECT tl.`value`
|
||||
FROM `PREFIX_feature_value_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_feature_value`=`PREFIX_feature_value`.`id_feature_value`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_feature_value`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_image_lang` (`id_image`, `id_lang`, `legend`)
|
||||
(SELECT `id_image`, id_lang, (SELECT tl.`legend`
|
||||
FROM `PREFIX_image_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_image`=`PREFIX_image`.`id_image`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_image`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_manufacturer_lang` (`id_manufacturer`, `id_lang`, `description`)
|
||||
(SELECT `id_manufacturer`, id_lang, (SELECT tl.`description`
|
||||
FROM `PREFIX_manufacturer_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_manufacturer`=`PREFIX_manufacturer`.`id_manufacturer`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_manufacturer`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_order_return_state_lang` (`id_order_return_state`, `id_lang`, `name`)
|
||||
(SELECT `id_order_return_state`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_order_return_state_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_return_state`=`PREFIX_order_return_state`.`id_order_return_state`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_order_return_state`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_order_state_lang` (`id_order_state`, `id_lang`, `name`, `template`)
|
||||
(SELECT `id_order_state`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_order_state_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_state`=`PREFIX_order_state`.`id_order_state`),
|
||||
(SELECT tl.`template`
|
||||
FROM `PREFIX_order_state_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_state`=`PREFIX_order_state`.`id_order_state`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_order_state`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_profile_lang` (`id_profile`, `id_lang`, `name`)
|
||||
(SELECT `id_profile`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_profile_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_profile`=`PREFIX_profile`.`id_profile`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_profile`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_supplier_lang` (`id_supplier`, `id_lang`, `description`)
|
||||
(SELECT `id_supplier`, id_lang, (SELECT tl.`description`
|
||||
FROM `PREFIX_supplier_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_supplier`=`PREFIX_supplier`.`id_supplier`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_supplier`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_tax_lang` (`id_tax`, `id_lang`, `name`)
|
||||
(SELECT `id_tax`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_tax_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_tax`=`PREFIX_tax`.`id_tax`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_tax`);
|
||||
|
||||
/* products */
|
||||
INSERT IGNORE INTO `PREFIX_product_lang` (`id_product`, `id_lang`, `description`, `description_short`, `link_rewrite`, `meta_description`, `meta_keywords`, `meta_title`, `name`, `availability`)
|
||||
(SELECT `id_product`, id_lang,
|
||||
(SELECT tl.`description`
|
||||
FROM `PREFIX_product_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`),
|
||||
(SELECT tl.`description_short`
|
||||
FROM `PREFIX_product_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`),
|
||||
(SELECT tl.`link_rewrite`
|
||||
FROM `PREFIX_product_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`),
|
||||
(SELECT tl.`meta_description`
|
||||
FROM `PREFIX_product_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`),
|
||||
(SELECT tl.`meta_keywords`
|
||||
FROM `PREFIX_product_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`),
|
||||
(SELECT tl.`meta_title`
|
||||
FROM `PREFIX_product_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`),
|
||||
(SELECT tl.`name`
|
||||
FROM `PREFIX_product_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`),
|
||||
(SELECT tl.`availability`
|
||||
FROM `PREFIX_product_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_product`=`PREFIX_product`.`id_product`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_product`);
|
||||
|
||||
/* categories */
|
||||
INSERT IGNORE INTO `PREFIX_category_lang` (`id_category`, `id_lang`, `description`, `link_rewrite`, `meta_description`, `meta_keywords`, `meta_title`, `name`)
|
||||
(SELECT `id_category`, id_lang,
|
||||
(SELECT tl.`description`
|
||||
FROM `PREFIX_category_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`),
|
||||
(SELECT tl.`link_rewrite`
|
||||
FROM `PREFIX_category_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`),
|
||||
(SELECT tl.`meta_description`
|
||||
FROM `PREFIX_category_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`),
|
||||
(SELECT tl.`meta_keywords`
|
||||
FROM `PREFIX_category_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`),
|
||||
(SELECT tl.`meta_title`
|
||||
FROM `PREFIX_category_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`),
|
||||
(SELECT tl.`name`
|
||||
FROM `PREFIX_category_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_category`=`PREFIX_category`.`id_category`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_category`);
|
||||
|
||||
|
||||
|
||||
/* NEW TABS */
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminReturn', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminReturn' LIMIT 1),
|
||||
'Merchandise returns (RMAs)' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Retours produit'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminReturn')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminReturn' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminSlip', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSlip' LIMIT 1),
|
||||
'Credit slips' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Avoirs'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminSlip')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSlip' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_ORDER_RETURN', '0', NOW(), NOW());
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_ORDER_RETURN_NB_DAYS', '7', NOW(), NOW());
|
||||
UPDATE PREFIX_configuration SET name = 'PS_SSL_ENABLED' WHERE name = 'PS_FO_PROTOCOL';
|
||||
UPDATE PREFIX_configuration SET name = 'PS_SSL_ENABLED', value = 0 WHERE name = 'PS_SSL_ENABLED' AND value = 'http://';
|
||||
UPDATE PREFIX_configuration SET name = 'PS_SSL_ENABLED', value = 1 WHERE name = 'PS_SSL_ENABLED' AND value = 'https://';
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/* STRUCTURE */
|
||||
SET NAMES 'utf8';
|
||||
|
||||
ALTER TABLE PREFIX_order_detail
|
||||
ADD product_ean13 VARCHAR(13) CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER product_price;
|
||||
ALTER TABLE PREFIX_order_detail
|
||||
ADD product_quantity_return INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER product_quantity;
|
||||
|
||||
ALTER TABLE PREFIX_state
|
||||
ADD tax_behavior SMALLINT(1) NOT NULL DEFAULT 0 AFTER iso_code;
|
||||
|
||||
ALTER TABLE PREFIX_product
|
||||
ADD reduction_from DATE NOT NULL AFTER reduction_percent;
|
||||
ALTER TABLE PREFIX_product
|
||||
ADD reduction_to DATE NOT NULL AFTER reduction_from;
|
||||
|
||||
ALTER TABLE PREFIX_range_weight
|
||||
ADD id_carrier INTEGER UNSIGNED DEFAULT NULL AFTER id_range_weight;
|
||||
ALTER TABLE PREFIX_range_weight
|
||||
DROP INDEX range_weight_index,
|
||||
ADD UNIQUE range_weight_unique (delimiter1, delimiter2, id_carrier);
|
||||
ALTER TABLE PREFIX_range_price
|
||||
ADD id_carrier INTEGER UNSIGNED DEFAULT NULL AFTER id_range_price;
|
||||
ALTER TABLE PREFIX_range_price
|
||||
DROP INDEX range_price_index,
|
||||
ADD UNIQUE range_price_unique (delimiter1, delimiter2, id_carrier);
|
||||
|
||||
/* CONTENTS */
|
||||
/* One request per insert, if one die, other can be inserted */
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('adminCustomers', 'Display in Back-Office, tab AdminCustomers', 'Launch modules when the tab AdminCustomers is displayed on back-office.', 0);
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('createAccount', 'Successful customer create account', 'Called when new customer create account successfuled', 0);
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('customerAccount', 'Customer account page display in front office', 'Called when a customer access to his account.', 1);
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('orderSlip', 'Called when a order slip is created', 'Called when a quantity of one product change in an order.', 0);
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('productTab', 'Tabs on product page', 'Called on order product page tabs', 0);
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('productTabContent', 'Content of tabs on product page', 'Called on order product page tabs', 0);
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('shoppingCart', 'Shopping cart footer', 'Display some specific informations on the shopping cart page', 0);
|
||||
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_MAIL_TYPE', '3', NOW(), NOW());
|
||||
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_TOKEN_ENABLE', '0', NOW(), NOW());
|
||||
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_GIFT_WRAPPING_PRICE', '0', NOW(), NOW());
|
||||
|
||||
/* NEW RANGES */
|
||||
|
||||
INSERT IGNORE INTO PREFIX_range_price ( id_carrier, delimiter1, delimiter2 )
|
||||
(SELECT c.id_carrier, rp.delimiter1, rp.delimiter2
|
||||
FROM PREFIX_range_price rp
|
||||
CROSS JOIN PREFIX_carrier c
|
||||
WHERE c.deleted = 0
|
||||
AND c.active = 1
|
||||
);
|
||||
|
||||
UPDATE `PREFIX_delivery` d SET d.`id_range_price` = (
|
||||
SELECT rw.`id_range_price` FROM `PREFIX_range_price` rw WHERE
|
||||
rw.`id_carrier` = d.`id_carrier` AND
|
||||
rw.`delimiter1` = (
|
||||
SELECT `delimiter1` FROM `PREFIX_range_price` rw2 WHERE rw2.`id_range_price` = d.`id_range_price` LIMIT 1
|
||||
) AND
|
||||
rw.`delimiter2` = (
|
||||
SELECT `delimiter2` FROM `PREFIX_range_price` rw3 WHERE rw3.`id_range_price` = d.`id_range_price` LIMIT 1
|
||||
)
|
||||
);
|
||||
|
||||
INSERT IGNORE INTO PREFIX_range_weight ( id_carrier, delimiter1, delimiter2 )
|
||||
(SELECT c.id_carrier, rp.delimiter1, rp.delimiter2
|
||||
FROM PREFIX_range_weight rp
|
||||
CROSS JOIN PREFIX_carrier c
|
||||
WHERE c.deleted = 0
|
||||
AND c.active = 1
|
||||
);
|
||||
|
||||
UPDATE `PREFIX_delivery` d SET d.`id_range_weight` = (
|
||||
SELECT rw.`id_range_weight` FROM `PREFIX_range_weight` rw WHERE
|
||||
rw.`id_carrier` = d.`id_carrier` AND
|
||||
rw.`delimiter1` = (
|
||||
SELECT `delimiter1` FROM `PREFIX_range_weight` rw2 WHERE rw2.`id_range_weight` = d.`id_range_weight` LIMIT 1
|
||||
) AND
|
||||
rw.`delimiter2` = (
|
||||
SELECT `delimiter2` FROM `PREFIX_range_weight` rw3 WHERE rw3.`id_range_weight` = d.`id_range_weight` LIMIT 1
|
||||
)
|
||||
);
|
||||
|
||||
DELETE FROM PREFIX_range_price WHERE id_carrier IS NULL;
|
||||
DELETE FROM PREFIX_range_weight WHERE id_carrier IS NULL;
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/* STRUCTURE */
|
||||
SET NAMES 'utf8';
|
||||
|
||||
ALTER TABLE PREFIX_orders
|
||||
ADD total_wrapping DECIMAL(10,2) NOT NULL DEFAULT 0 AFTER total_shipping;
|
||||
|
||||
ALTER TABLE PREFIX_carrier
|
||||
ADD range_behavior TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER shipping_handling;
|
||||
|
||||
ALTER TABLE PREFIX_order_detail
|
||||
ADD product_supplier_reference VARCHAR(32) NULL AFTER product_reference;
|
||||
|
||||
ALTER TABLE PREFIX_product
|
||||
ADD supplier_reference VARCHAR(32) NULL AFTER reference;
|
||||
|
||||
ALTER TABLE PREFIX_product_attribute
|
||||
ADD supplier_reference VARCHAR(32) NULL AFTER reference;
|
||||
|
||||
ALTER TABLE PREFIX_customer
|
||||
ADD UNIQUE customer_email(email(128));
|
||||
|
||||
ALTER TABLE PREFIX_product_download
|
||||
ADD active TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 AFTER nb_downloadable;
|
||||
|
||||
|
||||
/* CONTENTS */
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES ('createAccountForm', 'Customer account creation form', 'Display some information on the form to create a customer account', 1);
|
||||
|
||||
INSERT INTO PREFIX_lang (`name`, `active`, `iso_code`) VALUES
|
||||
('Română (Romanian)', 0, 'ro'),
|
||||
('Νεοελληνική (Greek)', 0, 'gr'),
|
||||
('Slovenčina (Slovak)', 0, 'sk');
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/* STRUCTURE */
|
||||
SET NAMES 'utf8';
|
||||
|
||||
ALTER TABLE PREFIX_order_detail
|
||||
CHANGE product_price product_price DECIMAL(13, 6) NOT NULL DEFAULT '0.000000';
|
||||
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/* PHP */
|
||||
/* PHP:AttributeGroup::cleanDeadCombinations(); */;
|
||||
|
||||
/* STRUCTURE */
|
||||
SET NAMES 'utf8';
|
||||
|
||||
ALTER TABLE PREFIX_order_detail
|
||||
ADD product_quantity_discount DECIMAL(13,6) NOT NULL DEFAULT 0 AFTER product_price;
|
||||
ALTER TABLE PREFIX_country
|
||||
ADD deleted TINYINT(1) NOT NULL DEFAULT 0;
|
||||
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
INSERT INTO PREFIX_lang (`name`, `active`, `iso_code`) VALUES
|
||||
('Norsk (Norwegian)', 0, 'no'),
|
||||
('ภาษาไทย (Thai)', 0, 'th'),
|
||||
('Dansk (Danish)', 0, 'dk');
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/* PHP */
|
||||
/* PHP:AttributeGroup::cleanDeadCombinations(); */;
|
||||
|
||||
/* STRUCTURE */
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* CONTENTS */
|
||||
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES
|
||||
('PS_DISP_UNAVAILABLE_ATTR', '1', NOW(), NOW());
|
||||
|
||||
INSERT INTO PREFIX_lang (`name`, `active`, `iso_code`) VALUES
|
||||
('Svenska (Swedish)', 0, 'se'),
|
||||
('עברית (Hebrew)', 0, 'he');
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
|
||||
@@ -0,0 +1,629 @@
|
||||
/* PHP */
|
||||
/* PHP:AttributeGroup::cleanDeadCombinations(); */;
|
||||
/* PHP:configuration_double_cleaner(); */;
|
||||
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
DROP TABLE IF EXISTS PREFIX_gender;
|
||||
DROP TABLE IF EXISTS PREFIX_search;
|
||||
ALTER TABLE PREFIX_category_lang
|
||||
ADD INDEX category_name (name);
|
||||
ALTER TABLE PREFIX_order_detail
|
||||
MODIFY COLUMN product_name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
|
||||
ALTER TABLE PREFIX_order_detail
|
||||
ADD deleted TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE PREFIX_configuration
|
||||
MODIFY COLUMN name VARCHAR(32) NOT NULL UNIQUE;
|
||||
ALTER TABLE PREFIX_orders
|
||||
ADD invoice_number INTEGER(10) UNSIGNED NOT NULL DEFAULT 0 AFTER total_wrapping;
|
||||
ALTER TABLE PREFIX_orders
|
||||
ADD delivery_number INTEGER(10) UNSIGNED NOT NULL DEFAULT 0 AFTER invoice_number;
|
||||
ALTER TABLE PREFIX_orders
|
||||
ADD invoice_date DATETIME NOT NULL AFTER delivery_number;
|
||||
ALTER TABLE PREFIX_orders
|
||||
ADD delivery_date DATETIME NOT NULL AFTER invoice_date;
|
||||
ALTER TABLE PREFIX_order_detail
|
||||
CHANGE product_price product_price DECIMAL(13, 6) NOT NULL DEFAULT 0.000000;
|
||||
ALTER TABLE PREFIX_order_slip
|
||||
ADD shipping_cost TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER id_order;
|
||||
ALTER TABLE PREFIX_order_state
|
||||
ADD delivery TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER logable;
|
||||
ALTER TABLE PREFIX_country
|
||||
DROP deleted;
|
||||
ALTER TABLE PREFIX_product
|
||||
ADD customizable BOOL NOT NULL DEFAULT 0 AFTER quantity_discount;
|
||||
ALTER TABLE PREFIX_product
|
||||
ADD uploadable_files TINYINT NOT NULL DEFAULT 0 AFTER customizable;
|
||||
ALTER TABLE PREFIX_product
|
||||
ADD text_fields TINYINT NOT NULL DEFAULT 0 AFTER uploadable_files;
|
||||
ALTER TABLE PREFIX_product_lang
|
||||
CHANGE availability available_now VARCHAR(255) NULL;
|
||||
ALTER TABLE PREFIX_product_lang
|
||||
ADD available_later VARCHAR(255) NULL AFTER available_now;
|
||||
ALTER TABLE PREFIX_access
|
||||
DROP id_access;
|
||||
ALTER TABLE PREFIX_access
|
||||
DROP INDEX access_profile;
|
||||
ALTER TABLE PREFIX_access
|
||||
DROP INDEX access_tab;
|
||||
ALTER TABLE PREFIX_access
|
||||
ADD PRIMARY KEY(id_profile, id_tab);
|
||||
ALTER TABLE PREFIX_currency
|
||||
ADD blank TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER sign;
|
||||
ALTER TABLE PREFIX_currency
|
||||
ADD decimals TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 AFTER format;
|
||||
ALTER TABLE PREFIX_product_attribute
|
||||
ADD wholesale_price decimal(13,6) NOT NULL DEFAULT 0.000000 AFTER ean13;
|
||||
ALTER TABLE PREFIX_employee
|
||||
ADD last_passwd_gen TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER passwd;
|
||||
ALTER TABLE PREFIX_customer
|
||||
ADD last_passwd_gen TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER passwd;
|
||||
ALTER TABLE PREFIX_customer
|
||||
ADD ip_registration_newsletter VARCHAR(15) NULL DEFAULT NULL AFTER newsletter;
|
||||
ALTER TABLE PREFIX_image_type
|
||||
ADD scenes TINYINT(1) NOT NULL DEFAULT 1;
|
||||
ALTER TABLE PREFIX_image_lang
|
||||
CHANGE legend legend VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
|
||||
|
||||
/* CMS */
|
||||
CREATE TABLE PREFIX_cms (
|
||||
id_cms INTEGER UNSIGNED NOT NULL auto_increment,
|
||||
PRIMARY KEY (id_cms)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_cms_lang (
|
||||
id_cms INTEGER UNSIGNED NOT NULL auto_increment,
|
||||
id_lang INTEGER UNSIGNED NOT NULL,
|
||||
meta_title VARCHAR(128) NOT NULL,
|
||||
meta_description VARCHAR(255) DEFAULT NULL,
|
||||
meta_keywords VARCHAR(255) DEFAULT NULL,
|
||||
content longtext NULL,
|
||||
link_rewrite VARCHAR(128) NOT NULL,
|
||||
PRIMARY KEY (id_cms, id_lang)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_block_cms (
|
||||
id_block INTEGER(10) NOT NULL,
|
||||
id_cms INTEGER(10) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
/* PAYMENT MODULE RESTRICTIONS */
|
||||
CREATE TABLE `PREFIX_module_country` (
|
||||
`id_module` INTEGER UNSIGNED NOT NULL,
|
||||
`id_country` INTEGER UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`id_module`, `id_country`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `PREFIX_module_currency` (
|
||||
`id_module` INTEGER UNSIGNED NOT NULL,
|
||||
`id_currency` INTEGER NOT NULL,
|
||||
PRIMARY KEY (`id_module`, `id_currency`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
/* ORDER-MESSAGE */
|
||||
CREATE TABLE PREFIX_order_message
|
||||
(
|
||||
id_order_message int(10) unsigned NOT NULL auto_increment,
|
||||
date_add datetime NOT NULL,
|
||||
PRIMARY KEY (id_order_message)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_order_message_lang
|
||||
(
|
||||
id_order_message int(10) unsigned NOT NULL,
|
||||
id_lang int(10) unsigned NOT NULL,
|
||||
name varchar(128) NOT NULL,
|
||||
message text NOT NULL,
|
||||
PRIMARY KEY (id_order_message,id_lang)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
/* SUB-DOMAINS */
|
||||
CREATE TABLE PREFIX_subdomain (
|
||||
id_subdomain INTEGER(10) NOT NULL AUTO_INCREMENT,
|
||||
name VARCHAR(16) NOT NULL,
|
||||
PRIMARY KEY(id_subdomain)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
/* META-CLASS */
|
||||
CREATE TABLE PREFIX_meta (
|
||||
id_meta INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
page VARCHAR(64) NOT NULL,
|
||||
PRIMARY KEY(id_meta),
|
||||
KEY `meta_name` (`page`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_meta_lang (
|
||||
id_meta INTEGER UNSIGNED NOT NULL,
|
||||
id_lang INTEGER UNSIGNED NOT NULL,
|
||||
title VARCHAR(255) NULL,
|
||||
description VARCHAR(255) NULL,
|
||||
keywords VARCHAR(255) NULL,
|
||||
PRIMARY KEY (id_meta, id_lang)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_discount_category (
|
||||
id_discount INTEGER(11) NOT NULL,
|
||||
id_category INTEGER(11) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
/* Customized products */
|
||||
CREATE TABLE PREFIX_customization (
|
||||
id_customization int(10) NOT NULL AUTO_INCREMENT,
|
||||
id_product_attribute int(10) NOT NULL DEFAULT 0,
|
||||
id_cart int(10) NOT NULL,
|
||||
id_product int(10) NOT NULL,
|
||||
PRIMARY KEY(id_customization, id_cart, id_product)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_customized_data (
|
||||
id_customization int(10) NOT NULL,
|
||||
`type` tinyint(1) NOT NULL,
|
||||
`index` int(3) NOT NULL,
|
||||
`value` varchar(255) NOT NULL,
|
||||
PRIMARY KEY(id_customization, `type`, `index`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_customization_field (
|
||||
id_customization_field int(10) NOT NULL AUTO_INCREMENT,
|
||||
id_product int(10) NOT NULL,
|
||||
type tinyint(1) NOT NULL,
|
||||
required tinyint(1) NOT NULL,
|
||||
PRIMARY KEY(id_customization_field)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_customization_field_lang (
|
||||
id_customization_field int(10) NOT NULL,
|
||||
id_lang int(10) NOT NULL,
|
||||
name varchar(255) NOT NULL,
|
||||
PRIMARY KEY(id_customization_field, id_lang)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
/* Product location */
|
||||
ALTER TABLE `PREFIX_product_attribute` ADD `location` VARCHAR(64) NULL AFTER `supplier_reference`;
|
||||
ALTER TABLE `PREFIX_product` ADD `location` VARCHAR(64) NULL AFTER `supplier_reference`;
|
||||
|
||||
/* Paypal default e-mail fix */
|
||||
UPDATE `PREFIX_configuration` SET value = 'paypal@prestashop.com' WHERE name = 'PAYPAL_BUSINESS' AND value = 'your-address@paypal.com';
|
||||
|
||||
/* ##################################### */
|
||||
/* CONTENTS */
|
||||
/* ##################################### */
|
||||
INSERT INTO PREFIX_subdomain (id_subdomain, name) VALUES (NULL, 'www');
|
||||
UPDATE PREFIX_currency SET blank = 1 WHERE iso_code = 'EUR';
|
||||
UPDATE PREFIX_order_state SET delivery = 1 WHERE id_order_state = 3;
|
||||
UPDATE PREFIX_order_state SET delivery = 1 WHERE id_order_state = 4;
|
||||
UPDATE PREFIX_order_state SET delivery = 1 WHERE id_order_state = 5;
|
||||
|
||||
/* IMAGE MAPPING */
|
||||
UPDATE PREFIX_image_type SET scenes = 0;
|
||||
INSERT INTO `PREFIX_image_type` (`name` ,`width` ,`height` ,`products` ,`categories` ,`manufacturers` ,`suppliers` ,`scenes`) VALUES ('large_scene', '556', '200', '0', '0', '0', '0', '1');
|
||||
INSERT INTO `PREFIX_image_type` (`name` ,`width` ,`height` ,`products` ,`categories` ,`manufacturers` ,`suppliers` ,`scenes`) VALUES ('thumb_scene', '161', '58', '0', '0', '0', '0', '1');
|
||||
|
||||
/* CONFIGURATION VARIABLE */
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_INVOICE', '1', NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_INVOICE_PREFIX', 'IN', NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_DELIVERY_PREFIX', 'DE', NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PRODUCT_PICTURE_MAX_SIZE', '131072', NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PRODUCT_PICTURE_WIDTH', '64', NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PRODUCT_PICTURE_HEIGHT', '64', NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PASSWD_TIME_BACK', '360', NOW(), NOW());
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_PASSWD_TIME_FRONT', '360', NOW(), NOW());
|
||||
|
||||
INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES ((SELECT id_configuration FROM PREFIX_configuration c WHERE c.name = 'PS_INVOICE_PREFIX' LIMIT 1), 1, 'IN', NOW());
|
||||
INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES ((SELECT id_configuration FROM PREFIX_configuration c WHERE c.name = 'PS_INVOICE_PREFIX' LIMIT 1), 2, 'FA', NOW());
|
||||
INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES ((SELECT id_configuration FROM PREFIX_configuration c WHERE c.name = 'PS_DELIVERY_PREFIX' LIMIT 1), 1, 'DE', NOW());
|
||||
INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES ((SELECT id_configuration FROM PREFIX_configuration c WHERE c.name = 'PS_DELIVERY_PREFIX' LIMIT 1), 2, 'LI', NOW());
|
||||
|
||||
/* HOOKS/MODULES */
|
||||
UPDATE PREFIX_hook SET description = 'This hook is called when a product is deleted' WHERE name = 'deleteProduct' LIMIT 1;
|
||||
UPDATE PREFIX_hook SET name = 'extraLeft', title = 'Extra actions on the product page (left column).' WHERE name = 'extra' LIMIT 1;
|
||||
INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('orderReturn', 'Product returned', 0, 'When an order return is made');
|
||||
INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('postUpdateOrderStatus', 'Post Order\'s status update event', 0, 'Launch modules when the order\'s status was changed (enables automated workflow).');
|
||||
INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('productActions', 'Product actions', 1, 'Put new action buttons on product page');
|
||||
INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('cancelProduct', 'Product cancelled', 0, 'This hook is called when you cancel a product in an order');
|
||||
INSERT INTO PREFIX_hook (name, title, position) VALUES ('backOfficeHome', 'Administration panel homepage', 1);
|
||||
INSERT INTO PREFIX_hook (name, title, position, description) VALUES ('extraRight', 'Extra actions on the product page (right column).', 0, NULL);
|
||||
UPDATE PREFIX_hook SET position = 1 WHERE name = 'top';
|
||||
UPDATE PREFIX_hook SET position = 0 WHERE name = 'header';
|
||||
|
||||
/* ORDER MESSAGES */
|
||||
INSERT INTO `PREFIX_order_message` (`id_order_message`, `date_add`) VALUES (1, NOW());
|
||||
INSERT INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) VALUES
|
||||
(1, 1, 'Delay', 'Hi,
|
||||
|
||||
Unfortunately, an item on your order is currently out of stock. This may cause a slight delay in delivery.
|
||||
Please accept our apologies and rest assured that we are working hard to rectify this.
|
||||
|
||||
Best regards,
|
||||
');
|
||||
INSERT INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`) VALUES
|
||||
(1, 2, 'Délai', 'Bonjour,
|
||||
|
||||
Un des éléments de votre commande est actuellement en réapprovisionnement, ce qui peut légèrement retarder son envoi.
|
||||
|
||||
Merci de votre compréhension.
|
||||
|
||||
Cordialement,
|
||||
');
|
||||
|
||||
/* META */
|
||||
INSERT INTO `PREFIX_meta` (`id_meta`, `page`) VALUES
|
||||
(1, '404'),
|
||||
(2, 'best-sales'),
|
||||
(3, 'contact-form'),
|
||||
(4, 'index'),
|
||||
(5, 'manufacturer'),
|
||||
(6, 'new-products'),
|
||||
(7, 'password'),
|
||||
(8, 'prices-drop'),
|
||||
(9, 'sitemap'),
|
||||
(10, 'supplier');
|
||||
|
||||
INSERT INTO `PREFIX_meta_lang` (`id_meta`, `id_lang`, `title`, `description`, `keywords`) VALUES
|
||||
(1, 1, '404 error', 'This page cannot be found', 'error, 404, not found'),
|
||||
(1, 2, 'Erreur 404', 'Cette page est introuvable', 'erreur, 404, introuvable'),
|
||||
(2, 1, 'Best sales', 'Our best sales', 'best sales'),
|
||||
(2, 2, 'Meilleurs ventes', 'Liste de nos produits les mieux vendus', 'meilleurs ventes'),
|
||||
(3, 1, 'Contact us', 'Use our form to contact us', 'contact, form, e-mail'),
|
||||
(3, 2, 'Contactez-nous', 'Utilisez notre formulaire pour nous contacter', 'contact, formulaire, e-mail'),
|
||||
(4, 1, '', 'Shop powered by PrestaShop', 'shop, prestashop'),
|
||||
(4, 2, '', 'Boutique propulsé par PrestaShop', 'boutique, prestashop'),
|
||||
(5, 1, 'Manufacturers', 'Manufacturers list', 'manufacturer'),
|
||||
(5, 2, 'Fabricants', 'Liste de nos fabricants', 'fabricants'),
|
||||
(6, 1, 'New products', 'Our new products', 'new, products'),
|
||||
(6, 2, 'Nouveaux produits', 'Liste de nos nouveaux produits', 'nouveau, produit'),
|
||||
(7, 1, 'Forgot your password', 'Enter your e-mail address used to register in goal to get e-mail with your new password', 'forgot, password, e-mail, new, reset'),
|
||||
(7, 2, 'Mot de passe oublié', 'Renseignez votre adresse e-mail afin de recevoir votre nouveau mot de passe.', 'mot de passe, oublié, e-mail, nouveau, regénération'),
|
||||
(8, 1, 'Specials', 'Our special products', 'special, prices drop'),
|
||||
(8, 2, 'Promotions', 'Nos produits en promotion', 'promotion, réduction'),
|
||||
(9, 1, 'Sitemap', 'Lost ? Find what your are looking for', 'sitemap'),
|
||||
(9, 2, 'Plan du site', 'Perdu ? Trouvez ce que vous cherchez', 'plan, site'),
|
||||
(10, 1, 'Suppliers', 'Suppliers list', 'supplier'),
|
||||
(10, 2, 'Fournisseurs', 'Liste de nos fournisseurs', 'fournisseurs');
|
||||
|
||||
/* CMS */
|
||||
INSERT INTO `PREFIX_cms` VALUES (1),(2),(3),(4),(5);
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(1, 1, 'Delivery', 'Our terms and conditions of delivery', 'conditions, delivery, delay, shipment, pack', '<h2>Shipments and returns</h2><h3>Your pack shipment</h3><p>Packages are generally dispatched within 2 days after receipt of payment and are shipped via Colissimo with tracking and drop-off without signature. If you prefer delivery by Colissimo Extra with required signature, an additional cost will be applied, so please contact us before choosing this method. Whichever shipment choice you make, we will provide you with a link to track your package online.</p><p>Shipping fees include handling and packing fees as well as postage costs. Handling fees are fixed, whereas transport fees vary according to total weight of the shipment. We advise you to group your items in one order. We cannot group two distinct orders placed separately, and shipping fees will apply to each of them. Your package will be dispatched at your own risk, but special care is taken to protect fragile objects.<br /><br />Boxes are amply sized and your items are well-protected.</p>', 'delivery');
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(1, 2, 'Livraison', 'Nos conditions générales de livraison', 'conditions, livraison, délais, transport, colis', '<h2>Livraisons et retours</h2><h3>Le transport de votre colis</h3><p>Les colis sont généralement expédiés en 48h après réception de votre paiement. Le mode d''expédidition standard est le Colissimo suivi, remis sans signature. Si vous souhaitez une remise avec signature, un coût supplémentaire s''applique, merci de nous contacter. Quel que soit le mode d''expédition choisi, nous vous fournirons dès que possible un lien qui vous permettra de suivre en ligne la livraison de votre colis.</p><p>Les frais d''expédition comprennent l''emballage, la manutention et les frais postaux. Ils peuvent contenir une partie fixe et une partie variable en fonction du prix ou du poids de votre commande. Nous vous conseillons de regrouper vos achats en une unique commande. Nous ne pouvons pas grouper deux commandes distinctes et vous devrez vous acquitter des frais de port pour chacune d''entre elles. Votre colis est expédié à vos propres risques, un soin particulier est apporté au colis contenant des produits fragiles..<br /><br />Les colis sont surdimensionnés et protégés.</p>', 'livraison');
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(2, 1, 'Legal Notice', 'Legal notice', 'notice, legal, credits', '<h2>Legal</h2><h3>Credits</h3><p>Concept and production:</p><p>This Web site was created using <a href="http://www.prestashop.com">PrestaShop</a>™ open-source software.</p>', 'legal-notice');
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(2, 2, 'Mentions légales', 'Mentions légales', 'mentions, légales, crédits', '<h2>Mentions légales</h2><h3>Crédits</h3><p>Concept et production :</p><p>Ce site internet a été réalisé en utilisant la solution open-source <a href="http://www.prestashop.com">PrestaShop</a>™ .</p>', 'mentions-legales');
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(3, 1, 'Terms and conditions of use', 'Our terms and conditions of use', 'conditions, terms, use, sell', '<h2>Your terms and conditions of use</h2><h3>Rule 1</h3><p>Here is the rule 1 content</p>\r\n<h3>Rule 2</h3><p>Here is the rule 2 content</p>\r\n<h3>Rule 3</h3><p>Here is the rule 3 content</p>', 'terms-and-conditions-of-use');
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(3, 2, 'Conditions d''utilisation', 'Nos conditions générales de ventes', 'conditions, utilisation, générales, ventes', '<h2>Vos conditions de ventes</h2><h3>Règle n°1</h3><p>Contenu de la règle numéro 1</p>\r\n<h3>Règle n°2</h3><p>Contenu de la règle numéro 2</p>\r\n<h3>Règle n°3</h3><p>Contenu de la règle numéro 3</p>', 'conditions-generales-de-ventes');
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(4, 1, 'About us', 'Learn more about us', 'about us, informations', '<h2>About us</h2>\r\n<h3>Our company</h3><p>Our company</p>\r\n<h3>Our team</h3><p>Our team</p>\r\n<h3>Informations</h3><p>Informations</p>', 'about-us');
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(4, 2, 'A propos', 'Apprenez-en d''avantage sur nous', 'à propos, informations', '<h2>A propos</h2>\r\n<h3>Notre entreprise</h3><p>Notre entreprise</p>\r\n<h3>Notre équipe</h3><p>Notre équipe</p>\r\n<h3>Informations</h3><p>Informations</p>', 'a-propos');
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(5, 1, 'Secure payment', 'Our secure payment mean', 'secure payment, ssl, visa, mastercard, paypal', '<h2>Secure payment</h2>\r\n<h3>Our secure payment</h3><p>With SSL</p>\r\n<h3>Using Visa/Mastercard/Paypal</h3><p>About this services</p>', 'secure-payment');
|
||||
INSERT INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `meta_title`, `meta_description`, `meta_keywords`, `content`, `link_rewrite`) VALUES
|
||||
(5, 2, 'Paiement sécurisé', 'Notre offre de paiement sécurisé', 'paiement sécurisé, ssl, visa, mastercard, paypal', '<h2>Paiement sécurisé</h2>\r\n<h3>Notre offre de paiement sécurisé</h3><p>Avec SSL</p>\r\n<h3>Utilisation de Visa/Mastercard/Paypal</h3><p>A propos de ces services</p>', 'paiement-securise');
|
||||
|
||||
INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockvariouslinks' LIMIT 1), 0), 3);
|
||||
INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockvariouslinks' LIMIT 1), 0), 4);
|
||||
INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockinfos' LIMIT 1), 0), 1);
|
||||
INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockinfos' LIMIT 1), 0), 2);
|
||||
INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockinfos' LIMIT 1), 0), 3);
|
||||
INSERT INTO PREFIX_block_cms (`id_block`, `id_cms`) VALUES (IFNULL((SELECT id_module FROM PREFIX_module m WHERE m.name = 'blockinfos' LIMIT 1), 0), 4);
|
||||
DELETE FROM PREFIX_block_cms WHERE id_block = 0;
|
||||
|
||||
/* NEW TABS */
|
||||
UPDATE PREFIX_tab_lang
|
||||
SET name = 'Vouchers'
|
||||
WHERE id_lang = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'en' LIMIT 1)
|
||||
AND id_tab = (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminDiscounts' LIMIT 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminCMS', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminCMS' LIMIT 1),
|
||||
'CMS' FROM PREFIX_lang);
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminCMS' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminSubDomains', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSubDomains' LIMIT 1),
|
||||
'Subdomains' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Sous domaines'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminSubDomains')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminSubDomains' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminOrderMessage', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminOrderMessage' LIMIT 1),
|
||||
'Order messages' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Messages prédéfinis'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminOrderMessage')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminOrderMessage' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp), 'AdminDeliverySlip', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminOrders' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminDeliverySlip' LIMIT 1),
|
||||
'Delivery slips' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Bons de livraison'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminDeliverySlip')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminDeliverySlip' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp), 'AdminBackup', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminTools' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminBackup' LIMIT 1),
|
||||
'Database backup' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Sauvegarde BDD'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminBackup')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminBackup' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp), 'AdminMeta', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminPreferences' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminMeta' LIMIT 1),
|
||||
'Meta-tags' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Méta-Tags'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminMeta')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminMeta' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
INSERT INTO PREFIX_tab (id_parent, class_name, position) VALUES ((SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp), 'AdminScenes', (SELECT tmp.max FROM (SELECT MAX(position) max FROM `PREFIX_tab` WHERE id_parent = (SELECT tmp.`id_tab` FROM (SELECT `id_tab` FROM PREFIX_tab t WHERE t.class_name = 'AdminCatalog' LIMIT 1) AS tmp )) AS tmp));
|
||||
INSERT INTO PREFIX_tab_lang (id_lang, id_tab, name) (
|
||||
SELECT id_lang,
|
||||
(SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminScenes' LIMIT 1),
|
||||
'Image mapping' FROM PREFIX_lang);
|
||||
UPDATE `PREFIX_tab_lang` SET `name` = 'Scènes'
|
||||
WHERE `id_tab` = (SELECT `id_tab` FROM `PREFIX_tab` t WHERE t.class_name = 'AdminScenes')
|
||||
AND `id_lang` = (SELECT `id_lang` FROM `PREFIX_lang` l WHERE l.iso_code = 'fr');
|
||||
INSERT INTO PREFIX_access (id_profile, id_tab, `view`, `add`, edit, `delete`) VALUES ('1', (SELECT id_tab FROM PREFIX_tab t WHERE t.class_name = 'AdminScenes' LIMIT 1), 1, 1, 1, 1);
|
||||
|
||||
/* NEW TEAM TAB */
|
||||
UPDATE PREFIX_tab SET position = 10 WHERE class_name = 'AdminTools';
|
||||
UPDATE PREFIX_tab SET position = 9 WHERE class_name = 'AdminPreferences';
|
||||
UPDATE PREFIX_tab SET position = 8, id_parent = 0 WHERE class_name = 'AdminEmployees';
|
||||
UPDATE PREFIX_tab SET position = 1, id_parent = 29 WHERE class_name = 'AdminProfiles';
|
||||
UPDATE PREFIX_tab SET position = 2, id_parent = 29 WHERE class_name = 'AdminAccess';
|
||||
UPDATE PREFIX_tab SET position = 3, id_parent = 29 WHERE class_name = 'AdminContacts';
|
||||
UPDATE PREFIX_tab SET position = 1 WHERE class_name = 'AdminLanguages';
|
||||
UPDATE PREFIX_tab SET position = 2 WHERE class_name = 'AdminTranslations';
|
||||
UPDATE PREFIX_tab SET position = 3 WHERE class_name = 'AdminTabs';
|
||||
UPDATE PREFIX_tab SET position = 4 WHERE class_name = 'AdminQuickAccesses';
|
||||
UPDATE PREFIX_tab SET position = 5 WHERE class_name = 'AdminAliases';
|
||||
UPDATE PREFIX_tab SET position = 6 WHERE class_name = 'AdminImport';
|
||||
UPDATE PREFIX_tab SET position = 7 WHERE class_name = 'AdminSubDomains';
|
||||
|
||||
/* UPDATE ORDER TABS */
|
||||
UPDATE PREFIX_tab SET class_name = 'AdminInvoices' WHERE class_name = 'AdminPrintPDF';
|
||||
UPDATE PREFIX_tab SET position = 1 WHERE class_name = 'AdminInvoices';
|
||||
UPDATE PREFIX_tab SET position = 2 WHERE class_name = 'AdminReturn';
|
||||
UPDATE PREFIX_tab SET position = 3 WHERE class_name = 'AdminSlip';
|
||||
UPDATE PREFIX_tab SET position = 4 WHERE class_name = 'AdminOrdersStates';
|
||||
UPDATE PREFIX_tab_lang SET name = 'Invoices' WHERE name = 'PDF Invoice';
|
||||
UPDATE PREFIX_tab_lang SET name = 'Factures' WHERE name = 'Facture PDF';
|
||||
|
||||
/* ##################################### */
|
||||
/* STATS */
|
||||
/* ##################################### */
|
||||
CREATE TABLE PREFIX_web_browser (
|
||||
id_web_browser INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
name VARCHAR(64) NULL,
|
||||
PRIMARY KEY(id_web_browser)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_operating_system (
|
||||
id_operating_system INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
name VARCHAR(64) NULL,
|
||||
PRIMARY KEY(id_operating_system)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_page_type (
|
||||
id_page_type INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
name VARCHAR(256) NOT NULL,
|
||||
PRIMARY KEY(id_page_type)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_date_range (
|
||||
id_date_range INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
time_start DATETIME NOT NULL,
|
||||
time_end DATETIME NOT NULL,
|
||||
PRIMARY KEY(id_date_range)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_page (
|
||||
id_page INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
id_page_type INTEGER(10) UNSIGNED NOT NULL,
|
||||
id_object VARCHAR(256) NULL,
|
||||
PRIMARY KEY(id_page)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_page_viewed (
|
||||
id_page INTEGER(10) UNSIGNED NOT NULL,
|
||||
id_date_range INTEGER UNSIGNED NOT NULL,
|
||||
counter INTEGER UNSIGNED NOT NULL,
|
||||
PRIMARY KEY(id_page, id_date_range)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE PREFIX_guest (
|
||||
id_guest INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
id_operating_system INTEGER(10) UNSIGNED NULL DEFAULT NULL,
|
||||
id_web_browser INTEGER(10) UNSIGNED NULL DEFAULT NULL,
|
||||
id_customer INTEGER(10) UNSIGNED NULL DEFAULT NULL,
|
||||
javascript BOOL NULL DEFAULT 0,
|
||||
screen_resolution_x SMALLINT UNSIGNED NULL DEFAULT NULL,
|
||||
screen_resolution_y SMALLINT UNSIGNED NULL DEFAULT NULL,
|
||||
screen_color TINYINT UNSIGNED NULL DEFAULT NULL,
|
||||
sun_java BOOL NULL DEFAULT NULL,
|
||||
adobe_flash BOOL NULL DEFAULT NULL,
|
||||
adobe_director BOOL NULL DEFAULT NULL,
|
||||
apple_quicktime BOOL NULL DEFAULT NULL,
|
||||
real_player BOOL NULL DEFAULT NULL,
|
||||
windows_media BOOL NULL DEFAULT NULL,
|
||||
accept_language VARCHAR(8) NULL DEFAULT NULL,
|
||||
PRIMARY KEY(id_guest)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_scene` (
|
||||
`id_scene` int(10) NOT NULL auto_increment,
|
||||
`active` tinyint(1) NOT NULL default '1',
|
||||
PRIMARY KEY (`id_scene`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_scene_category` (
|
||||
`id_scene` int(10) NOT NULL,
|
||||
`id_category` int(10) NOT NULL,
|
||||
PRIMARY KEY (`id_scene`,`id_category`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_scene_lang` (
|
||||
`id_scene` int(10) NOT NULL,
|
||||
`id_lang` int(10) NOT NULL,
|
||||
`name` varchar(100) NOT NULL,
|
||||
PRIMARY KEY (`id_scene`,`id_lang`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_scene_products` (
|
||||
`id_scene` int(10) NOT NULL,
|
||||
`id_product` int(10) NOT NULL,
|
||||
`x_axis` int(4) NOT NULL,
|
||||
`y_axis` int(4) NOT NULL,
|
||||
`zone_width` int(3) NOT NULL,
|
||||
`zone_height` int(3) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO PREFIX_guest (id_customer) SELECT id_customer FROM PREFIX_customer;
|
||||
|
||||
ALTER TABLE PREFIX_connections ADD id_guest INTEGER(10) UNSIGNED NULL AFTER id_connections;
|
||||
ALTER TABLE PREFIX_connections ADD id_page INTEGER(10) UNSIGNED NOT NULL AFTER id_guest;
|
||||
ALTER TABLE PREFIX_connections ADD http_referer VARCHAR(256) NULL;
|
||||
ALTER TABLE PREFIX_connections CHANGE date date_add DATETIME NOT NULL;
|
||||
|
||||
UPDATE PREFIX_connections, PREFIX_guest SET PREFIX_connections.id_guest=PREFIX_guest.id_guest WHERE PREFIX_connections.id_customer=PREFIX_guest.id_customer;
|
||||
ALTER TABLE PREFIX_connections CHANGE id_guest id_guest INTEGER(10) UNSIGNED NOT NULL;
|
||||
ALTER TABLE PREFIX_connections DROP id_customer;
|
||||
|
||||
CREATE TABLE PREFIX_connections_page (
|
||||
id_connections INTEGER(10) UNSIGNED NOT NULL,
|
||||
id_page INTEGER(10) UNSIGNED NOT NULL,
|
||||
time_start DATETIME NOT NULL,
|
||||
time_end DATETIME NULL,
|
||||
PRIMARY KEY(id_connections, id_page, time_start)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `PREFIX_operating_system` (`name`) VALUES ('Windows XP'),('Windows Vista'),('MacOsX'),('Linux');
|
||||
INSERT INTO `PREFIX_web_browser` (`name`) VALUES ('Safari'),('Firefox 2.x'),('Firefox 3.x'),('Opera'),('IE 6.x'),('IE 7.x'),('IE 8.x'),('Google Chrome');
|
||||
INSERT INTO `PREFIX_page_type` (`name`) VALUES ('product.php'),('category.php'),('order.php'),('manufacturer.php');
|
||||
|
||||
INSERT INTO `PREFIX_hook` (`name`, `title`, `position`) VALUES
|
||||
('AdminStatsModules', 'Stats - Modules', 1),
|
||||
('GraphEngine', 'Graph Engines', 0),
|
||||
('GridEngine', 'Grid Engines', 0);
|
||||
|
||||
/* Temporary configuration variable used in the following query */
|
||||
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES ('TMP_ID_TAB_STATS', (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStats'), NOW(), NOW());
|
||||
INSERT INTO `PREFIX_tab` (`id_parent`, `class_name`, `position`) VALUES
|
||||
((SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'TMP_ID_TAB_STATS'), 'AdminStatsModules', 1);
|
||||
INSERT INTO `PREFIX_tab` (`id_parent`, `class_name`, `position`) VALUES
|
||||
((SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'TMP_ID_TAB_STATS'), 'AdminStatsConf', 2);
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(1, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsModules'), 'Modules');
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(2, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsModules'), 'Modules');
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(1, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsConf'), 'Settings');
|
||||
INSERT INTO `PREFIX_tab_lang` (`id_lang`, `id_tab`, `name`) VALUES
|
||||
(2, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsConf'), 'Configuration');
|
||||
INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES
|
||||
(1, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsModules'), 1, 1, 1, 1);
|
||||
INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES
|
||||
(1, (SELECT `id_tab` FROM `PREFIX_tab` WHERE `class_name` = 'AdminStatsConf'), 1, 1, 1, 1);
|
||||
DELETE FROM `PREFIX_configuration` WHERE `name` = 'TMP_ID_TAB_STATS';
|
||||
|
||||
/* ##################################### */
|
||||
/* DOUBLE LANGUAGE */
|
||||
/* ##################################### */
|
||||
INSERT IGNORE INTO `PREFIX_discount_type_lang` (`id_discount_type`, `id_lang`, `name`)
|
||||
(SELECT `id_discount_type`, id_lang, (SELECT tl.`name`
|
||||
FROM `PREFIX_discount_type_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_discount_type`=`PREFIX_discount_type`.`id_discount_type`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_discount_type`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_cms_lang` (`id_cms`, `id_lang`, `link_rewrite`, `meta_description`, `meta_keywords`, `meta_title`, `content`)
|
||||
(SELECT `id_cms`, id_lang,
|
||||
(SELECT tl.`link_rewrite`
|
||||
FROM `PREFIX_cms_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`),
|
||||
(SELECT tl.`meta_description`
|
||||
FROM `PREFIX_cms_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`),
|
||||
(SELECT tl.`meta_keywords`
|
||||
FROM `PREFIX_cms_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`),
|
||||
(SELECT tl.`meta_title`
|
||||
FROM `PREFIX_cms_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`),
|
||||
(SELECT tl.`content`
|
||||
FROM `PREFIX_cms_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_cms`=`PREFIX_cms`.`id_cms`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_cms`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_meta_lang` (`id_meta`, `id_lang`, `description`, `keywords`, `title`)
|
||||
(SELECT `id_meta`, id_lang,
|
||||
(SELECT tl.`description`
|
||||
FROM `PREFIX_meta_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_meta`=`PREFIX_meta`.`id_meta`),
|
||||
(SELECT tl.`keywords`
|
||||
FROM `PREFIX_meta_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_meta`=`PREFIX_meta`.`id_meta`),
|
||||
(SELECT tl.`title`
|
||||
FROM `PREFIX_meta_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_meta`=`PREFIX_meta`.`id_meta`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_meta`);
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_order_message_lang` (`id_order_message`, `id_lang`, `name`, `message`)
|
||||
(SELECT `id_order_message`, id_lang,
|
||||
(SELECT tl.`name`
|
||||
FROM `PREFIX_order_message_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_message`=`PREFIX_order_message`.`id_order_message`),
|
||||
(SELECT tl.`message`
|
||||
FROM `PREFIX_order_message_lang` tl
|
||||
WHERE tl.`id_lang` = (SELECT c.`value`
|
||||
FROM `PREFIX_configuration` c
|
||||
WHERE c.`name` = 'PS_LANG_DEFAULT' LIMIT 1) AND tl.`id_order_message`=`PREFIX_order_message`.`id_order_message`)
|
||||
FROM `PREFIX_lang` CROSS JOIN `PREFIX_order_message`);
|
||||
|
||||
/* PHP */
|
||||
/* PHP:invoice_number_set(); */;
|
||||
/* PHP:delivery_number_set(); */;
|
||||
/* PHP:set_payment_module(); */;
|
||||
/* PHP:set_discount_category(); */;
|
||||
@@ -0,0 +1,3 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
@@ -0,0 +1,10 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
DROP TABLE IF EXISTS PREFIX_product_picture;
|
||||
|
||||
/* PHP */
|
||||
/* PHP:moduleReinstaller('blockmyaccount'); */;
|
||||
@@ -0,0 +1,28 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
ALTER TABLE PREFIX_order_detail
|
||||
DROP `deleted`,
|
||||
ADD product_quantity_cancelled INT(10) UNSIGNED NOT NULL AFTER product_quantity_return;
|
||||
|
||||
ALTER TABLE PREFIX_customization ADD quantity INT(10) NOT NULL;
|
||||
|
||||
ALTER TABLE PREFIX_order_return_detail ADD id_customization INT(10) NOT NULL DEFAULT 0 AFTER id_order_detail;
|
||||
ALTER TABLE PREFIX_order_return_detail DROP PRIMARY KEY;
|
||||
ALTER TABLE PREFIX_order_return_detail ADD PRIMARY KEY (id_order_return, id_order_detail, id_customization);
|
||||
|
||||
|
||||
ALTER TABLE PREFIX_orders
|
||||
CHANGE payment payment VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
CHANGE module module VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
|
||||
|
||||
/* ################################# */
|
||||
/* CONTENTS */
|
||||
/* ################################# */
|
||||
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES
|
||||
('productOutOfStock', 'Product out of stock', 'Make action while product is out of stock', 1),
|
||||
('updateProductAttribute', 'Product attribute update', NULL, 1);
|
||||
@@ -0,0 +1,20 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
ALTER TABLE PREFIX_product
|
||||
CHANGE customizable customizable TINYINT(2) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE PREFIX_connections
|
||||
CHANGE ip_address ip_address VARCHAR(16) NULL;
|
||||
ALTER TABLE PREFIX_customer
|
||||
ADD newsletter_date_add DATETIME NULL;
|
||||
ALTER TABLE PREFIX_cart_product
|
||||
ADD date_add DATETIME NOT NULL;
|
||||
|
||||
/* ################################# */
|
||||
/* CONTENTS */
|
||||
/* ################################# */
|
||||
|
||||
/* PHP:add_required_customization_field_flag(); */;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,610 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
CREATE TABLE `PREFIX_pack` (
|
||||
`id_product_pack` int(10) unsigned NOT NULL,
|
||||
`id_product_item` int(10) unsigned NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY (`id_product_pack`,`id_product_item`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `PREFIX_manufacturer_lang`
|
||||
ADD `short_description` VARCHAR( 254 ) NULL DEFAULT NULL;
|
||||
ALTER TABLE `PREFIX_manufacturer_lang`
|
||||
ADD `meta_title` VARCHAR( 254 ) NULL DEFAULT NULL;
|
||||
ALTER TABLE `PREFIX_manufacturer_lang`
|
||||
ADD `meta_keywords` VARCHAR( 254 ) NULL DEFAULT NULL;
|
||||
ALTER TABLE `PREFIX_manufacturer_lang`
|
||||
ADD `meta_description` VARCHAR( 254 ) NULL DEFAULT NULL;
|
||||
|
||||
ALTER TABLE `PREFIX_supplier_lang`
|
||||
ADD `meta_title` VARCHAR( 254 ) NULL DEFAULT NULL;
|
||||
ALTER TABLE `PREFIX_supplier_lang`
|
||||
ADD `meta_keywords` VARCHAR( 254 ) NULL DEFAULT NULL;
|
||||
ALTER TABLE `PREFIX_supplier_lang`
|
||||
ADD `meta_description` VARCHAR( 254 ) NULL DEFAULT NULL;
|
||||
|
||||
/* ##################################### */
|
||||
/* CONTENTS */
|
||||
/* ##################################### */
|
||||
|
||||
TRUNCATE TABLE `PREFIX_timezone`;
|
||||
INSERT INTO `PREFIX_timezone` (`name`) VALUES
|
||||
('Africa/Abidjan'),
|
||||
('Africa/Accra'),
|
||||
('Africa/Addis_Ababa'),
|
||||
('Africa/Algiers'),
|
||||
('Africa/Asmara'),
|
||||
('Africa/Asmera'),
|
||||
('Africa/Bamako'),
|
||||
('Africa/Bangui'),
|
||||
('Africa/Banjul'),
|
||||
('Africa/Bissau'),
|
||||
('Africa/Blantyre'),
|
||||
('Africa/Brazzaville'),
|
||||
('Africa/Bujumbura'),
|
||||
('Africa/Cairo'),
|
||||
('Africa/Casablanca'),
|
||||
('Africa/Ceuta'),
|
||||
('Africa/Conakry'),
|
||||
('Africa/Dakar'),
|
||||
('Africa/Dar_es_Salaam'),
|
||||
('Africa/Djibouti'),
|
||||
('Africa/Douala'),
|
||||
('Africa/El_Aaiun'),
|
||||
('Africa/Freetown'),
|
||||
('Africa/Gaborone'),
|
||||
('Africa/Harare'),
|
||||
('Africa/Johannesburg'),
|
||||
('Africa/Kampala'),
|
||||
('Africa/Khartoum'),
|
||||
('Africa/Kigali'),
|
||||
('Africa/Kinshasa'),
|
||||
('Africa/Lagos'),
|
||||
('Africa/Libreville'),
|
||||
('Africa/Lome'),
|
||||
('Africa/Luanda'),
|
||||
('Africa/Lubumbashi'),
|
||||
('Africa/Lusaka'),
|
||||
('Africa/Malabo'),
|
||||
('Africa/Maputo'),
|
||||
('Africa/Maseru'),
|
||||
('Africa/Mbabane'),
|
||||
('Africa/Mogadishu'),
|
||||
('Africa/Monrovia'),
|
||||
('Africa/Nairobi'),
|
||||
('Africa/Ndjamena'),
|
||||
('Africa/Niamey'),
|
||||
('Africa/Nouakchott'),
|
||||
('Africa/Ouagadougou'),
|
||||
('Africa/Porto-Novo'),
|
||||
('Africa/Sao_Tome'),
|
||||
('Africa/Timbuktu'),
|
||||
('Africa/Tripoli'),
|
||||
('Africa/Tunis'),
|
||||
('Africa/Windhoek'),
|
||||
('America/Adak'),
|
||||
('America/Anchorage '),
|
||||
('America/Anguilla'),
|
||||
('America/Antigua'),
|
||||
('America/Araguaina'),
|
||||
('America/Argentina/Buenos_Aires'),
|
||||
('America/Argentina/Catamarca'),
|
||||
('America/Argentina/ComodRivadavia'),
|
||||
('America/Argentina/Cordoba'),
|
||||
('America/Argentina/Jujuy'),
|
||||
('America/Argentina/La_Rioja'),
|
||||
('America/Argentina/Mendoza'),
|
||||
('America/Argentina/Rio_Gallegos'),
|
||||
('America/Argentina/Salta'),
|
||||
('America/Argentina/San_Juan'),
|
||||
('America/Argentina/San_Luis'),
|
||||
('America/Argentina/Tucuman'),
|
||||
('America/Argentina/Ushuaia'),
|
||||
('America/Aruba'),
|
||||
('America/Asuncion'),
|
||||
('America/Atikokan'),
|
||||
('America/Atka'),
|
||||
('America/Bahia'),
|
||||
('America/Barbados'),
|
||||
('America/Belem'),
|
||||
('America/Belize'),
|
||||
('America/Blanc-Sablon'),
|
||||
('America/Boa_Vista'),
|
||||
('America/Bogota'),
|
||||
('America/Boise'),
|
||||
('America/Buenos_Aires'),
|
||||
('America/Cambridge_Bay'),
|
||||
('America/Campo_Grande'),
|
||||
('America/Cancun'),
|
||||
('America/Caracas'),
|
||||
('America/Catamarca'),
|
||||
('America/Cayenne'),
|
||||
('America/Cayman'),
|
||||
('America/Chicago'),
|
||||
('America/Chihuahua'),
|
||||
('America/Coral_Harbour'),
|
||||
('America/Cordoba'),
|
||||
('America/Costa_Rica'),
|
||||
('America/Cuiaba'),
|
||||
('America/Curacao'),
|
||||
('America/Danmarkshavn'),
|
||||
('America/Dawson'),
|
||||
('America/Dawson_Creek'),
|
||||
('America/Denver'),
|
||||
('America/Detroit'),
|
||||
('America/Dominica'),
|
||||
('America/Edmonton'),
|
||||
('America/Eirunepe'),
|
||||
('America/El_Salvador'),
|
||||
('America/Ensenada'),
|
||||
('America/Fort_Wayne'),
|
||||
('America/Fortaleza'),
|
||||
('America/Glace_Bay'),
|
||||
('America/Godthab'),
|
||||
('America/Goose_Bay'),
|
||||
('America/Grand_Turk'),
|
||||
('America/Grenada'),
|
||||
('America/Guadeloupe'),
|
||||
('America/Guatemala'),
|
||||
('America/Guayaquil'),
|
||||
('America/Guyana'),
|
||||
('America/Halifax'),
|
||||
('America/Havana'),
|
||||
('America/Hermosillo'),
|
||||
('America/Indiana/Indianapolis'),
|
||||
('America/Indiana/Knox'),
|
||||
('America/Indiana/Marengo'),
|
||||
('America/Indiana/Petersburg'),
|
||||
('America/Indiana/Tell_City'),
|
||||
('America/Indiana/Vevay'),
|
||||
('America/Indiana/Vincennes'),
|
||||
('America/Indiana/Winamac'),
|
||||
('America/Indianapolis'),
|
||||
('America/Inuvik'),
|
||||
('America/Iqaluit'),
|
||||
('America/Jamaica'),
|
||||
('America/Jujuy'),
|
||||
('America/Juneau'),
|
||||
('America/Kentucky/Louisville'),
|
||||
('America/Kentucky/Monticello'),
|
||||
('America/Knox_IN'),
|
||||
('America/La_Paz'),
|
||||
('America/Lima'),
|
||||
('America/Los_Angeles'),
|
||||
('America/Louisville'),
|
||||
('America/Maceio'),
|
||||
('America/Managua'),
|
||||
('America/Manaus'),
|
||||
('America/Marigot'),
|
||||
('America/Martinique'),
|
||||
('America/Mazatlan'),
|
||||
('America/Mendoza'),
|
||||
('America/Menominee'),
|
||||
('America/Merida'),
|
||||
('America/Mexico_City'),
|
||||
('America/Miquelon'),
|
||||
('America/Moncton'),
|
||||
('America/Monterrey'),
|
||||
('America/Montevideo'),
|
||||
('America/Montreal'),
|
||||
('America/Montserrat'),
|
||||
('America/Nassau'),
|
||||
('America/New_York'),
|
||||
('America/Nipigon'),
|
||||
('America/Nome'),
|
||||
('America/Noronha'),
|
||||
('America/North_Dakota/Center'),
|
||||
('America/North_Dakota/New_Salem'),
|
||||
('America/Panama'),
|
||||
('America/Pangnirtung'),
|
||||
('America/Paramaribo'),
|
||||
('America/Phoenix'),
|
||||
('America/Port-au-Prince'),
|
||||
('America/Port_of_Spain'),
|
||||
('America/Porto_Acre'),
|
||||
('America/Porto_Velho'),
|
||||
('America/Puerto_Rico'),
|
||||
('America/Rainy_River'),
|
||||
('America/Rankin_Inlet'),
|
||||
('America/Recife'),
|
||||
('America/Regina'),
|
||||
('America/Resolute'),
|
||||
('America/Rio_Branco'),
|
||||
('America/Rosario'),
|
||||
('America/Santarem'),
|
||||
('America/Santiago'),
|
||||
('America/Santo_Domingo'),
|
||||
('America/Sao_Paulo'),
|
||||
('America/Scoresbysund'),
|
||||
('America/Shiprock'),
|
||||
('America/St_Barthelemy'),
|
||||
('America/St_Johns'),
|
||||
('America/St_Kitts'),
|
||||
('America/St_Lucia'),
|
||||
('America/St_Thomas'),
|
||||
('America/St_Vincent'),
|
||||
('America/Swift_Current'),
|
||||
('America/Tegucigalpa'),
|
||||
('America/Thule'),
|
||||
('America/Thunder_Bay'),
|
||||
('America/Tijuana'),
|
||||
('America/Toronto'),
|
||||
('America/Tortola'),
|
||||
('America/Vancouver'),
|
||||
('America/Virgin'),
|
||||
('America/Whitehorse'),
|
||||
('America/Winnipeg'),
|
||||
('America/Yakutat'),
|
||||
('America/Yellowknife'),
|
||||
('Antarctica/Casey'),
|
||||
('Antarctica/Davis'),
|
||||
('Antarctica/DumontDUrville'),
|
||||
('Antarctica/Mawson'),
|
||||
('Antarctica/McMurdo'),
|
||||
('Antarctica/Palmer'),
|
||||
('Antarctica/Rothera'),
|
||||
('Antarctica/South_Pole'),
|
||||
('Antarctica/Syowa'),
|
||||
('Antarctica/Vostok'),
|
||||
('Arctic/Longyearbyen'),
|
||||
('Asia/Aden'),
|
||||
('Asia/Almaty'),
|
||||
('Asia/Amman'),
|
||||
('Asia/Anadyr'),
|
||||
('Asia/Aqtau'),
|
||||
('Asia/Aqtobe'),
|
||||
('Asia/Ashgabat'),
|
||||
('Asia/Ashkhabad'),
|
||||
('Asia/Baghdad'),
|
||||
('Asia/Bahrain'),
|
||||
('Asia/Baku'),
|
||||
('Asia/Bangkok'),
|
||||
('Asia/Beirut'),
|
||||
('Asia/Bishkek'),
|
||||
('Asia/Brunei'),
|
||||
('Asia/Calcutta'),
|
||||
('Asia/Choibalsan'),
|
||||
('Asia/Chongqing'),
|
||||
('Asia/Chungking'),
|
||||
('Asia/Colombo'),
|
||||
('Asia/Dacca'),
|
||||
('Asia/Damascus'),
|
||||
('Asia/Dhaka'),
|
||||
('Asia/Dili'),
|
||||
('Asia/Dubai'),
|
||||
('Asia/Dushanbe'),
|
||||
('Asia/Gaza'),
|
||||
('Asia/Harbin'),
|
||||
('Asia/Ho_Chi_Minh'),
|
||||
('Asia/Hong_Kong'),
|
||||
('Asia/Hovd'),
|
||||
('Asia/Irkutsk'),
|
||||
('Asia/Istanbul'),
|
||||
('Asia/Jakarta'),
|
||||
('Asia/Jayapura'),
|
||||
('Asia/Jerusalem'),
|
||||
('Asia/Kabul'),
|
||||
('Asia/Kamchatka'),
|
||||
('Asia/Karachi'),
|
||||
('Asia/Kashgar'),
|
||||
('Asia/Kathmandu'),
|
||||
('Asia/Katmandu'),
|
||||
('Asia/Kolkata'),
|
||||
('Asia/Krasnoyarsk'),
|
||||
('Asia/Kuala_Lumpur'),
|
||||
('Asia/Kuching'),
|
||||
('Asia/Kuwait'),
|
||||
('Asia/Macao'),
|
||||
('Asia/Macau'),
|
||||
('Asia/Magadan'),
|
||||
('Asia/Makassar'),
|
||||
('Asia/Manila'),
|
||||
('Asia/Muscat'),
|
||||
('Asia/Nicosia'),
|
||||
('Asia/Novosibirsk'),
|
||||
('Asia/Omsk'),
|
||||
('Asia/Oral'),
|
||||
('Asia/Phnom_Penh'),
|
||||
('Asia/Pontianak'),
|
||||
('Asia/Pyongyang'),
|
||||
('Asia/Qatar'),
|
||||
('Asia/Qyzylorda'),
|
||||
('Asia/Rangoon'),
|
||||
('Asia/Riyadh'),
|
||||
('Asia/Saigon'),
|
||||
('Asia/Sakhalin'),
|
||||
('Asia/Samarkand'),
|
||||
('Asia/Seoul'),
|
||||
('Asia/Shanghai'),
|
||||
('Asia/Singapore'),
|
||||
('Asia/Taipei'),
|
||||
('Asia/Tashkent'),
|
||||
('Asia/Tbilisi'),
|
||||
('Asia/Tehran'),
|
||||
('Asia/Tel_Aviv'),
|
||||
('Asia/Thimbu'),
|
||||
('Asia/Thimphu'),
|
||||
('Asia/Tokyo'),
|
||||
('Asia/Ujung_Pandang'),
|
||||
('Asia/Ulaanbaatar'),
|
||||
('Asia/Ulan_Bator'),
|
||||
('Asia/Urumqi'),
|
||||
('Asia/Vientiane'),
|
||||
('Asia/Vladivostok'),
|
||||
('Asia/Yakutsk'),
|
||||
('Asia/Yekaterinburg'),
|
||||
('Asia/Yerevan'),
|
||||
('Atlantic/Azores'),
|
||||
('Atlantic/Bermuda'),
|
||||
('Atlantic/Canary'),
|
||||
('Atlantic/Cape_Verde'),
|
||||
('Atlantic/Faeroe'),
|
||||
('Atlantic/Faroe'),
|
||||
('Atlantic/Jan_Mayen'),
|
||||
('Atlantic/Madeira'),
|
||||
('Atlantic/Reykjavik'),
|
||||
('Atlantic/South_Georgia'),
|
||||
('Atlantic/St_Helena'),
|
||||
('Atlantic/Stanley'),
|
||||
('Australia/ACT'),
|
||||
('Australia/Adelaide'),
|
||||
('Australia/Brisbane'),
|
||||
('Australia/Broken_Hill'),
|
||||
('Australia/Canberra'),
|
||||
('Australia/Currie'),
|
||||
('Australia/Darwin'),
|
||||
('Australia/Eucla'),
|
||||
('Australia/Hobart'),
|
||||
('Australia/LHI'),
|
||||
('Australia/Lindeman'),
|
||||
('Australia/Lord_Howe'),
|
||||
('Australia/Melbourne'),
|
||||
('Australia/North'),
|
||||
('Australia/NSW'),
|
||||
('Australia/Perth'),
|
||||
('Australia/Queensland'),
|
||||
('Australia/South'),
|
||||
('Australia/Sydney'),
|
||||
('Australia/Tasmania'),
|
||||
('Australia/Victoria'),
|
||||
('Australia/West'),
|
||||
('Australia/Yancowinna'),
|
||||
('Europe/Amsterdam'),
|
||||
('Europe/Andorra'),
|
||||
('Europe/Athens'),
|
||||
('Europe/Belfast'),
|
||||
('Europe/Belgrade'),
|
||||
('Europe/Berlin'),
|
||||
('Europe/Bratislava'),
|
||||
('Europe/Brussels'),
|
||||
('Europe/Bucharest'),
|
||||
('Europe/Budapest'),
|
||||
('Europe/Chisinau'),
|
||||
('Europe/Copenhagen'),
|
||||
('Europe/Dublin'),
|
||||
('Europe/Gibraltar'),
|
||||
('Europe/Guernsey'),
|
||||
('Europe/Helsinki'),
|
||||
('Europe/Isle_of_Man'),
|
||||
('Europe/Istanbul'),
|
||||
('Europe/Jersey'),
|
||||
('Europe/Kaliningrad'),
|
||||
('Europe/Kiev'),
|
||||
('Europe/Lisbon'),
|
||||
('Europe/Ljubljana'),
|
||||
('Europe/London'),
|
||||
('Europe/Luxembourg'),
|
||||
('Europe/Madrid'),
|
||||
('Europe/Malta'),
|
||||
('Europe/Mariehamn'),
|
||||
('Europe/Minsk'),
|
||||
('Europe/Monaco'),
|
||||
('Europe/Moscow'),
|
||||
('Europe/Nicosia'),
|
||||
('Europe/Oslo'),
|
||||
('Europe/Paris'),
|
||||
('Europe/Podgorica'),
|
||||
('Europe/Prague'),
|
||||
('Europe/Riga'),
|
||||
('Europe/Rome'),
|
||||
('Europe/Samara'),
|
||||
('Europe/San_Marino'),
|
||||
('Europe/Sarajevo'),
|
||||
('Europe/Simferopol'),
|
||||
('Europe/Skopje'),
|
||||
('Europe/Sofia'),
|
||||
('Europe/Stockholm'),
|
||||
('Europe/Tallinn'),
|
||||
('Europe/Tirane'),
|
||||
('Europe/Tiraspol'),
|
||||
('Europe/Uzhgorod'),
|
||||
('Europe/Vaduz'),
|
||||
('Europe/Vatican'),
|
||||
('Europe/Vienna'),
|
||||
('Europe/Vilnius'),
|
||||
('Europe/Volgograd'),
|
||||
('Europe/Warsaw'),
|
||||
('Europe/Zagreb'),
|
||||
('Europe/Zaporozhye'),
|
||||
('Europe/Zurich'),
|
||||
('Indian/Antananarivo'),
|
||||
('Indian/Chagos'),
|
||||
('Indian/Christmas'),
|
||||
('Indian/Cocos'),
|
||||
('Indian/Comoro'),
|
||||
('Indian/Kerguelen'),
|
||||
('Indian/Mahe'),
|
||||
('Indian/Maldives'),
|
||||
('Indian/Mauritius'),
|
||||
('Indian/Mayotte'),
|
||||
('Indian/Reunion'),
|
||||
('Pacific/Apia'),
|
||||
('Pacific/Auckland'),
|
||||
('Pacific/Chatham'),
|
||||
('Pacific/Easter'),
|
||||
('Pacific/Efate'),
|
||||
('Pacific/Enderbury'),
|
||||
('Pacific/Fakaofo'),
|
||||
('Pacific/Fiji'),
|
||||
('Pacific/Funafuti'),
|
||||
('Pacific/Galapagos'),
|
||||
('Pacific/Gambier'),
|
||||
('Pacific/Guadalcanal'),
|
||||
('Pacific/Guam'),
|
||||
('Pacific/Honolulu'),
|
||||
('Pacific/Johnston'),
|
||||
('Pacific/Kiritimati'),
|
||||
('Pacific/Kosrae'),
|
||||
('Pacific/Kwajalein'),
|
||||
('Pacific/Majuro'),
|
||||
('Pacific/Marquesas'),
|
||||
('Pacific/Midway'),
|
||||
('Pacific/Nauru'),
|
||||
('Pacific/Niue'),
|
||||
('Pacific/Norfolk'),
|
||||
('Pacific/Noumea'),
|
||||
('Pacific/Pago_Pago'),
|
||||
('Pacific/Palau'),
|
||||
('Pacific/Pitcairn'),
|
||||
('Pacific/Ponape'),
|
||||
('Pacific/Port_Moresby'),
|
||||
('Pacific/Rarotonga'),
|
||||
('Pacific/Saipan'),
|
||||
('Pacific/Samoa'),
|
||||
('Pacific/Tahiti'),
|
||||
('Pacific/Tarawa'),
|
||||
('Pacific/Tongatapu'),
|
||||
('Pacific/Truk'),
|
||||
('Pacific/Wake'),
|
||||
('Pacific/Wallis'),
|
||||
('Pacific/Yap'),
|
||||
('Brazil/Acre'),
|
||||
('Brazil/DeNoronha'),
|
||||
('Brazil/East'),
|
||||
('Brazil/West'),
|
||||
('Canada/Atlantic'),
|
||||
('Canada/Central'),
|
||||
('Canada/East-Saskatchewan'),
|
||||
('Canada/Eastern'),
|
||||
('Canada/Mountain'),
|
||||
('Canada/Newfoundland'),
|
||||
('Canada/Pacific'),
|
||||
('Canada/Saskatchewan'),
|
||||
('Canada/Yukon'),
|
||||
('CET'),
|
||||
('Chile/Continental'),
|
||||
('Chile/EasterIsland'),
|
||||
('CST6CDT'),
|
||||
('Cuba'),
|
||||
('EET'),
|
||||
('Egypt'),
|
||||
('Eire'),
|
||||
('EST'),
|
||||
('EST5EDT'),
|
||||
('Etc/GMT'),
|
||||
('Etc/GMT+0'),
|
||||
('Etc/GMT+1'),
|
||||
('Etc/GMT+10'),
|
||||
('Etc/GMT+11'),
|
||||
('Etc/GMT+12'),
|
||||
('Etc/GMT+2'),
|
||||
('Etc/GMT+3'),
|
||||
('Etc/GMT+4'),
|
||||
('Etc/GMT+5'),
|
||||
('Etc/GMT+6'),
|
||||
('Etc/GMT+7'),
|
||||
('Etc/GMT+8'),
|
||||
('Etc/GMT+9'),
|
||||
('Etc/GMT-0'),
|
||||
('Etc/GMT-1'),
|
||||
('Etc/GMT-10'),
|
||||
('Etc/GMT-11'),
|
||||
('Etc/GMT-12'),
|
||||
('Etc/GMT-13'),
|
||||
('Etc/GMT-14'),
|
||||
('Etc/GMT-2'),
|
||||
('Etc/GMT-3'),
|
||||
('Etc/GMT-4'),
|
||||
('Etc/GMT-5'),
|
||||
('Etc/GMT-6'),
|
||||
('Etc/GMT-7'),
|
||||
('Etc/GMT-8'),
|
||||
('Etc/GMT-9'),
|
||||
('Etc/GMT0'),
|
||||
('Etc/Greenwich'),
|
||||
('Etc/UCT'),
|
||||
('Etc/Universal'),
|
||||
('Etc/UTC'),
|
||||
('Etc/Zulu'),
|
||||
('Factory'),
|
||||
('GB'),
|
||||
('GB-Eire'),
|
||||
('GMT'),
|
||||
('GMT+0'),
|
||||
('GMT-0'),
|
||||
('GMT0'),
|
||||
('Greenwich'),
|
||||
('Hongkong'),
|
||||
('HST'),
|
||||
('Iceland'),
|
||||
('Iran'),
|
||||
('Israel'),
|
||||
('Jamaica'),
|
||||
('Japan'),
|
||||
('Kwajalein'),
|
||||
('Libya'),
|
||||
('MET'),
|
||||
('Mexico/BajaNorte'),
|
||||
('Mexico/BajaSur'),
|
||||
('Mexico/General'),
|
||||
('MST'),
|
||||
('MST7MDT'),
|
||||
('Navajo'),
|
||||
('NZ'),
|
||||
('NZ-CHAT'),
|
||||
('Poland'),
|
||||
('Portugal'),
|
||||
('PRC'),
|
||||
('PST8PDT'),
|
||||
('ROC'),
|
||||
('ROK'),
|
||||
('Singapore'),
|
||||
('Turkey'),
|
||||
('UCT'),
|
||||
('Universal'),
|
||||
('US/Alaska'),
|
||||
('US/Aleutian'),
|
||||
('US/Arizona'),
|
||||
('US/Central'),
|
||||
('US/East-Indiana'),
|
||||
('US/Eastern'),
|
||||
('US/Hawaii'),
|
||||
('US/Indiana-Starke'),
|
||||
('US/Michigan'),
|
||||
('US/Mountain'),
|
||||
('US/Pacific'),
|
||||
('US/Pacific-New'),
|
||||
('US/Samoa'),
|
||||
('UTC'),
|
||||
('W-SU'),
|
||||
('WET'),
|
||||
('Zulu');
|
||||
|
||||
DELETE FROM `PREFIX_discount_category`
|
||||
WHERE `id_discount` IN (
|
||||
SELECT `id_discount` FROM (
|
||||
SELECT dc.`id_discount`
|
||||
FROM `PREFIX_discount_category` dc
|
||||
LEFT JOIN `PREFIX_discount`d ON (d.`id_discount` = dc.`id_discount`)
|
||||
WHERE d.`id_discount` IS NULL
|
||||
GROUP BY dc.`id_discount`) discount_category_tmp
|
||||
);
|
||||
|
||||
DELETE FROM `PREFIX_configuration` WHERE `name` = 'PS_DISPLAY_WITHOUT_TAX';
|
||||
|
||||
INSERT INTO PREFIX_hook (`name`, `title`, `description`, `position`) VALUES
|
||||
('updateCarrier', 'Carrier update', 'This hook is called when a carrier is updated', 0);
|
||||
@@ -0,0 +1,33 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
ALTER TABLE `PREFIX_customization`
|
||||
ADD `quantity_refunded` INT NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `PREFIX_customization`
|
||||
ADD `quantity_returned` INT NOT NULL DEFAULT '0';
|
||||
|
||||
ALTER TABLE `PREFIX_alias`
|
||||
CHANGE `id_alias` `id_alias` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
ALTER TABLE `PREFIX_attribute_impact`
|
||||
CHANGE `id_attribute_impact` `id_attribute_impact` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
ALTER TABLE `PREFIX_customization`
|
||||
CHANGE `id_customization` `id_customization` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
ALTER TABLE `PREFIX_customization_field`
|
||||
CHANGE `id_customization_field` `id_customization_field` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
ALTER TABLE `PREFIX_subdomain`
|
||||
CHANGE `id_subdomain` `id_subdomain` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
|
||||
|
||||
|
||||
/* ##################################### */
|
||||
/* CONTENTS */
|
||||
/* ##################################### */
|
||||
|
||||
INSERT INTO `PREFIX_search_engine` (`server`,`getvar`) VALUES
|
||||
('bing.com','q');
|
||||
|
||||
INSERT INTO `PREFIX_hook_module` (`id_module`, `id_hook`, `position`) VALUES
|
||||
(19, 9, 1);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
/* ##################################### */
|
||||
/* CONTENTS */
|
||||
/* ##################################### */
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
/* ##################################### */
|
||||
/* CONTENTS */
|
||||
/* ##################################### */
|
||||
|
||||
UPDATE `PREFIX_order_state_lang`
|
||||
SET `name` = 'Shipped'
|
||||
WHERE `id_order_state` = 4 AND `id_lang` = 1;
|
||||
|
||||
UPDATE `PREFIX_order_state_lang` SET `template` = 'shipped' WHERE `id_order_state` = 4 AND `template` = 'shipping';
|
||||
|
||||
/* PHP:reorderpositions(); */;
|
||||
@@ -0,0 +1,14 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
ALTER TABLE `PREFIX_configuration` DROP INDEX `configuration_name`;
|
||||
ALTER TABLE `PREFIX_order_detail` ADD `product_quantity_in_stock` INT(10) NOT NULL DEFAULT 0 AFTER `product_quantity`;
|
||||
ALTER TABLE `PREFIX_order_detail` ADD `product_quantity_reinjected` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `product_quantity_return`;
|
||||
|
||||
/* ##################################### */
|
||||
/* CONTENTS */
|
||||
/* ##################################### */
|
||||
UPDATE `PREFIX_product` SET `out_of_stock` = 0 WHERE `id_product` IN ((SELECT `id_product` FROM `PREFIX_product_download`));
|
||||
@@ -0,0 +1,12 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
|
||||
/* ##################################### */
|
||||
/* CONTENTS */
|
||||
/* ##################################### */
|
||||
|
||||
/* PHP:update_modules_sql(); */;
|
||||
@@ -0,0 +1,10 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
|
||||
/* ##################################### */
|
||||
/* CONTENTS */
|
||||
/* ##################################### */
|
||||
@@ -0,0 +1,16 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
/* ##################################### */
|
||||
/* STRUCTURE */
|
||||
/* ##################################### */
|
||||
|
||||
|
||||
/* ##################################### */
|
||||
/* CONTENTS */
|
||||
/* ##################################### */
|
||||
|
||||
INSERT INTO PREFIX_configuration (name, value, date_add, date_upd) VALUES ('PS_THEME_V11', 0, NOW(), NOW());
|
||||
|
||||
/* PHP */
|
||||
/* PHP:update_carrier_url(); */;
|
||||
/* PHP:moduleReinstaller('blocksearch'); */;
|
||||
@@ -0,0 +1,6 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
ALTER TABLE `PREFIX_discount_category` ADD INDEX ( `id_discount` );
|
||||
|
||||
DELETE FROM `PREFIX_delivery` WHERE `id_range_weight` != NULL AND `id_range_weight` NOT IN (SELECT `id_range_weight` FROM `PREFIX_range_weight`);
|
||||
DELETE FROM `PREFIX_delivery` WHERE `id_range_price` != NULL AND `id_range_weight` NOT IN (SELECT `id_range_price` FROM `PREFIX_range_price`);
|
||||
@@ -0,0 +1,3 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
ALTER TABLE `PREFIX_category_product` ADD INDEX (`id_product`);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user