Sha256: 8bfe331cb2ab5216145eae3e571874ac4208a04255493913449165733f37fd06

Contents?: true

Size: 695 Bytes

Versions: 7

Compression:

Stored size: 695 Bytes

Contents

ProductsHelper.module_eval do
  def variant_price_diff(variant)
    return product_price(variant) unless variant.product.master.price
    diff = product_price(variant, :format_as_currency => false) - product_price(variant.product, :format_as_currency => false)
    return nil if diff == 0
    if diff > 0
      "(+ #{format_price diff.abs})"
    else
      "(- #{format_price diff.abs})"
    end
  end

  def product_description(product)
    raw(product.description)
  end

  def large_sizes
    return @large_sizes if @large_sizes
    match = Image.attachment_definitions[:attachment][:styles][:large].match(/(\d+)x(\d+)/)
    @large_sizes = {:width => match[1], :height => match[2]}
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
synergy_bootstrap_theme-0.0.4 app/helpers/product_helper_decorator.rb
synergy_bootstrap_theme-0.0.3 app/helpers/product_helper_decorator.rb
synergy_bootstrap_theme-0.0.2 app/helpers/product_helper_decorator.rb
synergy_bootstrap_theme-0.0.1 app/helpers/product_helper_decorator.rb
synergy_default_theme-1.0.2 app/helpers/product_helper_decorator.rb
synergy_default_theme-1.0.1 app/helpers/product_helper_decorator.rb
synergy_default_theme-1.0.0 app/helpers/product_helper_decorator.rb