// Deactivate customer groups in the install (automatically reactivated if you add a group or set a reduction)
This commit is contained in:
1 parent
26b90d5670
commit
9c5303df1d
10 files changed
+22
-21
No files matched your search
@@ -549,7 +549,7 @@ class CategoryCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
$sql_groups_where = '';
|
$sql_groups_where = '';
|
||||||
$sql_groups_join = '';
|
$sql_groups_join = '';
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
{
|
{
|
||||||
$sql_groups_join = 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`)';
|
$sql_groups_join = 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`)';
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class GroupReductionCore extends ObjectModel
|
|||||||
|
|
||||||
public static function getValueForProduct($id_product, $id_group)
|
public static function getValueForProduct($id_product, $id_group)
|
||||||
{
|
{
|
||||||
if (!Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (!Group::isFeatureActive())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!isset(self::$reduction_cache[$id_product.'-'.$id_group]))
|
if (!isset(self::$reduction_cache[$id_product.'-'.$id_group]))
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class ManufacturerCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
if (!$id_lang)
|
if (!$id_lang)
|
||||||
$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');
|
$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||||
if (!Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (!Group::isFeatureActive())
|
||||||
$all_group = true;
|
$all_group = true;
|
||||||
|
|
||||||
$sql = 'SELECT m.*, ml.`description`, ml.`short_description`
|
$sql = 'SELECT m.*, ml.`description`, ml.`short_description`
|
||||||
|
|||||||
+4
-4
@@ -2009,7 +2009,7 @@ class ProductCore extends ObjectModel
|
|||||||
die(Tools::displayError());
|
die(Tools::displayError());
|
||||||
|
|
||||||
$sql_groups = '';
|
$sql_groups = '';
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
{
|
{
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
$sql_groups = 'AND p.`id_product` IN (
|
$sql_groups = 'AND p.`id_product` IN (
|
||||||
@@ -2061,7 +2061,7 @@ class ProductCore extends ObjectModel
|
|||||||
if ($front)
|
if ($front)
|
||||||
$sql->where('product_shop.`visibility` IN ("both", "catalog")');
|
$sql->where('product_shop.`visibility` IN ("both", "catalog")');
|
||||||
$sql->where('product_shop.`date_add` > "'.date('Y-m-d', strtotime('-'.(Configuration::get('PS_NB_DAYS_NEW_PRODUCT') ? (int)Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY')).'"');
|
$sql->where('product_shop.`date_add` > "'.date('Y-m-d', strtotime('-'.(Configuration::get('PS_NB_DAYS_NEW_PRODUCT') ? (int)Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY')).'"');
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
$sql->where('p.`id_product` IN (
|
$sql->where('p.`id_product` IN (
|
||||||
SELECT cp.`id_product`
|
SELECT cp.`id_product`
|
||||||
FROM `'._DB_PREFIX_.'category_group` cg
|
FROM `'._DB_PREFIX_.'category_group` cg
|
||||||
@@ -2241,7 +2241,7 @@ class ProductCore extends ObjectModel
|
|||||||
$front = false;
|
$front = false;
|
||||||
|
|
||||||
$sql_groups = '';
|
$sql_groups = '';
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
{
|
{
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
$sql_groups = 'AND p.`id_product` IN (
|
$sql_groups = 'AND p.`id_product` IN (
|
||||||
@@ -4342,7 +4342,7 @@ class ProductCore extends ObjectModel
|
|||||||
|
|
||||||
public function checkAccess($id_customer)
|
public function checkAccess($id_customer)
|
||||||
{
|
{
|
||||||
if (!Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (!Group::isFeatureActive())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!$id_customer)
|
if (!$id_customer)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class ProductSaleCore
|
|||||||
if (is_null($order_way) || $order_by == 'sales') $order_way = 'DESC';
|
if (is_null($order_way) || $order_by == 'sales') $order_way = 'DESC';
|
||||||
|
|
||||||
$sql_groups = '';
|
$sql_groups = '';
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
{
|
{
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
$sql_groups = 'WHERE cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
$sql_groups = 'WHERE cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||||
@@ -152,7 +152,7 @@ class ProductSaleCore
|
|||||||
if ($nb_products < 1) $nb_products = 10;
|
if ($nb_products < 1) $nb_products = 10;
|
||||||
|
|
||||||
$sql_groups = '';
|
$sql_groups = '';
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
{
|
{
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
$sql_groups = 'AND cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
$sql_groups = 'AND cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||||
|
|||||||
+5
-5
@@ -230,7 +230,7 @@ class SearchCore
|
|||||||
) position';
|
) position';
|
||||||
|
|
||||||
$sql_groups = '';
|
$sql_groups = '';
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
{
|
{
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
$sql_groups = 'AND cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
$sql_groups = 'AND cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||||
@@ -239,7 +239,7 @@ class SearchCore
|
|||||||
$results = $db->executeS('
|
$results = $db->executeS('
|
||||||
SELECT cp.`id_product`
|
SELECT cp.`id_product`
|
||||||
FROM `'._DB_PREFIX_.'category_product` cp
|
FROM `'._DB_PREFIX_.'category_product` cp
|
||||||
'.(Configuration::get('PS_GROUP_FEATURE_ACTIVE') ? 'INNER JOIN `'._DB_PREFIX_.'category_group` cg ON cp.`id_category` = cg.`id_category`' : '').'
|
'.(Group::isFeatureActive() ? 'INNER JOIN `'._DB_PREFIX_.'category_group` cg ON cp.`id_category` = cg.`id_category`' : '').'
|
||||||
INNER JOIN `'._DB_PREFIX_.'category` c ON cp.`id_category` = c.`id_category`
|
INNER JOIN `'._DB_PREFIX_.'category` c ON cp.`id_category` = c.`id_category`
|
||||||
INNER JOIN `'._DB_PREFIX_.'product` p ON cp.`id_product` = p.`id_product`
|
INNER JOIN `'._DB_PREFIX_.'product` p ON cp.`id_product` = p.`id_product`
|
||||||
'.Shop::addSqlAssociation('product', 'p', false).'
|
'.Shop::addSqlAssociation('product', 'p', false).'
|
||||||
@@ -641,7 +641,7 @@ class SearchCore
|
|||||||
$id_shop = $id ? $id : Configuration::get('PS_SHOP_DEFAULT');
|
$id_shop = $id ? $id : Configuration::get('PS_SHOP_DEFAULT');
|
||||||
|
|
||||||
$sql_groups = '';
|
$sql_groups = '';
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
{
|
{
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
$sql_groups = 'AND cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
$sql_groups = 'AND cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||||
@@ -657,7 +657,7 @@ class SearchCore
|
|||||||
LEFT JOIN `'._DB_PREFIX_.'tag` t ON (pt.`id_tag` = t.`id_tag` AND t.`id_lang` = '.(int)$id_lang.')
|
LEFT JOIN `'._DB_PREFIX_.'tag` t ON (pt.`id_tag` = t.`id_tag` AND t.`id_lang` = '.(int)$id_lang.')
|
||||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)
|
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)
|
||||||
LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (cp.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')
|
LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (cp.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')
|
||||||
'.(Configuration::get('PS_GROUP_FEATURE_ACTIVE') ? 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = cp.`id_category`)' : '').'
|
'.(Group::isFeatureActive() ? 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = cp.`id_category`)' : '').'
|
||||||
WHERE product_shop.`active` = 1
|
WHERE product_shop.`active` = 1
|
||||||
AND cs.`id_shop` = '.(int)Context::getContext()->shop->id.'
|
AND cs.`id_shop` = '.(int)Context::getContext()->shop->id.'
|
||||||
'.$sql_groups.'
|
'.$sql_groups.'
|
||||||
@@ -686,7 +686,7 @@ class SearchCore
|
|||||||
LEFT JOIN `'._DB_PREFIX_.'product_tag` pt ON (p.`id_product` = pt.`id_product`)
|
LEFT JOIN `'._DB_PREFIX_.'product_tag` pt ON (p.`id_product` = pt.`id_product`)
|
||||||
LEFT JOIN `'._DB_PREFIX_.'tag` t ON (pt.`id_tag` = t.`id_tag` AND t.`id_lang` = '.(int)$id_lang.')
|
LEFT JOIN `'._DB_PREFIX_.'tag` t ON (pt.`id_tag` = t.`id_tag` AND t.`id_lang` = '.(int)$id_lang.')
|
||||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)
|
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)
|
||||||
'.(Configuration::get('PS_GROUP_FEATURE_ACTIVE') ? 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = cp.`id_category`)' : '').'
|
'.(Group::isFeatureActive() ? 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = cp.`id_category`)' : '').'
|
||||||
LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (cg.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')
|
LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (cg.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')
|
||||||
'.Product::sqlStock('p', 0).'
|
'.Product::sqlStock('p', 0).'
|
||||||
WHERE product_shop.`active` = 1
|
WHERE product_shop.`active` = 1
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class SupplierCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
if (!$id_lang)
|
if (!$id_lang)
|
||||||
$id_lang = Configuration::get('PS_LANG_DEFAULT');
|
$id_lang = Configuration::get('PS_LANG_DEFAULT');
|
||||||
if (!Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (!Group::isFeatureActive())
|
||||||
$all_groups = true;
|
$all_groups = true;
|
||||||
|
|
||||||
$query = new DbQuery();
|
$query = new DbQuery();
|
||||||
@@ -210,7 +210,7 @@ class SupplierCore extends ObjectModel
|
|||||||
die (Tools::displayError());
|
die (Tools::displayError());
|
||||||
|
|
||||||
$sql_groups = '';
|
$sql_groups = '';
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
{
|
{
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
$sql_groups = 'WHERE cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
$sql_groups = 'WHERE cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||||
@@ -230,7 +230,7 @@ class SupplierCore extends ObjectModel
|
|||||||
AND p.`id_product` IN (
|
AND p.`id_product` IN (
|
||||||
SELECT cp.`id_product`
|
SELECT cp.`id_product`
|
||||||
FROM `'._DB_PREFIX_.'category_product` cp
|
FROM `'._DB_PREFIX_.'category_product` cp
|
||||||
'.(Configuration::get('PS_GROUP_FEATURE_ACTIVE') ? 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cp.`id_category` = cg.`id_category`)' : '').'
|
'.(Group::isFeatureActive() ? 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cp.`id_category` = cg.`id_category`)' : '').'
|
||||||
'.($active_category ? ' INNER JOIN `'._DB_PREFIX_.'category` ca ON cp.`id_category` = ca.`id_category` AND ca.`active` = 1' : '').'
|
'.($active_category ? ' INNER JOIN `'._DB_PREFIX_.'category` ca ON cp.`id_category` = ca.`id_category` AND ca.`active` = 1' : '').'
|
||||||
'.$sql_groups.'
|
'.$sql_groups.'
|
||||||
)');
|
)');
|
||||||
@@ -286,7 +286,7 @@ class SupplierCore extends ObjectModel
|
|||||||
AND p.`id_product` IN (
|
AND p.`id_product` IN (
|
||||||
SELECT cp.`id_product`
|
SELECT cp.`id_product`
|
||||||
FROM `'._DB_PREFIX_.'category_product` cp
|
FROM `'._DB_PREFIX_.'category_product` cp
|
||||||
'.(Configuration::get('PS_GROUP_FEATURE_ACTIVE') ? 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cp.`id_category` = cg.`id_category`)' : '').'
|
'.(Group::isFeatureActive() ? 'LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cp.`id_category` = cg.`id_category`)' : '').'
|
||||||
'.($active_category ? ' INNER JOIN `'._DB_PREFIX_.'category` ca ON cp.`id_category` = ca.`id_category` AND ca.`active` = 1' : '').'
|
'.($active_category ? ' INNER JOIN `'._DB_PREFIX_.'category` ca ON cp.`id_category` = ca.`id_category` AND ca.`active` = 1' : '').'
|
||||||
'.$sql_groups.'
|
'.$sql_groups.'
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -131,7 +131,7 @@ class TagCore extends ObjectModel
|
|||||||
public static function getMainTags($id_lang, $nb = 10)
|
public static function getMainTags($id_lang, $nb = 10)
|
||||||
{
|
{
|
||||||
$sql_groups = '';
|
$sql_groups = '';
|
||||||
if (Configuration::get('PS_GROUP_FEATURE_ACTIVE'))
|
if (Group::isFeatureActive())
|
||||||
{
|
{
|
||||||
$groups = FrontController::getCurrentCustomerGroups();
|
$groups = FrontController::getCurrentCustomerGroups();
|
||||||
$sql_groups = '
|
$sql_groups = '
|
||||||
|
|||||||
@@ -1677,7 +1677,8 @@ abstract class ModuleCore
|
|||||||
$cache_array[] = (int)Tools::usingSecureMode();
|
$cache_array[] = (int)Tools::usingSecureMode();
|
||||||
if (Shop::isFeatureActive())
|
if (Shop::isFeatureActive())
|
||||||
$cache_array[] = (int)$this->context->shop->id;
|
$cache_array[] = (int)$this->context->shop->id;
|
||||||
$cache_array[] = (int)Group::getCurrent()->id;
|
if (Group::isFeatureActive())
|
||||||
|
$cache_array[] = (int)Group::getCurrent()->id;
|
||||||
if (Language::isMultiLanguageActivated())
|
if (Language::isMultiLanguageActivated())
|
||||||
$cache_array[] = (int)$this->context->language->id;
|
$cache_array[] = (int)$this->context->language->id;
|
||||||
if (Currency::isMultiCurrencyActivated())
|
if (Currency::isMultiCurrencyActivated())
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<value>1</value>
|
<value>1</value>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration id="PS_GROUP_FEATURE_ACTIVE" name="PS_GROUP_FEATURE_ACTIVE">
|
<configuration id="PS_GROUP_FEATURE_ACTIVE" name="PS_GROUP_FEATURE_ACTIVE">
|
||||||
<value>1</value>
|
<value>0</value>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration id="PS_CURRENCY_DEFAULT" name="PS_CURRENCY_DEFAULT">
|
<configuration id="PS_CURRENCY_DEFAULT" name="PS_CURRENCY_DEFAULT">
|
||||||
<value>1</value>
|
<value>1</value>
|
||||||
|
|||||||
Reference in new issue
Block a user