Project

op_cart

0.0
No commit activity in last 3 years
No release in over 3 years
Opinionated cart engine for Ruby on Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0

Runtime

~> 4.2
~> 1.18
 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