Skip to content

Matkahuolto shipping integration for Spree Commerce

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt
Notifications You must be signed in to change notification settings

agencyleroy/spree_matkahuolto

Repository files navigation

SpreeMatkahuolto

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'spree_matkahuolto'

And then execute:

$ bundle

Or install it yourself as:

$ gem install spree_matkahuolto

Then, to copy and execute the migrations, run:

$ rails g spree_matkahuolto:install

Then, add this requirement in your application.js.coffee

#= require shipping_method_matkahuolto

And add this requirement to your application.scss

*= require shipping_method_matkahuolto

Usage

Give Rails access to your Matkahuolto credentials (username, password and test_mode) as environment variables:

ENV["#{Rails.env.upcase}_MATKAHUOLTO_USERNAME"]

ENV["#{Rails.env.upcase}_MATKAHUOLTO_PASSWORD"]

ENV["#{Rails.env.upcase}_MATKAHUOLTO_TEST_MODE"]

[NOTE: Because ENV should only contain string, value of ENV["#{Rails.env.upcase}_MATKAHUOLTO_TEST_MODE"] should be either "true" or "false"]

In the Spree backend, shipping methods which internal names contains the following will be automatically linked to Matkahuolto backend:

matkahuolto_lahella

matkahuolto_jako

In the Spree checkout process, on the delivery method selection page, Matkahuolto Lahella will display a selection of available pickup places

In the Spree backend, any order that used Matkahuolto Lahella or Matkahuolto Jako as a delivery method will now provide a "print labels" link enabling to automatically download the package label PDF generated by Matkahuolto.

The Labels are saved to the file system. This rake tasks cleans up all labels older than 3 weeks:

rake labels:cleanup

You can setup a 'whenever' scheduled job by adding the following lines to your config/schedule.rb

every :sunday, :at => '12pm' do
  rake "labels:cleanup"
end

Don't forget to use the 'whenever' capistrano script to deploy your scheduled job.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/spree_matkahuolto/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Matkahuolto shipping integration for Spree Commerce

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Stars

Watchers

Forks

Packages

No packages published