Module: Stall::PricesHelper

Defined in:
app/helpers/stall/prices_helper.rb

Instance Method Summary collapse

Instance Method Details

#displayed_price_for_variants(variants) ⇒ Object



3
4
5
6
7
8
9
10
# File 'app/helpers/stall/prices_helper.rb', line 3

def displayed_price_for_variants variants
  if variants.length == 1
    number_to_currency(variants.first.price)
  else
    price = variants.map(&:price).min
    t('stall.products.prices.from', price: number_to_currency(price)) if price
  end
end