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

Readme uncertainty (for Solidus\Rails beginners) #63

Open
czepesch opened this issue Jun 20, 2022 · 1 comment
Open

Readme uncertainty (for Solidus\Rails beginners) #63

czepesch opened this issue Jun 20, 2022 · 1 comment

Comments

@czepesch
Copy link

Hi there!
Firstly I apologize if Issues is not right place for that. If so point me a right direction and close this issue.

My problem is, as Rails\Solidus beginner I don't fully understand how to customize this extension.

  1. Set the logo path preference to include your store / company logo. - I placed it in spree.rb (is it right place?), logo now in invoice, but it is huge, covering all page (sizing not working).
  2. Add your own own footer texts to the locale. - is it myapp/config/locales/en.yml? I placed some content there but can't see any changes in invoice
  3. Override any of the partial templates. - how can I do this? I've created /app/views/spree/admin/orders/_header.pdf.prawn and changed fill_color to another color, can't see any changes in the header color.

and so on..
I would be grateful for any hints on how and where to do customization.

@citin
Copy link

citin commented Sep 29, 2022

Hi @czepesch ,

  1. I suggest you to read the prawn's manual to achieve this.
  2. Exactly, here is an example. Remember to add the keys under en: spree:
  3. Yes, I created the file app/views/spree/admin/orders/_footer.pdf.prawn with this content and it worked:
t = make_table([
  [I18n.t('spree.footer_left'), I18n.t('spree.footer_left2'), I18n.t('spree.footer_right'), I18n.t('spree.footer_right2')]
])

# footer
bounding_box [bounds.left, bounds.bottom + 50], :width  => bounds.width do
    font "Helvetica"
    stroke_horizontal_rule
    move_down(5)
    t.draw
end

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

2 participants