From 10dac5a45bff77c17589abe466e0f49b45d92bc8 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 27 Nov 2013 00:06:44 +0100 Subject: [PATCH] [-] CORE : Merge of https://github.com/PrestaShop/PrestaShop/pull/816 --- classes/Cart.php | 6 +++++- classes/Employee.php | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index 4c678c978..cc170a81d 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -152,7 +152,11 @@ class CartCore extends ObjectModel public function __construct($id = null, $id_lang = null) { - parent::__construct($id, $id_lang); + parent::__construct($id); + + if (!is_null($id_lang)) + $this->id_lang = (int)(Language::getLanguage($id_lang) !== false) ? $id_lang : Configuration::get('PS_LANG_DEFAULT'); + if ($this->id_customer) { if (isset(Context::getContext()->customer) && Context::getContext()->customer->id == $this->id_customer) diff --git a/classes/Employee.php b/classes/Employee.php index 3ee83a2dd..48b990dc7 100644 --- a/classes/Employee.php +++ b/classes/Employee.php @@ -122,7 +122,10 @@ class EmployeeCore extends ObjectModel public function __construct($id = null, $id_lang = null, $id_shop = null) { - parent::__construct($id, $id_lang, $id_shop); + parent::__construct($id, null, $id_shop); + + if (!is_null($id_lang)) + $this->id_lang = (int)(Language::getLanguage($id_lang) !== false) ? $id_lang : Configuration::get('PS_LANG_DEFAULT'); if ($this->id) $this->associated_shops = $this->getAssociatedShops();