You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But it is failed to return tax_rates! My query in rails console:
order = Spree::Order.first
order.get_tax_zone.tax_rates
It returns an error as like
NoMethodError: undefined method `tax_rates' for #<Spree::Zone::ActiveRecord_Relation:0x007ffc1d98a258>
from /Users/hta-wtag/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-5.0.5/lib/active_record/relation/delegation.rb:124:in `method_missing'
But when I use Spree::Zone.match instead of Spree::Zone.for_address, it returns actual tax_rates of my order.
So, My Question is Why happen this ?
System configuration
Solidus Version: 2.2.1
Extensions in use:
gem 'solidus'
gem 'solidus_auth_devise'
The text was updated successfully, but these errors were encountered:
I think the confusion here is because Spree::Zone.for_address returns a set of matching zones, unlike match which only ever returned a single zone (which is incorrect for a lot of cases). There's no exact direct replacement of match because it's behaviour is wrong.
These changes were made as part of the major tax refactor which went into Solidus 1.3 #989
Hi, I am facing some interesting error while I am removing all deprecation method of solidus.
According to your documentation, I have to use
Spree::Order#tax_address
instead oftax_zone
method.I used it as like:
But it does not match result with
order.tax_zone
.Then I was trying changing
tax_zone
method in myorder_decorator.rb
as like:Since
Spree::Zone.match
is also deprecated methodBut it is failed to return tax_rates! My query in rails console:
It returns an error as like
But when I use
Spree::Zone.match
instead ofSpree::Zone.for_address
, it returns actual tax_rates of my order.So, My Question is Why happen this ?
System configuration
Solidus Version: 2.2.1
Extensions in use:
The text was updated successfully, but these errors were encountered: