Skip to content

Latest commit

History

History
76 lines (53 loc) 路 2.91 KB

README.md

File metadata and controls

76 lines (53 loc) 路 2.91 KB

Spree Zero Stock Products

Build Status Dependency Status Coverage Status Code Climate

Restore the show_zero_stock_products preference & related functionality in Spree 2.0+

The preference defaults to true, which is the out-of-the-box behavior in Spree 2.0+

Set it to false to avoid showing products with zero stock on any product listing/taxon pages.

Installation

This documentation is for the master branch. You probably want 2-0-stable, 2-1-stable, or 2-2-stable, or 2-3-stable, or 2-4-stable instead

  1. Add spree_zero_stock_products to your Gemfile:
gem 'spree_zero_stock_products', github: 'swrobel/spree_zero_stock_products'
  1. Bundle your dependencies:
bundle
  1. Set the preference in an initializer such as config/initializers/spree.rb:
Spree.config do |config|
  config.show_zero_stock_products = false # Default is true
end
  1. Profit.

Versioning

Versions files the pattern MAJOR.MINOR.PATCH SemVer-style. MAJOR.MINOR version will always match the Spree version that gem is compatible with. PATCH version is incremented as new bugfix releases of this gem come out, indepently of new Spree PATCH versions.

For example, version 2.1.0 is compatible with the Spree 2.1.x series, while version 2.0.4 is compatible with the Spree 2.0.x series.

You should not need to worry about this, as the gemspec has the appropriate constraints. But hey, the more you know.

Testing

This extension is tested against the following rubies:

  • 1.9.3
  • 2.0
  • 2.1
  • 2.2
  • 2.3
  • jruby (experimental)
  • rubinius (experimental)

As well as the following databases:

  • sqlite
  • postgres
  • mysql

Running the tests locally

Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.

bundle
bundle exec rake test_app
bundle exec rspec

License

Copyright (c) 2013 Stefan Wrobel, released under the MIT License