Class: Spree::ProductsController
Instance Method Summary
collapse
#cart_link, #forbidden, #unauthorized
Instance Method Details
#index ⇒ Object
11
12
13
14
15
16
|
# File 'app/controllers/spree/products_controller.rb', line 11
def index
@searcher = build_searcher(params.merge(include_images: true))
@products = @searcher.retrieve_products
@products = @products.includes(:possible_promotions) if @products.respond_to?(:includes)
@taxonomies = Spree::Taxonomy.includes(root: :children)
end
|
#show ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/spree/products_controller.rb', line 18
def show
@variants = @product.variants_including_master.
spree_base_scopes.
active(current_currency).
includes([:option_values, :images])
@product_properties = @product.product_properties.includes(:property)
@taxon = params[:taxon_id].present? ? Spree::Taxon.find(params[:taxon_id]) : @product.taxons.first
redirect_if_legacy_path
end
|