allow token to be null in cart table

This commit is contained in:
Manuel Raynaud
2013-08-06 11:53:30 +02:00
parent e0be762236
commit b18a09b94b
5 changed files with 40 additions and 9 deletions

View File

@@ -234,12 +234,14 @@ class Cart implements EventSubscriberInterface
protected function generateCookie()
{
$id = null;
if (ConfigQuery::read("cart.session_only", 0) == 0) {
$id = uniqid('', true);
setcookie("thelia_cart", $id, time()+ConfigQuery::read("cookie.lifetime", 60*60*24*365));
return $id;
}
return $id;
}
}