Code Monkey home page Code Monkey logo

spree_suppliers's Introduction

Spree Suppliers Extension

This is an extension to run on top of Spree 0.70.3 rails ecommerce engine.

This gem (spree extension) provides support for multiple suppliers in one store, each selling their own products. Products should be assigned to the supplier that they belong to, which allows the customer to select a supplier and view only their products. Suppliers can be associated with Taxons, which allows the customer to search for supplier's products by taxon.

Orders are also broken up into individual supplier_invoices upon order completion (one for each different supplier in the order), which list only the products that were purchased from that supplier. A mailer is in place (though disabled until you add your email smtp credentials) to send each supplier their unique invoice describing what products they have sold and to whom. The spree order mailer has also been modified to show all of the supplier invoices to the customer, along with the standard spree order number and info. The checkout process is combined so the customer only makes one transaction - the transaction can then be divided up amongst the suppliers involved in the transaction, according to the supplier_invoices. There is also an option for the site administrator to charge a percentage fee on each transaction to suppliers (this is currently set to 0%, but can be changed).


Installation:

you must first have a running rails app:

  • rails new spree_suppliers_test
  • cd spree_suppliers_test

Now set up your Gemfile and install:

Add to Gemfile:

  • gem 'rails', '3.1.3'
  • gem 'sqlite3'
  • gem 'spree'
  • gem 'spree_suppliers'

then run the following:

  • bundle install

  • rails g spree:site

  • rails g spree_suppliers:install

  • rake db:migrate

  • rake db:seed

  • rake db:admin:create

  • (If you would like some sample seed data for suppliers, copy the seeds.rb file and seeds folder from the gem to your project home db/)

That's it for installation!

  • rails s
  • visit localhost:3000

Alternatively,

To get the latest updates, you can install the spree_suppliers extension from github instead of rubygems:

Add to Gemfile:

  • gem 'spree_suppliers', :git => 'git://github.com/johndavid400/spree_suppliers.git'

run the following:

  • bundle install
  • rake spree_suppliers:install
  • rake db:migrate

Checkout Process

Before being able to check out with the new changes, go to /admin and do the following things:

  1. create a supplier
  2. create a shipping method
  3. create a payment method (use "check" to test with)
  4. add product for supplier to use - then edit product and assign to to the desired supplier

Go through checkout process normally, then check orders page on the admin panel to view the details of an order and all supplier invoices that are created.


Supplier Invoice Mailer

There is a mailer in place that will send each individual supplier an email anytime a purchase is made from them. It will not show them the entire order, only the products purchased from them. The mailer is disabled (commented out) as there is no email smtp information yet. Once you fill this in, you can re-enable the mailer to send out emails.

To change smtp settings for supplier invoice:

  • config/initializers/supplier_invoice_mailer.rb

to enable supplier invoice mailer, uncomment line:84 and line:95:

  • lib/spree_suppliers.rb

spree_suppliers's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.