Sha256: b8a997961baaf81f6e6e583e761cd8b10ce72ab1f2eb91ad7f35ce7aec44e417

Contents?: true

Size: 529 Bytes

Versions: 3

Compression:

Stored size: 529 Bytes

Contents

module TbCommerce::ProductsHelper
	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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tb_commerce-0.0.4 app/helpers/tb_commerce/products_helper.rb
tb_commerce-0.0.3 app/helpers/tb_commerce/products_helper.rb
tb_commerce-0.0.2 app/helpers/tb_commerce/products_helper.rb