Adding fix to prevent account_invoice orders from being sucked into the frontend as normal orders

This commit is contained in:
Rob Harrington
2015-09-18 17:25:34 +10:00
parent 14fbeda29e
commit 9dc0598870

View 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