Hi Juliano,

Fixing my last post:

In spree-1-3/spree/core/lib/spree/money.rb

require 'money'

module Spree
class Money
attr_reader :money

def initialize(amount, options={})
@money = ::Money.parse([amount, (options[:currency] ||
Spree::Config[:currency])].join)
@options = {}
@options[:with_currency] = true if Spree::Config[:display_currency]
@options[:symbol_position] =
Spree::Config[:currency_symbol_position].to_sym
@options[:no_cents] = true if Spree::Config[:hide_cents]
# I18n.t([:'number.currency.format.separator',
:'number.currency.format.delimiter'])

separator, delimiter = I18n.t([:'number.currency.format.separator',
:'number.currency.format.delimiter'])
@options[:separator] = separator
@options[:delimiter] = delimiter

@options.merge!(options)
# Must be a symbol because the Money gem doesn't do the conversion
@options[:symbol_position] = @options[:symbol_position].to_sym

end

def to_s
@money.format(@options)
end

def ==(obj)
@money == obj.money
end
end
end




Em quinta-feira, 28 de fevereiro de 2013 11h54min37s UTC-3, Juliano Garcia
escreveu:
bom dia, podemos conversar a respeito deste problema? estou passando pelo
mesmo problema, coloque este código dentro de config\spree_money.rb, mas
continuo tendo o mesmo erro!!!

Em domingo, 24 de fevereiro de 2013 14h12min44s UTC-3, Giulliano Bueno
escreveu:
Hi everyone,


I had an issue with BRL currency in this version and solved it changing
Spree::Money initialize method as follow. If it is not the best way to do
it, please let me know. Thanks!

require 'money'

module Spree
class Money
attr_reader :money

def initialize(amount, options={})
@money = ::Money.parse([amount, (options[:currency] ||
Spree::Config[:currency])].join)
@options = {}
@options[:with_currency] = true if Spree::Config[:display_currency]
@options[:symbol_position] =
Spree::Config[:currency_symbol_position].to_sym
@options[:no_cents] = true if Spree::Config[:hide_cents]
# I18n.t([:'number.currency.format.separator',
:'number.currency.format.delimiter'])

# new code
@options[:separator] = I18n.t([:'number.currency.format.separator'])
@options[:delimiter] = I18n.t([:'number.currency.format.delimiter'])
#end new code

@options.merge!(options)
# Must be a symbol because the Money gem doesn't do the conversion
@options[:symbol_position] = @options[:symbol_position].to_sym

end

def to_s
@money.format(@options)
end

def ==(obj)
@money == obj.money
end
end
end
--
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedFeb 24, '13 at 5:12p
activeFeb 28, '13 at 3:33p
posts3
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Giulliano Bueno: 2 posts Juliano Garcia: 1 post

People

Translate

site design / logo © 2022 Grokbase