Sha256: c558a71ffaf2dac7bdcc4ebbd0a073894c9f8f73491a8c5457478c9a923bf24d

Contents?: true

Size: 855 Bytes

Versions: 6

Compression:

Stored size: 855 Bytes

Contents

class Plugins::Ecommerce::Front::OrdersController < Plugins::Ecommerce::FrontController
  before_action :commerce_authenticate
  before_action :set_bread
  def index
    @orders = current_site.orders.set_user(cama_current_user).decorate
    render "index"
  end

  def show
    @order = current_site.orders.set_user(cama_current_user).find_by_slug(params[:order]).try(:decorate)
    return redirect_to(url_for(action: :index), error: t('plugins.ecommerce.messages.order_not_found', default: "Order not found", order: params[:order])) unless @order.present?
    @ecommerce_breadcrumb << [t('plugins.ecommerce.messages.detail_order', default: "Detail order: #%{order}", order: params[:order])]
  end

  private
  def set_bread
    @ecommerce_breadcrumb << [t('plugins.ecommerce.messages.my_orders', default: 'My Orders'), url_for(action: :index)]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
camaleon_ecommerce-2.0.4 app/controllers/plugins/ecommerce/front/orders_controller.rb
camaleon_ecommerce-2.0.3 app/controllers/plugins/ecommerce/front/orders_controller.rb
camaleon_ecommerce-2.0.2 app/controllers/plugins/ecommerce/front/orders_controller.rb
camaleon_ecommerce-2.0.1 app/controllers/plugins/ecommerce/front/orders_controller.rb
camaleon_ecommerce-2.0.0 app/controllers/plugins/ecommerce/front/orders_controller.rb
camaleon_ecommerce-1.2.1 app/controllers/plugins/ecommerce/front/orders_controller.rb