Created
May 9, 2012 18:01
-
-
Save jumph4x/2647384 to your computer and use it in GitHub Desktop.
Destination Charges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::Shipment.class_eval do | |
after_save :ensure_destination_charge | |
def ensure_correct_adjustment | |
if order.destination_charges[0] | |
# recalculate | |
else | |
order.destination_charges << create a new one | |
end | |
end | |
end | |
Spree::Order.class_eval do | |
has_many :destination_charges | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment