[-] BO : BugFix : #PSCFV-2965 : Localization : updating default currency does not change currency on BO
This commit is contained in:
@@ -317,7 +317,7 @@ class AdminControllerCore extends Controller
|
|||||||
|
|
||||||
$this->initShopContext();
|
$this->initShopContext();
|
||||||
|
|
||||||
$currency = Shop::getEntityIds('currency', $this->context->shop->id);
|
$currency = Shop::getEntityIds('currency', $this->context->shop->id, true, true);
|
||||||
$this->context->currency = new Currency($currency[0]['id_currency']);
|
$this->context->currency = new Currency($currency[0]['id_currency']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1036,15 +1036,19 @@ class ShopCore extends ObjectModel
|
|||||||
* @param int $id_shop
|
* @param int $id_shop
|
||||||
* @return array|bool
|
* @return array|bool
|
||||||
*/
|
*/
|
||||||
public static function getEntityIds($entity, $id_shop)
|
public static function getEntityIds($entity, $id_shop, $active = false, $delete = false)
|
||||||
{
|
{
|
||||||
if (!Shop::isTableAssociated($entity))
|
if (!Shop::isTableAssociated($entity))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||||
SELECT `id_'.pSQL($entity).'`
|
SELECT entity.`id_'.pSQL($entity).'`
|
||||||
FROM `'._DB_PREFIX_.pSQL($entity).'_shop`
|
FROM `'._DB_PREFIX_.pSQL($entity).'_shop`es
|
||||||
WHERE `id_shop` = '.(int)$id_shop
|
LEFT JOIN '._DB_PREFIX_.pSQL($entity).' entity
|
||||||
|
ON (entity.`id_'.pSQL($entity).'` = es.`id_'.pSQL($entity).'`)
|
||||||
|
WHERE es.`id_shop` = '.(int)$id_shop.
|
||||||
|
($active ? ' AND entity.`active` = 1' : '').
|
||||||
|
($delete ? ' AND entity.deleted = 0' : '')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user