Only pass billing address details if they are present.

This commit is contained in:
Jeff Dutil 2012-11-19 07:56:15 -05:00
parent 6b82df21af
commit 63ff2c99bf
1 changed files with 13 additions and 12 deletions

View File

@ -390,18 +390,19 @@ module Spree
# suggest current user's email or any email stored in the order # suggest current user's email or any email stored in the order
opts[:email] = spree_current_user ? spree_current_user.email : order.email opts[:email] = spree_current_user ? spree_current_user.email : order.email
opts[:address_override] = 1 if order.bill_address.present?
opts[:address] = { opts[:address_override] = 1
:name => order.bill_address.full_name, opts[:address] = {
:zip => order.bill_address.zipcode, :name => order.bill_address.full_name,
:address1 => order.bill_address.address1, :zip => order.bill_address.zipcode,
:address2 => order.bill_address.address2, :address1 => order.bill_address.address1,
:city => order.bill_address.city, :address2 => order.bill_address.address2,
:phone => order.bill_address.phone, :city => order.bill_address.city,
:state => order.bill_address.state_text, :phone => order.bill_address.phone,
:country => order.bill_address.country.iso :state => order.bill_address.state_text,
} :country => order.bill_address.country.iso
}
end
opts opts
end end