Sha256: f671c714ae3d62fd7d4dce98f2eed805d5f1984c012b1402566f2511c3ee609b

Contents?: true

Size: 813 Bytes

Versions: 1

Compression:

Stored size: 813 Bytes

Contents

# frozen_string_literal: true

module Spree
  class StoreController < Spree::BaseController
    include Spree::Core::ControllerHelpers::Pricing
    include Spree::Core::ControllerHelpers::Order
    include SolidusStarterFrontend::Taxonomies

    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(current_order, template: 'spree/shared/_link_to_cart')
    end

    private

    def config_locale
      SolidusStarterFrontend::Config[:locale]
    end

    def lock_order
      Spree::OrderMutex.with_lock!(@order) { yield }
    rescue Spree::OrderMutex::LockFailed
      flash[:error] = t('spree.order_mutex_error')
      redirect_to spree.cart_path
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_starter_frontend-0.1.0 app/controllers/spree/store_controller.rb