Skip to content

A spree extension that provides ability to add notes to orders, products and users or any spree table.

License

Notifications You must be signed in to change notification settings

rahul-bluebash/spree_notes

 
 

Repository files navigation

Spree Notes

About

A Spree extension that provides ability to add useful notes to orders, products, users or any other spree table.

Key Features

  • It includes ability to configure the note settings from admin panel.
  • Add notes to orders, products and users.
  • Easy to extend to add notes to any spree table.

Demo

Installation

  1. Add this extension to your Gemfile with this line:

    gem 'spree_notes'
  2. Install the gem using Bundler

    bundle install
  3. Copy & run migrations

    bundle exec rails g spree_notes:install
  4. Restart your server!

If your server was running, restart it so that it can find the assets properly.

Configure new class as noteable

  1. Added association for notes to new class

      has_many :notes, as: :notable
  2. For adding additional options for noteables, we can override the method noteable_klasses from Spree::NoteHelper

      def noteable_klasses
        legacy_klasses = super
        legacy_klasses << Spree::NewKlass
      end
  3. For adding sidebar tab of notes, feel free to create deface override with reference.

  4. Add notes.html.erb as view template for new class with reference.

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 update
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_notes/factories'

Contributing

See corresponding guidelines


Copyright (c) 2022 Spree Edge. released under the New BSD License

About

A spree extension that provides ability to add notes to orders, products and users or any spree table.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 75.5%
  • HTML 24.5%