spree_digital icon indicating copy to clipboard operation
spree_digital copied to clipboard

Confirmation Email issue with Non-digital downloads

Open createthis opened this issue 11 years ago • 3 comments

I apparently received a non-digital order fifteen days ago. I didn't receive a notification email. I finally noticed the deposit come through in my financials. I found the order in the admin section, then I clicked the Resend button. I got this crash:

  Rendered /home/deploy/.rvm/gems/ruby-1.9.3-p327/bundler/gems/spree_digital-d652e96cb1b8/app/views/spree/order_mai
ler/confirm_email.text.erb (14.8ms)
Completed 500 Internal Server Error in 69ms

ActionView::Template::Error (undefined method `variant_options' for #<#<Class:0x000000077eae08>:0x000000078c8208>):
    6: Order Summary
    7: ============================================================
    8: <% for item in @order.line_items %>
    9: <%= item.variant.sku %> <%=item.variant.product.name%> <%= variant_options(item.variant) %> (<%=item.quantit
y%>) @ <%= number_to_currency item.price %> = <%= number_to_currency(item.price * item.quantity) %>
    10: <% end %>
    11: ============================================================
    12: Subtotal: <%= number_to_currency @order.item_total %>
  /home/deploy/.rvm/gems/ruby-1.9.3-p327/bundler/gems/spree_digital-d652e96cb1b8/app/views/spree/order_mailer/confi
rm_email.text.erb:9:in `block in _567af581a32791e407057adc78f90ab7'
  activerecord (3.2.13) lib/active_record/associations/collection_proxy.rb:89:in `each'
  activerecord (3.2.13) lib/active_record/associations/collection_proxy.rb:89:in `method_missing'
  /home/deploy/.rvm/gems/ruby-1.9.3-p327/bundler/gems/spree_digital-d652e96cb1b8/app/views/spree/order_mailer/confi
rm_email.text.erb:8:in `_567af581a32791e407057adc78f90ab7'

I'm pretty tired from work this evening, so I might not look at this until tomorrow. Now that I think about it, I'm not sure if I've ever tested a non-digital sales with spree digital installed. Is it compatible with non digital sales?

createthis avatar Jul 15 '13 23:07 createthis

Also, the user was a guest, if that matters.

createthis avatar Jul 15 '13 23:07 createthis

I finally had some time to look into this, and I fixed it. I assume this is a problem with the version of rails I'm running with spree 1-3-stable. If anyone else runs into this, add this:

Spree::BaseMailer.class_eval do
  add_template_helper(Spree::BaseHelper)
end

to this file (create it):

app/mailers/spree/base_mailer_decorator.rb

createthis avatar May 05 '14 16:05 createthis

@createthis, can this issue be closed now?

jspizziri avatar Apr 21 '15 16:04 jspizziri