Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload logo didn't show #67

Closed
chuckyuee opened this issue Mar 15, 2024 · 0 comments
Closed

Upload logo didn't show #67

chuckyuee opened this issue Mar 15, 2024 · 0 comments

Comments

@chuckyuee
Copy link

in app/helpers/spree/frontend_helper.rb line 11-31

    def logo(image_path = nil, options = {})
      logo_attachment = if defined?(Spree::StoreLogo) && current_store.logo.is_a?(Spree::StoreLogo)
                          current_store.logo.attachment # Spree v5
                        else
                          current_store.logo # Spree 4.x
                        end

      image_path ||= if logo_attachment&.attached? && logo_attachment&.variable?
                       main_app.cdn_image_url(logo_attachment.variant(resize_to_limit: [244, 104]))
                     elsif logo_attachment&.attached? && logo_attachment&.image?
                       main_app.cdn_image_url(logo_attachment)
                     else
                       asset_path('logo/spree_50.png')
                     end

      path = spree.respond_to?(:root_path) ? spree.root_path : main_app.root_path

      link_to path, 'aria-label': current_store.name, method: options[:method] do
        image_tag image_path, alt: current_store.name, title: current_store.name
      end
    end

Change blow this line code:

'''
main_app.cdn_image_url(logo_attachment.variant(resize_to_limit: [244, 104])
'''

Rails 7.1.3 it's works.

@chuckyuee chuckyuee closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2024
@chuckyuee chuckyuee reopened this Mar 21, 2024
@chuckyuee chuckyuee closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant