Sha256: 717e66a69dc827869c2dd1cf6b8440322f6d8c5028984b3d762becd80e0af7c3
Contents?: true
Size: 1.04 KB
Versions: 7
Compression:
Stored size: 1.04 KB
Contents
module Spree class ZonedController < BaseController def availLangs(country) Rails.configuration.availableLanguages[country] || [["English", :en]] end def setcountry respond_to do |format| format.js do if params[:order] && params[:order][:bill_address_attributes] && params[:order][:bill_address_attributes][:country_id] i = params[:order][:bill_address_attributes][:country_id].to_i.abs else i = params[:id].to_i.abs end i = -i if (Rails.application.config.commonCountriesForSelect.map { |a| a[1] }).include? -i i = i.to_s session[:zoned] ||= {} c = session[:zoned][:current_country] = i c = c.to_i session[:zoned][:current_language] = (availLangs(c) && availLangs(c)[0][1]) || "en" end end end def setlanguage respond_to do |format| format.js do session[:zoned] ||= {} session[:zoned][:current_language] = params[:lgid] end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems