Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
+20
-1
@@ -81,6 +81,7 @@ class CurrencyCore extends ObjectModel
|
|||||||
|
|
||||||
/** @var array Currency cache */
|
/** @var array Currency cache */
|
||||||
static protected $currencies = array();
|
static protected $currencies = array();
|
||||||
|
protected static $countActiveCurrencies = array();
|
||||||
|
|
||||||
protected $webserviceParameters = array(
|
protected $webserviceParameters = array(
|
||||||
'objectsNodeName' => 'currencies',
|
'objectsNodeName' => 'currencies',
|
||||||
@@ -414,5 +415,23 @@ class CurrencyCore extends ObjectModel
|
|||||||
self::$currencies[(int)($id)] = new Currency($id);
|
self::$currencies[(int)($id)] = new Currency($id);
|
||||||
return self::$currencies[(int)($id)];
|
return self::$currencies[(int)($id)];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static function countActiveCurrencies($id_shop = null)
|
||||||
|
{
|
||||||
|
if ($id_shop === null)
|
||||||
|
$id_shop = (int)Context::getContext()->shop->id;
|
||||||
|
|
||||||
|
if (!isset(self::$countActiveCurrencies[$id_shop]))
|
||||||
|
self::$countActiveCurrencies[$id_shop] = Db::getInstance()->getValue('
|
||||||
|
SELECT COUNT(DISTINCT c.id_currency) FROM `'._DB_PREFIX_.'currency` c
|
||||||
|
LEFT JOIN '._DB_PREFIX_.'currency_shop cs ON (cs.id_currency = c.id_currency AND cs.id_shop = '.(int)$id_shop.')
|
||||||
|
WHERE c.`active` = 1
|
||||||
|
');
|
||||||
|
return self::$countActiveCurrencies[$id_shop];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function isMultiCurrencyActivated($id_shop = null)
|
||||||
|
{
|
||||||
|
return (Currency::countActiveCurrencies($id_shop) > 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1630,15 +1630,18 @@ abstract class ModuleCore
|
|||||||
|
|
||||||
protected function getCacheId($name = null)
|
protected function getCacheId($name = null)
|
||||||
{
|
{
|
||||||
$cache_array = array(
|
$cache_array = array();
|
||||||
$name !== null ? $name : $this->name,
|
$cache_array[] = $name !== null ? $name : $this->name;
|
||||||
(int)Tools::usingSecureMode(),
|
if (Configuration::get('PS_SSL_ENABLED'))
|
||||||
(int)$this->context->shop->id,
|
$cache_array[] = (int)Tools::usingSecureMode();
|
||||||
(int)Group::getCurrent()->id,
|
if (Shop::isFeatureActive())
|
||||||
(int)$this->context->language->id,
|
$cache_array[] = (int)$this->context->shop->id;
|
||||||
(int)$this->context->currency->id,
|
$cache_array[] = (int)Group::getCurrent()->id;
|
||||||
(int)$this->context->country->id
|
if (Language::isMultiLanguageActivated())
|
||||||
);
|
$cache_array[] = (int)$this->context->language->id;
|
||||||
|
if (Currency::isMultiCurrencyActivated())
|
||||||
|
$cache_array[] = (int)$this->context->currency->id;
|
||||||
|
$cache_array[] = (int)$this->context->country->id;
|
||||||
return implode('|', $cache_array);
|
return implode('|', $cache_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ class CartControllerCore extends FrontController
|
|||||||
{
|
{
|
||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
|
// Send noindex to avoid ghost carts by bots
|
||||||
|
header("X-Robots-Tag: noindex, nofollow", true);
|
||||||
|
|
||||||
// Get page main parameters
|
// Get page main parameters
|
||||||
$this->id_product = (int)Tools::getValue('id_product', null);
|
$this->id_product = (int)Tools::getValue('id_product', null);
|
||||||
$this->id_product_attribute = (int)Tools::getValue('id_product_attribute', Tools::getValue('ipa'));
|
$this->id_product_attribute = (int)Tools::getValue('id_product_attribute', Tools::getValue('ipa'));
|
||||||
|
|||||||
@@ -520,7 +520,6 @@ class InstallModelInstall extends InstallAbstractModel
|
|||||||
'blockcontact',
|
'blockcontact',
|
||||||
'blockcontactinfos',
|
'blockcontactinfos',
|
||||||
'blockcurrencies',
|
'blockcurrencies',
|
||||||
'blockcustomerprivacy',
|
|
||||||
'blocklanguages',
|
'blocklanguages',
|
||||||
'blockmanufacturer',
|
'blockmanufacturer',
|
||||||
'blockmyaccount',
|
'blockmyaccount',
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class BlockCurrencies extends Module
|
|||||||
if (Configuration::get('PS_CATALOG_MODE'))
|
if (Configuration::get('PS_CATALOG_MODE'))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!count(Currency::getCurrencies()))
|
if (!Currency::isMultiCurrencyActivated())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign);
|
$this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign);
|
||||||
|
|||||||
Reference in New Issue
Block a user