Display calculator in payment method edit form

This commit is contained in:
Maikel Linke
2016-05-13 11:56:00 +10:00
parent 16b80a2f1b
commit e4f855b64a
4 changed files with 12 additions and 4 deletions

View File

@@ -57,6 +57,7 @@ module Spree
else
@providers = Gateway.providers.reject{ |p| p.name.include? "Bogus" }.sort{|p1, p2| p1.name <=> p2.name }
end
@calculators = PaymentMethod.calculators.sort_by(&:name)
end
def load_hubs

View File

@@ -33,4 +33,8 @@
= radio_button :payment_method, :active, false
&nbsp;
= label_tag nil, t(:say_no)
= render 'providers'
= render 'providers'
.row
.omega.eleven.columns
= render partial: 'spree/admin/shared/calculator_fields', :locals => { :f => f }

View File

@@ -34,6 +34,11 @@ module Openfoodnetwork
Spree::Calculator::PerItem,
Spree::Calculator::PriceSack,
OpenFoodNetwork::Calculator::Weight]
app.config.spree.calculators.payment_methods = [Spree::Calculator::FlatPercentItemTotal,
Spree::Calculator::FlatRate,
Spree::Calculator::FlexiRate,
Spree::Calculator::PerItem,
Spree::Calculator::PriceSack]
end
# Register Spree payment methods

View File

@@ -40,9 +40,7 @@ module Spree
module Core
class Environment
class Calculators
include EnvironmentExtension
attr_accessor :enterprise_fees
attr_accessor :enterprise_fees, :payment_methods
end
end
end