Module: Workarea::Search::Storefront::Product::Sorting

Included in:
Workarea::Search::Storefront::Product
Defined in:
app/models/workarea/search/storefront/product/sorting.rb

Instance Method Summary collapse

Instance Method Details

#category_positionsHash

A hash of the position the product has in each category. Used for featured sorting.

Returns:

  • (Hash)


11
12
13
14
15
16
# File 'app/models/workarea/search/storefront/product/sorting.rb', line 11

def category_positions
  Catalog::ProductPositions.find(
    model.id,
    categories: categorization.to_models
  )
end

#search_positionsObject



18
19
20
# File 'app/models/workarea/search/storefront/product/sorting.rb', line 18

def search_positions
  Workarea::Search::Customization.positions_for_product(model.id)
end