Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.

Free Shipping, based on product method. Product method name is configuration via shipping method settings.

License

Notifications You must be signed in to change notification settings

piggybak/piggybak_free_shipping_by_product

Repository files navigation

PiggybakFreeShipping

Functionality

  • This extension provides free shipping for orders that contain all products indicated as free shipping, via a method or attribute name. Orders that contain all products indicated as free shipping exclude all other shipping methods. Orders that contain at least one product that does not have free shipping offers other available shipping methods based on the Piggybak configuration and shipping calculators.
  • Note that if you have multiple product types in your cart, free shipping is only offered for those orders where all items respond_to? the free shipping method and that value is true.

Requirements

  • This gem requires existing installation of Piggybak. The current version of the gem supports Rails 3.2.* and 4.

Installation

  • To install, first add gem "piggybak_free_shpping_by_product" and run bundle install.
  • Next, create a product method that you will use to indicate free shipping for a product. This can either be a boolean attribute on your product table, or a more complex method. This code should live in your parent Rails application.
  • If you are using a table attribute to indicate free shipping, you may want to add this field to be visible in Rails Admin.
  • Next, go to the Piggybak Admin and create a shipping method which uses the Free Shipping By Product calculator. You must create a metadata value to indicate the product method name, e.g. key is "product_method_name", and value is your method or attribute. Save this shipping method.

Tests

  • Several integration tests live in ./test/*, which reference the dummy Rails app inside that test/ folder. To run, first run bundle install inside this directory and then run 'rake test'.

About

Free Shipping, based on product method. Product method name is configuration via shipping method settings.

Resources

License

Stars

Watchers

Forks

Packages

No packages published