Sha256: f7ff31bc8235c146455ae7328b1e89405cd00235b80691744c7c6fe2ceb337d8
Contents?: true
Size: 592 Bytes
Versions: 7
Compression:
Stored size: 592 Bytes
Contents
module OrdersHelper def order_price(order, options={}) options.assert_valid_keys(:format_as_currency, :show_vat_text, :show_price_inc_vat) options.reverse_merge! :format_as_currency => true, :show_vat_text => true # overwrite show_vat_text if show_price_inc_vat is false options[:show_vat_text] = Spree::Tax::Config[:show_price_inc_vat] amount = order.item_total amount += Spree::VatCalculator.calculate_tax(order) if Spree::Tax::Config[:show_price_inc_vat] options.delete(:format_as_currency) ? format_price(amount, options) : amount end end
Version data entries
7 entries across 7 versions & 1 rubygems