Class: Workarea::Storefront::Checkout::ShippingController

Inherits:
Workarea::Storefront::CheckoutsController show all
Defined in:
app/controllers/workarea/storefront/checkout/shipping_controller.rb

Instance Method Summary collapse

Methods inherited from Workarea::Storefront::CheckoutsController

#new

Methods inherited from ApplicationController

#current_layout, #current_user_info, #health_check, #layout_content

Methods included from OrderLookup

#lookup_order, #lookup_order=

Methods included from Workarea::Storefront::CurrentCheckout

#clear_current_order, #completed_order, #completed_order=, #current_checkout, #current_order, #current_order=, #current_shipping, #current_shippings, #logout

Instance Method Details

#shippingObject

GET /checkout/shipping



6
7
8
9
10
11
# File 'app/controllers/workarea/storefront/checkout/shipping_controller.rb', line 6

def shipping
  @step ||= Storefront::Checkout::ShippingViewModel.new(
    shipping_step,
    view_model_options
  )
end

#update_shippingObject

PATCH /checkout/payment



14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/workarea/storefront/checkout/shipping_controller.rb', line 14

def update_shipping
  shipping_step.update(params)

  if request.xhr?
    updated_shipping_step_summary
  elsif shipping_step.complete?
    completed_shipping_step
  else
    incomplete_shipping_step
  end
end