Commit aeaed25fe7cd6a43fd35149b8c0b31a6e94576da

Authored by Rodrigo Souto
1 parent 458deb35

Displaying product price multiplied by quantity instead of unit price

plugins/shopping_cart/lib/shopping_cart_plugin/cart_helper.rb
... ... @@ -7,8 +7,8 @@ module ShoppingCartPlugin::CartHelper
7 7 product.discount ? product.price_with_discount : product.price
8 8 end
9 9  
10   - def get_price(product, environment)
11   - float_to_currency_cart(sell_price(product), environment)
  10 + def get_price(product, environment, quantity=1)
  11 + float_to_currency_cart(sell_price(product)*quantity, environment)
12 12 end
13 13  
14 14 def get_total(items, environment)
... ... @@ -42,7 +42,7 @@ module ShoppingCartPlugin::CartHelper
42 42 content_tag('tr',
43 43 content_tag('td', product.name) +
44 44 content_tag('td', quantity, quantity_opts ) +
45   - content_tag('td', get_price(product, environment), price_opts )
  45 + content_tag('td', get_price(product, environment, quantity), price_opts )
46 46 )
47 47 end.join("\n")
48 48  
... ...