Class: Workarea::Storefront::OrdersController
Instance Method Summary
collapse
#current_layout, #current_user_info, #health_check, #layout_content
#lookup_order, #lookup_order=
#clear_current_order, #completed_order, #completed_order=, #current_checkout, #current_order, #current_order=, #current_shipping, #current_shippings, #logout
Instance Method Details
#index ⇒ Object
3
4
5
|
# File 'app/controllers/workarea/storefront/orders_controller.rb', line 3
def index
redirect_to users_orders_path if logged_in?
end
|
#lookup ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/workarea/storefront/orders_controller.rb', line 7
def lookup
@payment = Payment.lookup(params[:order_id], params[:postal_code])
if @payment
self.lookup_order = Order.find(@payment.id)
redirect_to order_path(lookup_order)
else
self.lookup_order = nil
flash[:error] = t('workarea.storefront.flash_messages.no_matching_order')
redirect_to check_orders_path
end
end
|
#show ⇒ Object
20
21
22
23
24
25
26
27
|
# File 'app/controllers/workarea/storefront/orders_controller.rb', line 20
def show
if lookup_order.try(:id).to_s.downcase != params[:id].to_s.downcase
flash[:error] = t('workarea.storefront.flash_messages.no_matching_order')
redirect_to check_orders_path
end
@order = Storefront::OrderViewModel.wrap(lookup_order, view_model_options)
end
|