Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add locale to cache key

Allows Canada Post to recalculate values when the lang switches (service name and errors are localized)
  • Loading branch information...
commit 6bcf653afcebcbfb9f4143a98450b996263e5913 1 parent be56eae
@jbourassa jbourassa authored j15e committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  app/models/spree/calculator/active_shipping/base.rb
View
2  app/models/spree/calculator/active_shipping/base.rb
@@ -192,7 +192,7 @@ def packages(order)
def cache_key(order)
addr = order.ship_address
line_items_hash = Digest::MD5.hexdigest(order.line_items.map {|li| li.variant_id.to_s + "_" + li.quantity.to_s }.join("|"))
- @cache_key = "#{carrier.name}-#{order.number}-#{addr.country.iso}-#{addr.state ? addr.state.abbr : addr.state_name}-#{addr.city}-#{addr.zipcode}-#{line_items_hash}".gsub(" ","")
+ @cache_key = "#{carrier.name}-#{order.number}-#{addr.country.iso}-#{addr.state ? addr.state.abbr : addr.state_name}-#{addr.city}-#{addr.zipcode}-#{line_items_hash}-#{I18n.locale}".gsub(" ","")
end
end
end

0 comments on commit 6bcf653

Please sign in to comment.
Something went wrong with that request. Please try again.