Unable to replace spree default logo in spree 2.1.3

杀马特。学长 韩版系。学妹 提交于 2019-12-11 20:24:09

问题


Used firebug and inspected Spree default logo is coming from /assets/store/logo.png

Checked in spree 2.1.3 Version Source code and found default logo is coming from /logo section.

path :

core/app/models/spree/app_configuration.rb

preference :logo, :string, default: 'logo/spree_50.png'

Trying to Override, the default logo using Spree:Config option.

Spree::Config.set(logo: "store/logo.png")

But it's still redirecting to the old image(spree_50.png) and I am unable to replace the default logo.


回答1:


In application.rb:

Spree.config do |config|
# Example:
# Uncomment to override the default site name.
# config.site_name = "Spree Demo Site"

config.logo = "logo.png"

end

Then add your logo to public/images/ and the logo will show up.




回答2:


You can place your image at this path.

Inside: app/assets/images/logo/"Your Image"

for eg. app/assets/images/logo/hi5_logo.png**

Inside: config/initializers/spree.rb

Spree.config do |config|
        config.logo = "logo/hi5_logo.png"  #for default store logo
        config.admin_interface_logo = "logo/hi5_logo.png" #for admin logo
    end


来源:https://stackoverflow.com/questions/20323347/unable-to-replace-spree-default-logo-in-spree-2-1-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!