Sha256: ebf1d292a9813547f23c15e056ef5bb2ced31b6265ca15ee93ac6606bd023b6a

Contents?: true

Size: 580 Bytes

Versions: 12

Compression:

Stored size: 580 Bytes

Contents

class Muck::CartItemsController < ApplicationController
  
  unloadable
  
  include MuckCommerce::CartMethods

  def create
    @cart_item = CartItem.new
    @cart_item.product = Product.find(params[:product_id])
    @cart_item.cart = get_cart(current_user)
    @cart_item.quantity = 1
    @cart_item.save!
    respond_to do |format|
      format.html { redirect_to new_order_path }
    end
  rescue => ex
    respond_to do |format|
      flash[:notice] = translate('muck.commerce.add_cart_item_error', :error => ex)
      format.html { redirect_to cart_path }
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
muck-commerce-3.0.1 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.2.8 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.2.7 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.2.6 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.2.5 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.2.4 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.2.3 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.2.2 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.2.1 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.2.0 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.1.9 app/controllers/muck/cart_items_controller.rb
muck-commerce-0.1.8 app/controllers/muck/cart_items_controller.rb