mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-29 06:21:16 +00:00
Add new 'Checkout options' step to the edit order cycle form so people can attach shipping methods
This commit is contained in:
committed by
Filipe
parent
1e817af5aa
commit
855ec1a708
17
app/helpers/admin/order_cycles_helper.rb
Normal file
17
app/helpers/admin/order_cycles_helper.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
module OrderCyclesHelper
|
||||
def order_cycle_shared_payment_methods(order_cycle)
|
||||
order_cycle.attachable_payment_methods.select do |payment_method|
|
||||
(payment_method.distributor_ids & order_cycle.distributor_ids).many?
|
||||
end
|
||||
end
|
||||
|
||||
def order_cycle_shared_shipping_methods(order_cycle)
|
||||
order_cycle.attachable_shipping_methods.select do |shipping_method|
|
||||
(shipping_method.distributor_ids & order_cycle.distributor_ids).many?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user