SpreeWeigthCalculator
This is a calculator that calculates (cuak!) the shipping cost based on the weight, volume and price of the order. To do that we have created an end-point that calculate that for us.
Installation
Add spree_weigth_calculator to your Gemfile:
gem 'spree_weigth_calculator'
Bundle your dependencies and run the installation generator:
bundle
bundle exec rails g spree_weigth_calculator:install
Configuration
The calculator has two preferences:
- URL
The preference URL
is the endpoint. For example: https://logistic.domain.com/cost
.
The endpoint should be like:
https://logistic.domain.com/cost/#{zip}?volume=#{volume}&weight=#{weight}&dimension=#{dimension}
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
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_weigth_calculator/factories'
TODO
- Set the
weight
,dimension
andvolume
as optional parameters in the URL. - Add some tests.