Module: Spree::Admin::ChannelsHelper

Defined in:
app/helpers/spree/admin/channels_helper.rb

Instance Method Summary collapse

Instance Method Details

#channel_guest_checkout_optionsObject

Tri-state guest-checkout override for the channel edit form. A blank selection clears the override and falls back to Store#preferred_guest_checkout.



23
24
25
26
27
28
# File 'app/helpers/spree/admin/channels_helper.rb', line 23

def channel_guest_checkout_options
  [
    [Spree.t('admin.channels.guest_checkout_allowed'), 'true'],
    [Spree.t('admin.channels.guest_checkout_blocked'), 'false']
  ]
end

#channel_order_routing_strategy_optionsObject

Registered Spree::OrderRouting::Strategy::Base subclasses presented in the channel edit form, sourced from Spree.order_routing.strategies so the picker can never drift from what the model accepts. A blank value clears the channel-level override and falls back to Store#preferred_order_routing_strategy.



9
10
11
# File 'app/helpers/spree/admin/channels_helper.rb', line 9

def channel_order_routing_strategy_options
  Spree.order_routing.strategies.map { |strategy| [strategy.display_name, strategy.to_s] }
end

#channel_storefront_access_optionsObject

Storefront access levels for the channel edit form. A blank selection clears the channel override and falls back to Store#preferred_storefront_access.



15
16
17
18
19
# File 'app/helpers/spree/admin/channels_helper.rb', line 15

def channel_storefront_access_options
  Spree::Channel::Gating::STOREFRONT_ACCESS.map do |value|
    [Spree.t("admin.channels.storefront_access_options.#{value}"), value]
  end
end