Commit aeaed25fe7cd6a43fd35149b8c0b31a6e94576da
1 parent
458deb35
Exists in
master
and in
29 other branches
Displaying product price multiplied by quantity instead of unit price
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
plugins/shopping_cart/lib/shopping_cart_plugin/cart_helper.rb
@@ -7,8 +7,8 @@ module ShoppingCartPlugin::CartHelper | @@ -7,8 +7,8 @@ module ShoppingCartPlugin::CartHelper | ||
7 | product.discount ? product.price_with_discount : product.price | 7 | product.discount ? product.price_with_discount : product.price |
8 | end | 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 | end | 12 | end |
13 | 13 | ||
14 | def get_total(items, environment) | 14 | def get_total(items, environment) |
@@ -42,7 +42,7 @@ module ShoppingCartPlugin::CartHelper | @@ -42,7 +42,7 @@ module ShoppingCartPlugin::CartHelper | ||
42 | content_tag('tr', | 42 | content_tag('tr', |
43 | content_tag('td', product.name) + | 43 | content_tag('td', product.name) + |
44 | content_tag('td', quantity, quantity_opts ) + | 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 | end.join("\n") | 47 | end.join("\n") |
48 | 48 |