Module: Workarea::Storefront::OptionSetViewModel
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/view_models/workarea/storefront/option_set_view_model.rb
Overview
Mixed into ProductViewModels for options-selection-based templates.
Instance Method Summary collapse
Instance Method Details
#current_sku ⇒ Object
12 13 14 |
# File 'app/view_models/workarea/storefront/option_set_view_model.rb', line 12 def current_sku [:sku].presence || option_set.current_sku end |
#images ⇒ Object
21 22 23 24 25 26 27 |
# File 'app/view_models/workarea/storefront/option_set_view_model.rb', line 21 def images @images_for_options_set ||= if .any? else images_matching_primary(super.primary) end end |
#pricing ⇒ Object
16 17 18 19 |
# File 'app/view_models/workarea/storefront/option_set_view_model.rb', line 16 def pricing return super unless [:pricing].blank? && option_set.current_sku.present? @pricing ||= Pricing::Collection.new(option_set.current_sku) end |