Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

related_products_spree

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

related_products_spree

  • 3.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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

Currently, master doesn't support discounts out of the box. There is however a branch implement_discounts that should have the necessary discount-enabled code (which was cherry-picked from the working 0-70-x branch).

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

FAQs

Package last updated on 06 Dec 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc