Class: Plugins::Ecommerce::ProductVariationDecorator

Inherits:
Draper::Decorator
  • Object
show all
Defined in:
app/decorators/plugins/ecommerce/product_variation_decorator.rb

Instance Method Summary collapse

Instance Method Details

#get_productObject



15
16
17
# File 'app/decorators/plugins/ecommerce/product_variation_decorator.rb', line 15

def get_product
  @_cache_get_product ||= object.product.decorate
end

#the_priceObject



3
4
5
# File 'app/decorators/plugins/ecommerce/product_variation_decorator.rb', line 3

def the_price
  h.e_parse_price(object.amount)
end

#the_titleObject



7
8
9
# File 'app/decorators/plugins/ecommerce/product_variation_decorator.rb', line 7

def the_title
  get_product.the_variation_title(object.id)
end

#the_weightObject



11
12
13
# File 'app/decorators/plugins/ecommerce/product_variation_decorator.rb', line 11

def the_weight
  "#{h.current_site.current_weight} #{object.weight}"
end