// Fix uses of $cookie var in CompareProduct

// Fix little issue on Geolocation
[-] FO : Fix issue on compare product when cookie->id_compare value is invalid
This commit is contained in:
aFolletete
2012-05-10 13:32:56 +00:00
parent 7481b3a0ca
commit ee03cd2c99
3 changed files with 9 additions and 3 deletions
+7 -1
View File
@@ -77,6 +77,12 @@ class CompareProductCore extends ObjectModel
*/
public static function addCompareProduct($id_compare, $id_product)
{
// Check if compare row exists
$id_compare = Db::getInstance()->getValue('
SELECT `id_compare`
FROM `'._DB_PREFIX_.'compare`
WHERE `id_compare` = '.(int)$id_compare);
if (!$id_compare)
{
$id_customer = false;
@@ -161,4 +167,4 @@ class CompareProductCore extends ObjectModel
FROM `'._DB_PREFIX_.'compare`
WHERE `id_customer`= '.(int)$id_customer);
}
}
}