mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-25 05:45:15 +00:00
Provide price to calculator to meet new requirements of FlatPercentItemTotal
This commit is contained in:
@@ -104,8 +104,7 @@ module OpenFoodNetwork
|
||||
def calculate_fee_for(variant, enterprise_fee)
|
||||
# Spree's Calculator interface accepts Orders or LineItems,
|
||||
# so we meet that interface with a struct.
|
||||
# Amount is faked, this is a method on LineItem
|
||||
line_item = OpenStruct.new variant: variant, quantity: 1, amount: variant.price
|
||||
line_item = OpenStruct.new variant: variant, quantity: 1, price: variant.price, amount: variant.price
|
||||
enterprise_fee.compute_amount(line_item)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user