Class: Spree::SitemapController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/sitemap_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/spree/sitemap_controller.rb', line 2

def index
  @public_dir = root_url
  @products = Spree::Product.available
  @taxonomies = Spree::Taxonomy.all
  @pages = _select_static_pages

  respond_to do |format|
    format.html {  }
    format.xml do
      nav = _build_taxon_hash
      nav = _build_pages_hash nav
      nav = _add_products_to_tax nav, false
      render layout: false, xml: _build_xml(nav)
    end

    format.text do
      @nav = _add_products_to_tax(_build_taxon_hash, false)
      render layout: false
    end
  end
end