diff --git a/guides/content/developer/core/calculators.md b/guides/content/developer/core/calculators.md index 0acbf434994..2d9d2574dfe 100644 --- a/guides/content/developer/core/calculators.md +++ b/guides/content/developer/core/calculators.md @@ -184,6 +184,13 @@ config.spree.calculators.shipping_methods << CustomCalculator config.spree.calculators.promotion_actions_create_adjustments << CustomCalculator ``` +For example if your calculator is placed in `app/models/spree/calculator/shipping/my_own_calculator.rb` you should call: + +``` +config = Rails.application.config +config.spree.calculators.shipping_methods << Spree::Calculator::Shipping::MyOwnCalculator +``` + ### Determining Availability By default, all shipping method calculators are available at all times. If you wish to make this dependent on something from the order, you can re-define the `available?` method inside your calculator: @@ -239,4 +246,4 @@ plan.compute_amount() ``` `create_adjustment`, `update_adjustment` and `compute_amount` will call `compute` on the `Calculator` object. This `calculable` amount is whatever object your -`CustomCalculator` class supports. \ No newline at end of file +`CustomCalculator` class supports.