// Remove bad _SQL_USE_SLAVE_ uses + normalize Db->executeS(), Db->execute() and Db->numRows() names
This commit is contained in:
@@ -7,8 +7,8 @@ function create_multistore()
|
||||
$themes = scandir(dirname(__FILE__).'/../../themes');
|
||||
foreach ($themes AS $theme)
|
||||
if (is_dir(dirname(__FILE__).'/../../themes/'.$theme) && $theme != '.' && $theme != '..' && $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 id_theme = (SELECT id_theme FROM '._DB_PREFIX_.'theme WHERE name=\''.pSQL(_THEME_NAME_).'\') WHERE id_shop = 1');
|
||||
$res &= Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'theme (`id_theme`, `name`) VALUES(\'\', \''.pSQL($theme).'\')');
|
||||
$res &= Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'shop SET 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\'');
|
||||
@@ -23,17 +23,17 @@ function create_multistore()
|
||||
|
||||
$_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`)
|
||||
$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);
|
||||
$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);
|
||||
$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);
|
||||
|
||||
Reference in New Issue
Block a user