// Context part 16 (shops)
This commit is contained in:
@@ -184,7 +184,7 @@ class BlockCms extends Module
|
||||
FROM `'._DB_PREFIX_.'cms_block` bc
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_category_lang` ccl ON (bc.`id_cms_category` = ccl.`id_cms_category`)
|
||||
INNER JOIN `'._DB_PREFIX_.'cms_block_lang` bcl ON (bc.`id_cms_block` = bcl.`id_cms_block`)
|
||||
WHERE bc.`location` = '.(int)($location).' AND ccl.`id_lang` = '.(int)$context->language->id.' AND bcl.`id_lang` = '.(int)$context->language->id.' AND bc.id_shop='.$context->shop->getID().'
|
||||
WHERE bc.`location` = '.(int)($location).' AND ccl.`id_lang` = '.(int)$context->language->id.' AND bcl.`id_lang` = '.(int)$context->language->id.' AND bc.id_shop = '.$context->shop->getID(true).'
|
||||
ORDER BY `position`');
|
||||
|
||||
$content = array();
|
||||
|
||||
@@ -55,7 +55,7 @@ class BlockManufacturer extends Module
|
||||
function hookLeftColumn($params)
|
||||
{
|
||||
$context = Context::getContext();
|
||||
//$getNbProducts = false, $id_lang = 0, $active = true, $p = false, $n = false, $all_group = false, $id_shop = false
|
||||
|
||||
$context->smarty->assign(array(
|
||||
'manufacturers' => Manufacturer::getManufacturers(false, 0, true, false, false, false, $this->context->shop->getGroupID()),
|
||||
'link' => $context->link,
|
||||
|
||||
@@ -140,13 +140,13 @@ class Blocknewsletter extends Module
|
||||
{
|
||||
$sql = 'SELECT `email` FROM '._DB_PREFIX_.'newsletter
|
||||
WHERE `email` = \''.pSQL($customerEmail).'\'
|
||||
AND id_shop = '.$this->context->shop->getID();
|
||||
AND id_shop = '.$this->context->shop->getID(true);
|
||||
if (Db::getInstance()->getRow($sql))
|
||||
return 1;
|
||||
|
||||
$sql = 'SELECT `newsletter` FROM '._DB_PREFIX_.'customer
|
||||
WHERE `email` = \''.pSQL($customerEmail).'\'
|
||||
AND id_shop = '.$this->context->shop->getID();
|
||||
AND id_shop = '.$this->context->shop->getID(true);
|
||||
if (!$registered = Db::getInstance()->getRow($sql))
|
||||
return -1;
|
||||
|
||||
@@ -172,14 +172,14 @@ class Blocknewsletter extends Module
|
||||
/* If the user ins't a customer */
|
||||
elseif ($registerStatus == 1)
|
||||
{
|
||||
if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'newsletter WHERE `email` = \''.pSQL($_POST['email']).'\' AND id_shop = '.$this->context->shop->getID()))
|
||||
if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'newsletter WHERE `email` = \''.pSQL($_POST['email']).'\' AND id_shop = '.$this->context->shop->getID(true)))
|
||||
return $this->error = $this->l('Error during unsubscription');
|
||||
return $this->valid = $this->l('Unsubscription successful');
|
||||
}
|
||||
/* If the user is a customer */
|
||||
elseif ($registerStatus == 2)
|
||||
{
|
||||
if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET `newsletter` = 0 WHERE `email` = \''.pSQL($_POST['email']).'\' AND id_shop = '.$this->context->shop->getID()))
|
||||
if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET `newsletter` = 0 WHERE `email` = \''.pSQL($_POST['email']).'\' AND id_shop = '.$this->context->shop->getID(true)))
|
||||
return $this->error = $this->l('Error during unsubscription');
|
||||
return $this->valid = $this->l('Unsubscription successful');
|
||||
}
|
||||
@@ -210,7 +210,7 @@ class Blocknewsletter extends Module
|
||||
$sql = 'UPDATE '._DB_PREFIX_.'customer
|
||||
SET `newsletter` = 1, newsletter_date_add = NOW(), `ip_registration_newsletter` = \''.pSQL(Tools::getRemoteAddr()).'\'
|
||||
WHERE `email` = \''.pSQL($_POST['email']).'\'
|
||||
AND id_shop = '.$this->context->shop->getID();
|
||||
AND id_shop = '.$this->context->shop->getID(true);
|
||||
if (!Db::getInstance()->Execute($sql))
|
||||
return $this->error = $this->l('Error during subscription');
|
||||
$this->sendVoucher(pSQL($_POST['email']));
|
||||
|
||||
@@ -86,7 +86,7 @@ class BlockSpecials extends Module
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return ;
|
||||
|
||||
if (!$special = Product::getRandomSpecial((int)($params['cookie']->id_lang), false, false, $this->context->shop->getID()) AND !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY'))
|
||||
if (!$special = Product::getRandomSpecial((int)$params['cookie']->id_lang) AND !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY'))
|
||||
return;
|
||||
$this->context->smarty->assign(array(
|
||||
'special' => $special,
|
||||
|
||||
@@ -476,7 +476,7 @@ class PayPal extends PaymentModule
|
||||
|
||||
}
|
||||
|
||||
public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false, $id_group_shop = false, $id_shop = false)
|
||||
public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false)
|
||||
{
|
||||
if (!$this->active)
|
||||
return;
|
||||
|
||||
@@ -460,7 +460,7 @@ class ThemeInstallator extends Module
|
||||
$msg .= '<i>- '.pSQL($row).'</i><br />';
|
||||
Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'hook_module`
|
||||
WHERE `id_module` = '.pSQL($obj->id).' AND id_shop='.$shopID);
|
||||
WHERE `id_module` = '.pSQL($obj->id).' AND id_shop = '.$shopID);
|
||||
$count = -1;
|
||||
while (isset($hookedModule[++$count]))
|
||||
if ($hookedModule[$count] == $row)
|
||||
@@ -483,7 +483,7 @@ class ThemeInstallator extends Module
|
||||
$msg .= '<i>- '.pSQL($row).'</i><br />';
|
||||
Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'module_shop`
|
||||
WHERE `id_module` = '.pSQL($obj->id).' AND id_shop='.$shopID);
|
||||
WHERE `id_module` = '.pSQL($obj->id).' AND id_shop = '.$shopID);
|
||||
}
|
||||
}
|
||||
$flag = 0;
|
||||
@@ -506,7 +506,7 @@ class ThemeInstallator extends Module
|
||||
$msg .= '<i>- '.pSQL($row).'</i><br />';
|
||||
Db::getInstance()->Execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'hook_module`
|
||||
WHERE `id_module` = '.pSQL($obj->id).' AND id_shop='.$shopID);
|
||||
WHERE `id_module` = '.pSQL($obj->id).' AND id_shop = '.$shopID);
|
||||
$count = -1;
|
||||
while (isset($hookedModule[++$count]))
|
||||
if ($hookedModule[$count] == $row)
|
||||
|
||||
Reference in New Issue
Block a user