// 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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user