Project

cartify

0.0
No commit activity in last 3 years
No release in over 3 years
Shopping cart with a multi-step checkout, easily mounted into Rails application.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

Runtime

~> 4.3
~> 3.0
>= 4.3.1, ~> 4.3
>= 5.1.4, ~> 5.1
>= 1.0.5, ~> 1.0
>= 1.3.2, ~> 1.3
 Project Readme

Cartify

Shopping cart with a multi-step checkout, easily mounted into Rails application.

Usage

Run initializer:

rails generate initializer

Clone migrations:

rake cartify:install:migrations

Define 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_id

Installation

Add this line to your application's Gemfile:

gem 'cartify'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cartify

Available helpers

Shop icon helper

shop_icon_quantity

Will 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.