Sha256: d558ab976b2b35889a25bb1b9283e08fc06ffc6107ba29e1b5363f2d6f7f153a
Contents?: true
Size: 569 Bytes
Versions: 1
Compression:
Stored size: 569 Bytes
Contents
module PiggybakVariantsHelper def variant_cart_form(object) render "piggybak_variants/cart/form", :object => object end def options_for_klass(klass) options = ::PiggybakVariants::OptionConfiguration.find_all_by_klass(klass).collect { |oc| oc.option } end def variant_map(object) map = {} object.variants.available.each do |variant| map[variant.option_values.ordered.map { |ov| ov.id }.join('_')] = { :id => variant.piggybak_sellable.id, :price => number_to_currency(variant.piggybak_sellable.price) } end map.to_json end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
piggybak_variants-0.0.5 | app/helpers/piggybak_variants_helper.rb |