Class: Spree::CheckoutController
- Inherits:
-
StoreController
- Object
- ApplicationController
- BaseController
- StoreController
- Spree::CheckoutController
- Defined in:
- app/controllers/spree/checkout_controller.rb
Overview
Much of this file, especially the update action is overriden in the promo gem. This is to allow for the promo behavior but also allow the promo gem to be removed if the functionality is not needed.
Instance Method Summary collapse
-
#update ⇒ Object
Updates the order and advances to the next state (when possible.) Overriden by the promo gem if it exists.
Methods inherited from StoreController
Methods included from Spree::Core::ControllerHelpers::Order
#after_save_new_order, #associate_user, #before_save_new_order, #current_order, included, #set_current_order
Methods included from Spree::Core::ControllerHelpers::Common
Methods included from Spree::Core::ControllerHelpers::Auth
#current_ability, included, #redirect_back_or_default, #store_location, #try_spree_current_user, #unauthorized
Instance Method Details
#update ⇒ Object
Updates the order and advances to the next state (when possible.) Overriden by the promo gem if it exists.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/spree/checkout_controller.rb', line 22 def update if @order.update_attributes(object_params) fire_event('spree.checkout.update') if @order.next state_callback(:after) else flash[:error] = t(:payment_processing_failed) respond_with(@order, :location => checkout_state_path(@order.state)) return end if @order.state == "complete" || @order.completed? flash.notice = t(:order_processed_successfully) flash[:commerce_tracking] = "nothing special" respond_with(@order, :location => completion_route) else respond_with(@order, :location => checkout_state_path(@order.state)) end else respond_with(@order) { |format| format.html { render :edit } } end end |