Cartify
Shopping cart with a multi-step checkout, easily mounted into Rails application.
Usage
Run initializer:
rails generate initializerClone migrations:
rake cartify:install:migrationsDefine associations in your "User" model:
has_many :orders, class_name: 'Cartify::Order', foreign_key: :user_id
has_one :billing, class_name: 'Cartify::Billing', foreign_key: :user_id
has_one :shipping, class_name: 'Cartify::Shipping', foreign_key: :user_id
has_many :addresses, class_name: 'Cartify::Address', foreign_key: :user_idInstallation
Add this line to your application's Gemfile:
gem 'cartify'And then execute:
$ bundleOr install it yourself as:
$ gem install cartifyAvailable helpers
Shop icon helper
shop_icon_quantityWill produce:
<span class="shop-icon">
<span class="shop-quantity">1</span>
</span>Add to cart link helper
add_to_cart(product, quantity, button_name)
# product - name of your selling product (required!)
# quantity - how many goods you with put into cart (default: 1)
# button_name - button name (default: "Add to cart")Or customize as you with:
'helper link': cartify.order_items_path()
'required params': order_item: {quantity: quantity, product_id: product.id}
'use method': method: :post
'asynchronously': remote: true
# Example:
link_to cartify.order_items_path(order_item: {quantity: 7, product_id: product.id}),
{ method: :post, remote: true }License
The gem is available as open source under the terms of the MIT License.