No commit activity in last 3 years
No release in over 3 years
This calculator use the endpoint provide by the user to calculate the shipping cost
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 3.0.1
 Project Readme

Code Climate

SpreeWeigthCalculator

This is a calculator that calculates (cuak!) the shipping cost based on the weight, volume, price of the order and the sum of the width, height and depth. 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:

  1. 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

  1. Set the weight, dimension and volume as optional parameters in the URL.
  2. Add some tests.