My favorites
▼
|
Sign in
substruct
Open-source Ruby on Rails E-Commerce
Project Home
Downloads
Wiki
Issues
Source
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
69
attachment: be_able_to_set_variations_weight.patch
(1.7 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Index: /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/views/admin/products/_variation.rhtml
===================================================================
--- /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/views/admin/products/_variation.rhtml (revision 116)
+++ /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/app/views/admin/products/_variation.rhtml (working copy)
@@ -18,6 +18,12 @@
<%= make_label('Quantity') %>
<%= text_field_tag('variation[][quantity]', variation.quantity, :size => 6, :class => 'textInput numeric') %>
</div>
+ <div class="float">
+ <%= make_label('Weight') %>
+ <%= text_field_tag('variation[][weight]', variation.weight, :size => 6, :class => 'textInput numeric') %>
+ <br/>
+ <span class="info">(pounds)</span>
+ </div>
<!-- remove link -->
<div style="float:right;margin-top:20px;">
<%=
Index: /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/test/unit/order_test.rb
===================================================================
--- /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/test/unit/order_test.rb (revision 116)
+++ /home/edmundo/workspace_aptana/trunk/vendor/plugins/substruct/test/unit/order_test.rb (working copy)
@@ -658,11 +658,7 @@
an_order = orders(:santa_next_christmas_order)
calculated_weight = 0
an_order.order_line_items.each do |item|
- if item.product.instance_of?(Variation)
- calculated_weight += item.quantity * item.product.product.weight
- else
- calculated_weight += item.quantity * item.product.weight
- end
+ calculated_weight += item.quantity * item.product.weight
end
assert_equal an_order.weight, calculated_weight
end
Powered by
Google Project Hosting