Class: Spree::Pages::SearchResults

Inherits:
Spree::Page show all
Defined in:
app/models/spree/pages/search_results.rb

Instance Method Summary collapse

Methods inherited from Spree::Page

#create_preview, #custom?, #display_name, #duplicate, #layout_sections?, #promote, #store, #theme

Methods included from Spree::Previewable

#preview?

Instance Method Details

#customizable?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'app/models/spree/pages/search_results.rb', line 38

def customizable?
  true
end

#default_sectionsObject



31
32
33
34
35
36
# File 'app/models/spree/pages/search_results.rb', line 31

def default_sections
  [
    Spree::PageSections::PageTitle.new,
    Spree::PageSections::ProductGrid.new
  ]
end

#icon_nameObject



4
5
6
# File 'app/models/spree/pages/search_results.rb', line 4

def icon_name
  'search'
end

#page_builder_urlObject



8
9
10
11
12
13
14
15
16
17
18
# File 'app/models/spree/pages/search_results.rb', line 8

def page_builder_url
  return unless page_builder_url_exists?(:search_path)

  Spree::Core::Engine.routes.url_helpers.search_path(
    q: 'test',
    theme_id: theme.id,
    page_preview_id: page_preview&.id,
    theme_preview_id: theme_preview&.id,
    locale: I18n.locale
  )
end

#preview_url(theme_preview = nil, page_preview = nil) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'app/models/spree/pages/search_results.rb', line 20

def preview_url(theme_preview = nil, page_preview = nil)
  return unless page_builder_url_exists?(:search_path)

  Spree::Core::Engine.routes.url_helpers.search_path(
    q: 'test',
    theme_id: theme.id,
    page_preview_id: page_preview&.id,
    theme_preview_id: theme_preview&.id
  )
end