Class: Spree::Admin::Orders::CustomerDetailsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- BaseController
- Spree::Admin::Orders::CustomerDetailsController
- Defined in:
- app/controllers/spree/admin/orders/customer_details_controller.rb
Instance Method Summary collapse
Methods included from Core::ControllerHelpers
Instance Method Details
#edit ⇒ Object
12 13 14 15 |
# File 'app/controllers/spree/admin/orders/customer_details_controller.rb', line 12 def edit @order.build_bill_address(:country_id => Spree::Config[:default_country_id]) if @order.bill_address.nil? @order.build_ship_address(:country_id => Spree::Config[:default_country_id]) if @order.ship_address.nil? end |
#show ⇒ Object
7 8 9 10 |
# File 'app/controllers/spree/admin/orders/customer_details_controller.rb', line 7 def show edit render :action => :edit end |
#update ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/spree/admin/orders/customer_details_controller.rb', line 17 def update if @order.update_attributes(params[:order]) shipping_method = @order.available_shipping_methods(:front_end).first if shipping_method @order.shipping_method = shipping_method if params[:guest_checkout] == 'false' && params[:user_id].present? @order.user_id = params[:user_id] @order.user true end @order.save @order.create_shipment! flash[:notice] = t('customer_details_updated') redirect_to edit_admin_order_shipment_path(@order, @order.shipment) else flash[:error] = t('errors.messages.no_shipping_methods_available') redirect_to admin_order_customer_path(@order) end else render :action => :edit end end |