Module: Workarea::Storefront::OneThemeHelper

Defined in:
app/helpers/workarea/storefront/one_theme_helper.rb

Instance Method Summary collapse

Instance Method Details

#credit_card_issuer_icon(issuer) ⇒ Object

Overriding functionality from Workarea::Storefront::CreditCardsHelper Adds issuer class modifier to payment icons



11
12
13
14
15
16
17
18
19
# File 'app/helpers/workarea/storefront/one_theme_helper.rb', line 11

def credit_card_issuer_icon(issuer)
  icon_path = if card_icon_available?(issuer.optionize)
    "workarea/storefront/payment_icons/#{issuer.systemize}.svg"
  else
    "workarea/storefront/default_card.svg"
  end

  inline_svg(icon_path, class: "payment-icon payment-icon--#{issuer.dasherize}", title: issuer.humanize)
end

#media_alt_image_slider_options(product_id) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/helpers/workarea/storefront/one_theme_helper.rb', line 21

def media_alt_image_slider_options(product_id)
  {
    waitForImages: true,
    options: {
      asNavFor: "##{product_id}_primary_media_carousel",
      slidesToShow: 3,
      slidesToScroll: 1,
      autoplay: false,
      mobileFirst: true,
      dots: false,
      arrows: true,
      focusOnSelect: true,
      responsive: [
        {
          breakpoint: Workarea.config.storefront_break_points[:wide] - 1,
          settings: {
            vertical: true,
            verticalSwiping: true
          }
        }
      ]
    }
  }.to_json
end

#media_primary_image_slider_options(product_id) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'app/helpers/workarea/storefront/one_theme_helper.rb', line 46

def media_primary_image_slider_options(product_id)
  {
    waitForImages: true,
    options: {
      asNavFor: "##{product_id}_alt_media_carousel",
      slidesToShow: 1,
      slidesToScroll: 1,
      autoplay: false,
      mobileFirst: true,
      dots: false,
      arrows: false
    },
    forceSetPosition: true
  }.to_json
end

Returns:

  • (Boolean)


4
5
6
7
# File 'app/helpers/workarea/storefront/one_theme_helper.rb', line 4

def navigation_menu_item_parent?(menu)
  return true unless menu.content.blank? ||
    ContentViewModel.new(menu.content).content_blocks.blank?
end

#no_breadcrumbs?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'app/helpers/workarea/storefront/one_theme_helper.rb', line 66

def no_breadcrumbs?
  !content_for?(:breadcrumbs) && @breadcrumbs.nil? && request.original_url != root_url
end

#select_tag(name, option_tags = nil, options = {}) ⇒ Object



62
63
64
# File 'app/helpers/workarea/storefront/one_theme_helper.rb', line 62

def select_tag(name, option_tags = nil, options = {})
   :div, super, class: "select-menu"
end