check if order already existsin session before using it

This commit is contained in:
Manuel Raynaud
2014-03-06 20:35:55 +01:00
parent 16db61a237
commit ef5bdcb0f0

View File

@@ -250,7 +250,14 @@ class Session extends BaseSession
*/
public function getOrder()
{
return $this->get("thelia.order");
$order = $this->get("thelia.order");
if (null === $order) {
$order = new Order();
$this->setOrder($order);
}
return $order;
}
/**