first commit

This commit is contained in:
2025-01-06 20:47:25 +01:00
commit 3bdbd78c2f
25591 changed files with 3586440 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,9 @@
<?php
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_0_3($object)
{
return ($object->registerHook('displayProductListFunctionalButtons') && $object->registerHook('top'));
}

View File

@@ -0,0 +1,17 @@
<?php
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_1_1_2()
{
$list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'wishlist`');
if (is_array($list_fields))
{
foreach ($list_fields as $k => $field)
$list_fields[$k] = $field['Field'];
if (!in_array('default', $list_fields))
return (bool)Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'wishlist` ADD COLUMN `is_default` INT( 11 ) NOT NULL DEFAULT "0"');
}
return true;
}

View File

@@ -0,0 +1,17 @@
<?php
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_1_1_3()
{
$list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'wishlist`');
if (is_array($list_fields))
{
foreach ($list_fields as $k => $field)
$list_fields[$k] = $field['Field'];
if (in_array('is_default', $list_fields))
return (bool)Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'wishlist` CHANGE `is_default` `default` INT( 11 ) NOT NULL DEFAULT "0"');
}
return true;
}

View File

@@ -0,0 +1,16 @@
<?php
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_1_1_5()
{
$list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'wishlist`');
if (is_array($list_fields))
foreach ($list_fields as $k => $field)
if ($field['Field'] == 'default' && $field['Type'] == 'int(11)')
return (bool)Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'wishlist` CHANGE `default` `default` INT( 11 ) NOT NULL DEFAULT "0"');
return true;
}

View File

@@ -0,0 +1,20 @@
<?php
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_1_1($object)
{
$object->registerHook('displayProductListFunctionalButtons');
$object->registerHook('top');
$list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'wishlist`');
if (is_array($list_fields))
{
foreach ($list_fields as $k => $field)
$list_fields[$k] = $field['Field'];
if (!in_array('id_shop_group', $list_fields))
return (bool)Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'wishlist` CHANGE `id_group_shop` `id_shop_group` INT( 11 ) NOT NULL DEFAULT "1"');
}
return true;
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* @param BlockWishList $module
*
* @return bool
*/
function upgrade_module_0_3($module)
{
return $module->registerHook('displayProductListFunctionalButtons')
&& $module->registerHook('top');
}

View File

@@ -0,0 +1,48 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* @param BlockWishList $module
*
* @return bool
*/
function upgrade_module_1_1_2($module)
{
$list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `' . _DB_PREFIX_ . 'wishlist`');
if (is_array($list_fields)) {
$isFieldDefaultExist = false;
foreach ($list_fields as $k => $field) {
if ($field['Field'] === 'default') {
$isFieldDefaultExist = true;
}
}
if (false === $isFieldDefaultExist) {
return (bool) Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'wishlist` ADD COLUMN `is_default` INT( 11 ) NOT NULL DEFAULT "0"');
}
}
return true;
}

View File

@@ -0,0 +1,42 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* @param BlockWishList $module
*
* @return bool
*/
function upgrade_module_1_1_3($module)
{
$list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `' . _DB_PREFIX_ . 'wishlist`');
if (is_array($list_fields)) {
foreach ($list_fields as $field) {
if ($field['Field'] === 'is_default') {
return (bool) Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'wishlist` CHANGE `is_default` `default` INT( 11 ) NOT NULL DEFAULT "0"');
}
}
}
return true;
}

View File

@@ -0,0 +1,42 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* @param BlockWishList $module
*
* @return bool
*/
function upgrade_module_1_1_5($module)
{
$list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `' . _DB_PREFIX_ . 'wishlist`');
if (is_array($list_fields)) {
foreach ($list_fields as $field) {
if ($field['Field'] === 'default' && $field['Type'] === 'int(11)') {
return (bool) Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'wishlist` CHANGE `default` `default` INT( 11 ) NOT NULL DEFAULT "0"');
}
}
}
return true;
}

View File

@@ -0,0 +1,45 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* @param BlockWishList $module
*
* @return bool
*/
function upgrade_module_1_1($module)
{
$result = true;
$list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `' . _DB_PREFIX_ . 'wishlist`');
if (is_array($list_fields)) {
foreach ($list_fields as $field) {
if ($field['Field'] === 'id_shop_group') {
$result = $result && (bool) Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'wishlist` CHANGE `id_group_shop` `id_shop_group` INT( 11 ) NOT NULL DEFAULT "1"');
}
}
}
return $result
&& $module->registerHook('displayProductListFunctionalButtons')
&& $module->registerHook('top');
}

View File

@@ -0,0 +1,53 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
use PrestaShop\Module\BlockWishList\Database\Install;
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* @param BlockWishList $moduleadd upgrade
*
* @return bool
*/
function upgrade_module_2_0_0($module)
{
if (false === (new Install($module->getTranslator()))->run()) {
return false;
}
$products = Db::getInstance()->executeS(
'SELECT wp.`id_product`, wp.`id_product_attribute`
FROM `' . _DB_PREFIX_ . 'wishlist_product` wp'
);
foreach ($products as $k => $field) {
$newStat = new Statistics();
$newStat->id_product = $field['id_product'];
$newStat->id_product_attribute = $field['id_product_attribute'];
$newStat->id_shop = $this->context->shop->id;
$newStat->save();
}
return $module->registerHook(BlockWishList::HOOKS)
&& Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'wishlist_email`');
}