2012-09-21 111 views
4

我正在開發一個使用Spree for India的電子商務應用程序。所以所有的價格都在'Rs',州和地區與印度有關。我在Spree 1.2.0中輕鬆編輯了它們,但我在1.1.3中找不到這些選項。如何在1.1.3Spree更改默認貨幣和國家

回答

15

自定義此您可以在app/config/initializers/spree.rb

Spree.config do |config| 

    # Set country name and currency like this (Note: you will need to 
    # run 'rake db:seed' before this. Change country name in 
    # Spree::Country.find_by_name('Germany') replace Germany to your desired one) 

    config.currency = 'EUR' 
    country = Spree::Country.find_by_name('Germany') 
    config.default_country_id = country.id if country.present? 

    # You can also set following options too. 

    config.site_name = "Todo Store" 
    config.override_actionmailer_config = true 
    config.enable_mail_delivery = true 
end 
+0

真正有用的感謝設置這些選項。有沒有其他可以用這種方式配置的其他東西的列表?我在想你是否顯示「狀態」等。 – dwkns

+0

這導致db:schema:load失敗。如果Spree :: Country.table_exists修復了最後一行,那麼修復它 – Qwertie

+0

注意:它實際上是config/initializers/spree.rb(我試圖改變它,但編輯被拒絕)任何人都可以幫忙嗎? –