Class: Spree::Account::OrdersController

Inherits:
BaseController show all
Defined in:
app/controllers/spree/account/orders_controller.rb

Instance Method Summary collapse

Methods inherited from StoreController

#current_taxon, #default_products_sort, #permitted_products_params, #products_filters_params, #render_404_if_store_not_exists, #store_filter_names, #store_filter_names_hash

Methods included from Spree::AnalyticsHelper

#analytics_event_handlers, #track_event, #unsupported_event?

Methods included from WishlistHelper

#current_wishlist

Methods included from PasswordProtected

#redirect_to_password

Methods included from StorefrontHelper

#as_aspect_ratio, #page_description, #page_image, #paths_equal?, #render_storefront_partials, #show_account_pane?, #svg_country_icon, #tailwind_classes_for

Methods included from ThemeConcern

#default_url_options, #set_theme_view_paths

Instance Method Details

#indexObject

GET /account/orders



5
6
7
# File 'app/controllers/spree/account/orders_controller.rb', line 5

def index
  @orders = orders_scope.order(created_at: :desc).page(params[:page]).per(25)
end

#showObject

GET /account/orders/:id



10
11
12
13
# File 'app/controllers/spree/account/orders_controller.rb', line 10

def show
  @order = orders_scope.find_by!(number: params[:id])
  @shipments = @order.shipments.includes(:stock_location, :address, selected_shipping_rate: :shipping_method, inventory_units: :line_item)
end