Git Product home page Git Product logo

spree_related_products's Introduction

Related Products

Build Status

This extension provides a generic way for you to define different types of relationships between your products, by defining a RelationType for each type of relationship you'd like to maintain.

You can manage RelationTypes via the admin configuration menu, and you can maintain product relationships via Related Products tab on the edit product UI.

Possible uses

  • Accessories

  • Cross Sells

  • Up Sells

  • Compatible Products

  • Replacement Products

  • Warranty & Support Products

Relation Types

When you create a RelationType you can access that set of related products by referencing the relation_type name, see below for an example:

    rt = Spree::RelationType.create(:name => "Accessories", :applies_to => "Spree::Product")
     => #<Spree::RelationType id: 4, name: "Accessories" ...>
    product = Spree::Product.last
     => #<Spree::Product id: 1060500592 ...>
    product.accessories
     => []

You can access all related products regardless of RelationType by:

    product.relations
     => []

Discounts You can optionally specify a discount amount to be applied if a customer purchases both products.

Note: In order for the coupon to be automatically applied, you must create a promotion leaving the code value empty, and adding an Action of type : RelatedProductDiscount (blank codes are required for coupons to be automatically applied).

Installation

Add to Gemfile:

gem 'spree_related_products', :git => 'git://github.com/spree/spree_related_products.git'

Run:

$ bundle
$ bundle exec rails g spree_related_products:install

Development

* Fork the repo
* clone your repo
* Run `bundle`
* Run `bundle exec rake test_app` to create the test application in `spec/test_app`.
* Make your changes.
* Ensure specs pass by running `bundle exec rake`
* Submit your pull request

spree_related_products's People

Contributors

bdq avatar jdutil avatar ajjahn avatar lbrapid avatar schof avatar jsqu99 avatar citrus avatar gudata avatar radar avatar hoverlover avatar shaggyone avatar romul avatar patrickmcelwee avatar mscottford avatar luisdoubrava avatar laurens avatar davidslvto avatar demillir avatar geekoncoffee avatar

Watchers

James Cloos 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.