diff --git a/app/controllers/api/orders_controller.rb b/app/controllers/api/orders_controller.rb index 03d4e8caa4..9db18d88c4 100644 --- a/app/controllers/api/orders_controller.rb +++ b/app/controllers/api/orders_controller.rb @@ -26,7 +26,10 @@ module Api end def order - @order ||= Spree::Order.find_by_number!(params[:id]) + @order ||= Spree::Order. + where(number: params[:id]). + includes(line_items: { variant: [:product, :stock_items, :default_price] }). + first! end end end