core/app/controllers/spree/base_controller.rb
# retrieve the order_id from the session and then load from the database (or return a new order if no
# such id exists in the session)
retrieve the order_id from the session and then load from the database (or return a new order if no
such id exists in the session)
retrieve the order_id from the session and then load from the database ( or return a new order if no such id exists in the session )
def find_order
    if !session[:order_id].blank?
      @order = Order.find_or_create_by_id(session[:order_id])
    elsif request.get?
      @order = Order.new(:user => current_user)
    else
      @order = Order.create(:user => current_user)
    end
    session[:order_id]    = @order.id
    session[:order_token] = @order.token
    @order
  end
def find_order if ! session [ :order_id ] . blank? @order = Order . find_or_create_by_id ( session [ :order_id ] ) elsif request . get? @order = Order . new ( :user => current_user ) else @order = Order . create ( :user => current_user ) end session [ :order_id ] = @order . id session [ :order_token ] = @order . token @order end
retrieve the order_id from the session and then load from the database (or return a new order if no
such id exists in the session)
retrieve the order_id from the session and then load from the database ( or return a new order if no such id exists in the session )