Class: ShoppingCart::OrderDecorator

Inherits:
Drape::Decorator
  • Object
show all
Defined in:
app/decorators/shopping_cart/order_decorator.rb

Instance Method Summary collapse

Instance Method Details

#discountObject



13
14
15
# File 'app/decorators/shopping_cart/order_decorator.rb', line 13

def discount
  h.number_to_percentage(object.coupon.discount, precision: 1)
end

#total_in_currencyObject



5
6
7
# File 'app/decorators/shopping_cart/order_decorator.rb', line 5

def total_in_currency
  h.number_to_currency object.total
end

#total_with_deliveryObject



9
10
11
# File 'app/decorators/shopping_cart/order_decorator.rb', line 9

def total_with_delivery
  h.number_to_currency(object.total + delivery_price)
end