address: Do not use the paypal shipping address to override things
This extension overrides the shipping address with the one supplied by paypal. It is not what we want! Store the paypal address in a dedicated field in case we will ever need it.
This commit is contained in:
parent
a272ee6df7
commit
dec84157ba
|
@ -96,8 +96,10 @@ module Spree
|
||||||
end
|
end
|
||||||
order_ship_address.save!
|
order_ship_address.save!
|
||||||
|
|
||||||
@order.ship_address = order_ship_address
|
@order.sysmocom_paypal_ship_address = order_ship_address
|
||||||
@order.bill_address ||= order_ship_address
|
#No need to replace the EUVAT and others we already have from the shipping address
|
||||||
|
#@order.ship_address = order_ship_address
|
||||||
|
#@order.bill_address ||= order_ship_address
|
||||||
|
|
||||||
#Add Instant Update Shipping
|
#Add Instant Update Shipping
|
||||||
if payment_method.preferred_cart_checkout
|
if payment_method.preferred_cart_checkout
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
Spree::Order.class_eval do
|
||||||
|
belongs_to :sysmocom_paypal_ship_address, :foreign_key => "sysmocom_paypal_ship_address_id", :class_name => "Address"
|
||||||
|
end
|
|
@ -0,0 +1,13 @@
|
||||||
|
class OrderPayPalAddressField < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
change_table :orders do |t|
|
||||||
|
t.integer :paypal_ship_address_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
change_table :orers do |t|
|
||||||
|
t.remove :paypal_ship_address_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,9 @@
|
||||||
|
class RenameSysmocomPayPalShipAddress < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
rename_column :spree_orders, :paypal_ship_address_id, :sysmocom_paypal_ship_address_id
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
rename_column :spree_orders, :sysmocom_paypal_ship_address_id, :paypal_ship_address_id
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue