Skip to content

MatayoshiMariano/spree_weigth_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Spree weigth calculator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published