Sha256: da94657c33133e29d95fa4482f6457df5bb378dd362849633bb41abe37c4a287
Contents?: true
Size: 868 Bytes
Versions: 69
Compression:
Stored size: 868 Bytes
Contents
module Spree::ZonePricing::CountriesController def self.included(target) target.class_eval do # Change the currently selected country def set country = Country.find(params[:id]) if request.referer && request.referer.starts_with?("http://" + request.host) session[:return_to] = request.referer end if country # Store country in the session session[:zone_pricing_country] = country.id # Update prices for the current order if session[:order_id] order = Order.find(session[:order_id]) order.update_zone_prices(get_user_country_id) end flash[:notice] = t("country_changed") else flash[:error] = t("country_not_changed") end redirect_back_or_default(root_path) end end end end
Version data entries
69 entries across 69 versions & 1 rubygems