Handling fee per product variant. While spree-contrib/spree_handling_fees
adds handling fees per shipment, this will add a handling fee per item that is being shipped.
Add the following to your Gemfile:
gem "spree_handling_fees", github: "groundctrl/spree_handling_fees"
Run the bundle command to install it:
bundle install
After installing, run the generator:
bundle exec rails g spree_handling_fees:install
Copy new migrations
rake spree_handling_fees:install:migrations
Run migrations
rake db:migrate
To globally change the current handling fee for all product variants, a Rake task can be run.
The handling fee is not specified here. The handling fee used is the same one that is set in the admin (/admin/general_settings/edit
).
The handling fee can be accessed using Spree::Config.handling_fee
.
bundle exec rake spree:handling_fee:apply
NOTE: This Rake task does not change the handling fee that was collected on previous orders. It only applies to orders going forward.
- Log in to the admin (
/admin
) - Click on
Configuration
in the top menu - Click
Tax Rates
from the right side menu - Click the
New Tax Rate
button - Enter
Handling Fee
in theName
field - Choose the appropriate
Zone
- Enter
0
in theRate
field - Uncheck the
Show rate in label
checkbox - Select
Calculated per item handling fee
from theCalculator
field - Click the
Create
button - Profit
Run tests. This will also generate the dummy app.
bundle exec rake
Or take the longer way around
bundle exec rake test_app
bundle exec rake spec
- Fork it ( https://github.com/groundctrl/spree_handling_fees/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request