mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-18 04:39:14 +00:00
Adding fix to prevent account_invoice orders from being sucked into the frontend as normal orders
This commit is contained in:
11
config/initializers/user_class_extensions.rb
Normal file
11
config/initializers/user_class_extensions.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
Spree::Core::Engine.config.to_prepare do
|
||||
if Spree.user_class
|
||||
Spree.user_class.class_eval do
|
||||
|
||||
# Override of spree method to ignore orders associated with account_invoices
|
||||
def last_incomplete_spree_order
|
||||
spree_orders.incomplete.where("id NOT IN (?)", account_invoices.map(&:order_id)).order('created_at DESC').first
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user