My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 82 attachment: shipping_type_based_on_preferences_home_country.patch (953 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Index: /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/models/order.rb
===================================================================
--- /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/models/order.rb (revision 78)
+++ /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/models/order.rb (working copy)
@@ -438,12 +438,11 @@
# Returns an array of OrderShippingTypes
def get_shipping_prices
prices = []
- # If they're in the USA
+ # Pick the shipping address.
address = self.shipping_address

- # TODO - set this country_id as a preference in the admin UI
- #
- if address.country_id == 1 then
+ # Compare the country with the store home country.
+ if address.country_id == Preference.find_by_name('store_home_country').value.to_i then
shipping_types = OrderShippingType.get_domestic
else
shipping_types = OrderShippingType.get_foreign

Powered by Google Project Hosting