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 69 attachment: weight_for_variation.patch (755 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Index: D:/SOFTWARE/Ruby/substruct/substruct-read-only/plugins/substruct/app/models/order.rb
===================================================================
--- D:/SOFTWARE/Ruby/substruct/substruct-read-only/plugins/substruct/app/models/order.rb (revision 79)
+++ D:/SOFTWARE/Ruby/substruct/substruct-read-only/plugins/substruct/app/models/order.rb (working copy)
@@ -420,7 +420,11 @@
def weight
weight = 0
self.order_line_items.each do |item|
- weight += item.quantity * item.product.weight rescue 0
+ if(item.product.instance_of?(Variation))
+ weight += item.quantity * item.product.product.weight rescue 0
+ else
+ weight += item.quantity * item.product.weight rescue 0
+ end
end
return weight
end
Powered by Google Project Hosting