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

Graceful handling of missing shipping or billing address #102

Open
naw opened this issue Nov 27, 2015 · 1 comment
Open

Graceful handling of missing shipping or billing address #102

naw opened this issue Nov 27, 2015 · 1 comment
Labels

Comments

@naw
Copy link

naw commented Nov 27, 2015

My spree installation allows orders without a shipping address (i.e. digital downloaded products).

Therefore, @order.ship_address can be nil, which breaks the PDF template code that prints the shipping address.

You can imagine a similar scenario could manifest itself for a nil billing address (e.g. coupon code for free purchase may not require a billing address).

One simple solution is to detect a nil address in the invoice templates and display a message like "No shipping" (pulled from the locale files perhaps?).

Thoughts?

@tvdeyen
Copy link
Contributor

tvdeyen commented Nov 27, 2015

You can and should override the default pdf templates in your app. They are just examples (and ugly btw).

So, if you're ship address is optional, just adjust your template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants