mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Display calculator in payment method edit form
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -33,4 +33,8 @@
|
||||
= radio_button :payment_method, :active, false
|
||||
|
||||
= label_tag nil, t(:say_no)
|
||||
= render 'providers'
|
||||
= render 'providers'
|
||||
|
||||
.row
|
||||
.omega.eleven.columns
|
||||
= render partial: 'spree/admin/shared/calculator_fields', :locals => { :f => f }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user