Class: Locomotive::Ecommerce::OrderController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Locomotive::Ecommerce::OrderController
- Defined in:
- app/controllers/locomotive/ecommerce/order_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#authenticate_user!, #locomotive_user?
Methods included from EcommerceHelper
Methods included from InventoryInterface
Methods included from EcommerceUrlHelper
#add_to_cart_path, #cart_path, #cart_update_path, #checkout_index_path, #checkout_path, #checkout_update_path, #confirm_order_path, #post_checkout_path, #purchases_path, #remove_from_cart_path
Methods included from EcommerceCartHelper
Instance Method Details
#create ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/locomotive/ecommerce/order_controller.rb', line 4 def create @order = current_user_cart(self).add_product_by_sku(params[:item_sku]) flash[:success] = 'Added product to cart' redirect_to cart_path end |
#destroy ⇒ Object
10 11 12 13 14 15 |
# File 'app/controllers/locomotive/ecommerce/order_controller.rb', line 10 def destroy @order = current_user_cart(self).remove_product_by_sku( params[:product_id]) flash[:success] = 'Removed product from cart' redirect_to cart_path end |