Sha256: 5b403d9e930ce73702f4a26a553c471ff5bd13e9ec255082ee13f4c410d7bc5a

Contents?: true

Size: 1.09 KB

Versions: 23

Compression:

Stored size: 1.09 KB

Contents

module Spree
  class StoreController < Spree::BaseController
    include Spree::Core::ControllerHelpers::Order

    def unauthorized
      render 'spree/shared/unauthorized', :layout => Spree::Config[:layout], :status => 401
    end

    def cart_link
      render :partial => 'spree/shared/link_to_cart'
      fresh_when(simple_current_order)
    end

    protected
      # This method is placed here so that the CheckoutController
      # and OrdersController can both reference it (or any other controller
      # which needs it)
      def apply_coupon_code
        if params[:order] && params[:order][:coupon_code]
          @order.coupon_code = params[:order][:coupon_code]

          handler = PromotionHandler::Coupon.new(@order).apply

          if handler.error.present?
            flash.now[:error] = handler.error
            respond_with(@order) { |format| format.html { render :edit } } and return
          elsif handler.success
            flash[:success] = handler.success
          end
        end
      end

      def config_locale
        Spree::Frontend::Config[:locale]
      end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
spree_frontend-2.2.14 app/controllers/spree/store_controller.rb
spree_frontend-2.2.13 app/controllers/spree/store_controller.rb
spree_frontend-2.2.12 app/controllers/spree/store_controller.rb
spree_frontend-2.2.11 app/controllers/spree/store_controller.rb
spree_frontend-2.2.10 app/controllers/spree/store_controller.rb
spree_frontend-2.2.9 app/controllers/spree/store_controller.rb
spree_frontend-2.2.8 app/controllers/spree/store_controller.rb
spree_frontend-2.2.7 app/controllers/spree/store_controller.rb
spree_frontend-2.4.0.rc3 app/controllers/spree/store_controller.rb
spree_frontend-2.4.0.rc2 app/controllers/spree/store_controller.rb
spree_frontend-2.4.0.rc1 app/controllers/spree/store_controller.rb
spree_frontend-2.3.4 app/controllers/spree/store_controller.rb
spree_frontend-2.2.6 app/controllers/spree/store_controller.rb
spree_frontend-2.3.3 app/controllers/spree/store_controller.rb
spree_frontend-2.3.2 app/controllers/spree/store_controller.rb
spree_frontend-2.2.5 app/controllers/spree/store_controller.rb
spree_frontend-2.3.1 app/controllers/spree/store_controller.rb
spree_frontend-2.2.4 app/controllers/spree/store_controller.rb
spree_frontend-2.2.3 app/controllers/spree/store_controller.rb
spree_frontend-2.3.0 app/controllers/spree/store_controller.rb