Class: Workarea::Storefront::ContentBlocks::ProductListViewModel
Instance Method Summary
collapse
#asset_alt_text, #assets, #find_asset, #partial, #series, wrap
Instance Method Details
#locals ⇒ Object
6
7
8
|
# File 'app/view_models/workarea/storefront/content_blocks/product_list_view_model.rb', line 6
def locals
super.merge(products: products)
end
|
#products ⇒ Object
10
11
12
13
14
15
16
|
# File 'app/view_models/workarea/storefront/content_blocks/product_list_view_model.rb', line 10
def products
return [] unless data['products'].present?
@products ||= Catalog::Product
.find_ordered_for_display(data['products'])
.map { |product| ProductViewModel.wrap(product) }
end
|