Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Adding variant rule to the promotion system
Ruby Other
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db/migrate
lib
script
spec
.gitignore
.rspec
Gemfile
LICENSE
README.md
Rakefile
Versionfile
spree_promo_variant_rule.gemspec

README.md

Spree Promotion Variant Rule

Currently with spree core you can select products to be included in a promotion, but you can't select specific variants of products.

This extension adds this functionality. However, right now there is no GUI for adding variants. You have to add them manually through the command line.

Eventually I'd like to see this functionality merged into spree core but I don't have the time to create the PR right now.

Adding Products on the Command Line

This is ugly hack for not having the time to write a proper GUI for this. Create the promotion, open up the rails console, then:

# find the promotion; use the ID in the admin URL
p = Spree::Promotion.find(8)

# get your list of variants
variants = [Spree::Variant.last]

# assuming you only have one rule
p.rules.first.variants = variants

Copyright (c) 2012 Michael Bianco, released under the New BSD License

Something went wrong with that request. Please try again.