Files
openfoodnetwork/app
Pau Perez 3c73282d57 Manually reset the order once completed
Spree does not call after_<order.state> methods any more as of
https://github.com/spree/spree/pull/2557, so our #after_complete method
is never triggered and thus the order never reset.

This makes the condition:

```ruby
if current_order.andand.distributor == @order.distributor
```

in app/views/spree/orders/form/_update_buttons.html.haml return false
and as a result the "Back To Cart" button is not shown.

This commit resets the order (emptying the session[:order_id] and
creating a new order, aka. cart) right from the
CheckoutController#update rather than relying on infernal callbacks (of
what the Spree core team itself was unhappy about since long ago
https://github.com/spree/spree/issues/2488). There is the first place
where we know the order has been successfully completed.
2017-09-08 23:55:50 +10:00
..
2017-09-08 23:55:50 +10:00
2017-09-08 23:55:49 +10:00