Skip to content
Allows variants to be sold as different sized cuts from a whole product.
Ruby JavaScript HTML CSS
Branch: 2-4-stable
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
config
db/migrate
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
spree_flexible_variants.gemspec

README.md

Build Status

SpreeFlexibleVariants

Allows variants to be sold as different sized cuts from a whole product. E.g. Fat/thin quarters, half metres, and metres from a bolt of fabric.

HowTo

Each product has the option, Flexible Variants, to sell variants at different sized cuts. The number of flexible units is the total number of the smallest size you can sell.

Example:

From a 10m bolt of fabric:

Size Units
Thin quarter 1
Fat quarter 1
Half metre 2
Metre 4

There are forty quarter metres in ten metres, therefore the total number of units is 40.

Turn off Spree's inventory tracking for each variant in the product.

Installation

Add spree_flexible_variants to your Gemfile:

gem 'spree_flexible_variants', git: 'git@github.com:clomax/spree_flexible_variants.git'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g spree_flexible_variants:install

TODO

  • Add a way of setting unit amount for each variant - at the moment you have to do it in the DB

Testing

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle
bundle exec rake

When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:

require 'spree_flexible_variants/factories'

Copyright (c) 2015 Craig Lomax, released under the New BSD License

You can’t perform that action at this time.