diff --git a/core/lib/Thelia/Action/Coupon.php b/core/lib/Thelia/Action/Coupon.php index 2bffb19ee..8751dae3b 100755 --- a/core/lib/Thelia/Action/Coupon.php +++ b/core/lib/Thelia/Action/Coupon.php @@ -263,6 +263,8 @@ class Coupon extends BaseAction implements EventSubscriberInterface $orderCoupon->save(); } } + + $request->getSession()->setConsumedCoupons(array()); } /** diff --git a/core/lib/Thelia/Action/Order.php b/core/lib/Thelia/Action/Order.php index 792297642..1abe36508 100755 --- a/core/lib/Thelia/Action/Order.php +++ b/core/lib/Thelia/Action/Order.php @@ -287,7 +287,8 @@ class Order extends BaseAction implements EventSubscriberInterface $sessionOrder = new \Thelia\Model\Order(); $event->setOrder($sessionOrder); $event->setPlacedOrder($placedOrder); - $this->getSession()->setOrder($placedOrder); + $this->getSession()->setProcessedOrder($placedOrder); + $this->getSession()->setOrder(new \Thelia\Model\Order()); /* empty cart */ $this->getDispatcher()->dispatch(TheliaEvents::CART_CLEAR, new CartEvent($this->getCart($this->getRequest()))); diff --git a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php index b35bd4a13..5179d7e56 100755 --- a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php +++ b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php @@ -253,6 +253,26 @@ class Session extends BaseSession return $this->get("thelia.order"); } + /** + * @param Order $order + * @return $this + */ + public function setProcessedOrder(Order $order) + { + $this->set('thelia.order.processed', $order); + + return $this; + } + + /** + * Return an order already processed, usefull for payment modules + * @return Order + */ + public function getProcessedOrder() + { + return $this->get('thelia.order.processed'); + } + /** * Set consumed coupons by the Customer *