Class: Workarea::Storefront::OrdersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Workarea::Storefront::OrdersController
- Defined in:
- app/controllers/workarea/storefront/orders_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#current_layout, #current_user_info, #health_check, #layout_content
Methods included from OrderLookup
Methods included from UserActivity
#current_user_activity_id, #user_activity
Methods included from CurrentCheckout
#clear_current_order, #completed_order, #completed_order=, #current_checkout, #current_order, #current_order=, #current_shipping, #current_shippings
Methods included from HttpCaching
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, ) end |