Class: Spree::PageBlocks::MegaNavWithSubcategories

Inherits:
Spree::PageBlock show all
Defined in:
app/models/spree/page_blocks/mega_nav_with_subcategories.rb

Constant Summary

Constants inherited from Spree::PageBlock

Spree::PageBlock::BOTTOM_PADDING_DEFAULT, Spree::PageBlock::CONTAINER_ALIGNMENT_DEFAULT, Spree::PageBlock::SIZE_DEFAULT, Spree::PageBlock::TEXT_ALIGNMENT_DEFAULT, Spree::PageBlock::TOP_PADDING_DEFAULT, Spree::PageBlock::WIDTH_DESKTOP_DEFAULT

Instance Method Summary collapse

Methods inherited from Spree::PageBlock

#form_partial_name

Instance Method Details

#display_nameObject



21
22
23
# File 'app/models/spree/page_blocks/mega_nav_with_subcategories.rb', line 21

def display_name
  taxon&.name || Spree.t(:mega_nav_with_subcategories)
end


13
14
15
# File 'app/models/spree/page_blocks/mega_nav_with_subcategories.rb', line 13

def featured_taxon
  store.taxons.find_by(id: preferred_featured_taxon_id) if preferred_featured_taxon_id.present?
end

#icon_nameObject



17
18
19
# File 'app/models/spree/page_blocks/mega_nav_with_subcategories.rb', line 17

def icon_name
  'category'
end

#taxonObject



9
10
11
# File 'app/models/spree/page_blocks/mega_nav_with_subcategories.rb', line 9

def taxon
  store.taxons.find_by(id: preferred_taxon_id) if preferred_taxon_id.present?
end