Module: TbCommerce::ProductsHelper

Defined in:
app/helpers/tb_commerce/products_helper.rb

Instance Method Summary collapse

Instance Method Details

#price_maximum(product) ⇒ Object



12
13
14
15
# File 'app/helpers/tb_commerce/products_helper.rb', line 12

def price_maximum(product)
	prices = product.product_skus.sort{ |x,y| x.add_price <=> y.add_price }
	number_to_currency(prices.last.price)
end

#price_minimum(product) ⇒ Object



7
8
9
10
# File 'app/helpers/tb_commerce/products_helper.rb', line 7

def price_minimum(product)
	prices = product.product_skus.sort{ |x,y| x.add_price <=> y.add_price }
	number_to_currency(prices.first.price)
end

#price_range(product) ⇒ Object



2
3
4
5
# File 'app/helpers/tb_commerce/products_helper.rb', line 2

def price_range(product)
	prices = product.product_skus.sort{ |x,y| x.add_price <=> y.add_price }
	number_to_currency(prices.first.price) + ' - ' + number_to_currency(prices.last.price)
end