https://github.com/ericboehs/op_cart
Opinionated cart engine for Ruby on Rails
https://github.com/ericboehs/op_cart
Last synced: 10 months ago
JSON representation
Opinionated cart engine for Ruby on Rails
- Host: GitHub
- URL: https://github.com/ericboehs/op_cart
- Owner: ericboehs
- License: mit
- Created: 2014-08-29T20:22:12.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-11-24T02:56:03.000Z (over 10 years ago)
- Last Synced: 2025-02-20T02:46:12.642Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 442 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
## Op(inionated) Cart
_Opinionated cart engine for Ruby on Rails_
OpCart makes things simple through inflexibility and lack of features.
OpCart assumes you are using:
- Stripe for payments
- Rails `~> 4.2.0`
- Postgres `~> 9.3`
- Devise `~> 3.3` for authentication
- ActiveJob with a job queue configured
- SSL already
OpCart assumes you don’t:
- have hundreds of products and want search indexing
- need promotion/coupon support
- need to track inventory
- charge for shipping
- have complex products to sell (e.g. variants like different sizes and colors)
- like Spree or other open-source carts
### Installation
Add `op_cart` to your `Gemfile`:
```
gem 'op_cart', '~> 1.0.0'
```
Copy the migrations and run them:
```
rake op_cart:install:migrations db:migrate
```
Add a `checkout` route to your `config/routes.rb`:
```
Rails.application.routes.draw do
mount OpCart::Engine => "/store"
#...
end
```
_When updating OpCart, you will need to run `rake op_cart:install:migrations` again._
### Data Models and Classes
- Product
- name
- description
- image\_url
- price (in cents)
- allow\_purchases (to hide product and disable sales)
- charge\_taxes
- user\_id (creator)
- Order
- status
- total
- tax\_charge
- shipping\_address\_id
- user\_id
- Line Item
- unit\_price
- quantity
- price
- sellable\_snapshot (object freeze)
- sellable\_type
- sellable\_id
- order\_id
- Payment
- PaymentGateway
- Cart (cookie?)
- Address
- Shipment
- Tax Calculator