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
38
attachment: show_order_details_to_customers.diff
(8.0 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
Index: plugins/substruct/app/controllers/customers_controller.rb
===================================================================
--- plugins/substruct/app/controllers/customers_controller.rb (revision 43)
+++ plugins/substruct/app/controllers/customers_controller.rb (working copy)
@@ -117,6 +117,29 @@
)
end
+ # Displays details of a single order
+ def order
+ @order = Order.find(params[:id])
+ order_time = @order.created_on.strftime("%m/%d/%y %I:%M %p")
+ @title = "Order #{@order.order_number} - #{order_time}"
+ @order_user = @order.order_user
+ @order_account = @order_user.order_account
+ @billing_address = @order.billing_address
+ @shipping_address = @order.shipping_address
+ if @shipping_address == @billing_address then
+ @use_separate_shipping_address = false
+ else
+ @use_separate_shipping_address = true
+ end
+ @shipping_address = OrderAddress.new if !@shipping_address
+ logger.info "\n\n SHIPPING ADDRESS:\n #{@shipping_address.inspect}\n"
+ logger.info @use_separate_shipping_address
+
+ # Find all products not included as a order line item already.
+ @products = Item.find(:all,
+ :conditions => [ "id NOT IN(?)", @order.order_line_items.collect {|i| i.item_id}.join(',') ])
+ end
+
# Wishlist items
def wishlist
@title = "Your Wishlist"
Index: plugins/substruct/app/views/customers/order.rhtml
===================================================================
--- plugins/substruct/app/views/customers/order.rhtml (revision 0)
+++ plugins/substruct/app/views/customers/order.rhtml (revision 0)
@@ -0,0 +1,100 @@
+<div id="left">
+ <h1><%=h @title %></h1>
+
+ <div style="color:#999;font-size:1.3em;text-align:center;letter-spacing:0.5em;">THIS ORDER IS CLOSED</div>
+
+ <%= render(:partial => 'user') %>
+
+ <div class="clear"> </div>
+ <div class="line"> </div>
+
+ <h2>Billing Address</h2>
+ <%= render(:partial => 'address', :locals => {:address_type => 'billing'}) %>
+
+ <div class="clear"> </div>
+ <div class="line"> </div>
+
+ <h2>Shipping Address</h2>
+ <%= render(:partial => 'address', :locals => {:address_type => 'shipping'}) %>
+
+ <div class="clear"> </div>
+ <div class="line"> </div>
+
+ <%= render(:partial => 'account') %>
+
+ <div class="clear"> </div>
+ <div class="line"> </div>
+
+ <% if @order.referer %>
+ <br/>
+ <h2>Referer</h2>
+ <div class="padLeft">
+ <p>
+ <%= auto_link(@order.referer) %>
+ </p>
+ </div>
+ <% end %>
+
+ <h2>Ship Via</h2>
+ <div class="padLeft">
+ <%= OrderShippingType.find(@order.order_shipping_type_id).name %>
+ </div>
+
+ <div class="clear"> </div>
+ <div class="line"> </div>
+
+ <h2>Order Items</h2>
+ <table class="list" cellpadding="0" cellspacing="0">
+ <colgroup>
+ <col/>
+ <col style="width:65px;"/>
+ <col style="width:80px;"/>
+ <col style="width:70px;"/>
+ </colgroup>
+ <tr>
+ <th>Item</th>
+ <th>Quantity</th>
+ <th class="numeric">Price Each</th>
+ <th class="numeric">Total</th>
+ </tr>
+ <% if @order.order_line_items.length > 0 then %>
+ <% for item in @order.order_line_items %>
+ <tr class="<%= alternate %>">
+ <td><%= item.name %></td>
+ <td class="numeric"><%= item.quantity %> </td>
+ <td class="numeric">
+ <%= number_to_currency(item.unit_price) %>
+ </td>
+ <td class="numeric">
+ <%= number_to_currency(item.total) %>
+ </td>
+ </tr>
+ <% end %>
+ <% else %>
+ <!--
+ <tr>
+ <td colspan="4">No items are included in this order</td>
+ </tr>
+ -->
+ <% end %>
+ <tr>
+ <td class="borderTop" colspan="3">Shipping & Handling - <%= @order.order_shipping_type.name if @order.order_shipping_type %></td>
+ <td class="borderTop numeric"><%= number_to_currency(@order.shipping_cost) %></td>
+ </tr>
+ <tr class="footer">
+ <td colspan="3" class="numeric">Order Total:</td>
+ <td class="numeric"><%= number_to_currency(@order.total) %></td>
+ </tr>
+ </table>
+
+ <div class="clear"> </div>
+ <div class="line"> </div>
+
+ <%= link_to 'Back To The Order List', :action => 'orders' %>
+</div>
+
+<div id="right">
+ <%= render :partial => 'sidebar' %>
+</div>
+
+<div class="clear"></div>
\ No newline at end of file
Index: plugins/substruct/app/views/customers/_account.rhtml
===================================================================
--- plugins/substruct/app/views/customers/_account.rhtml (revision 0)
+++ plugins/substruct/app/views/customers/_account.rhtml (revision 0)
@@ -0,0 +1,26 @@
+<h2>Payment Information</h2>
+
+<div class="padLeft">
+
+ <div class="floatHalf">
+ <%= make_label('Card Number') %>
+ <div class="padLeft">
+ <%= @order_account.cc_number %>
+ </div>
+ </div>
+
+ <div class="floatHalf">
+ <%= make_label('Expiration Date') %>
+ <div class="padLeft">
+ <div class="float">
+ <%= @order_account.expiration_month %>
+ <p class="info">Month</p>
+ </div>
+ <div class="float">
+ <%= @order_account.expiration_year %>
+ <p class="info">Year</p>
+ </div>
+ </div>
+ </div>
+
+</div>
Index: plugins/substruct/app/views/customers/_user.rhtml
===================================================================
--- plugins/substruct/app/views/customers/_user.rhtml (revision 0)
+++ plugins/substruct/app/views/customers/_user.rhtml (revision 0)
@@ -0,0 +1,8 @@
+<h2>Email Address</h2>
+
+<div class="padLeft">
+ <%= make_label("Your Email Address") %>
+ <div class="padLeft">
+ <%= @order_user.email_address %>
+ </div>
+</div>
Index: plugins/substruct/app/views/customers/orders.rhtml
===================================================================
--- plugins/substruct/app/views/customers/orders.rhtml (revision 43)
+++ plugins/substruct/app/views/customers/orders.rhtml (working copy)
@@ -15,7 +15,7 @@
<% for order in @orders %>
<tr class="<%= alternate() %>">
<td class="numeric">
- <%= order.order_number %>
+ <%= link_to order.order_number, :action => 'order', :id => order.id %>
</td>
<td class="numeric">
<%= order.created_on.strftime("%m/%d/%Y") %>
@@ -39,4 +39,4 @@
<%= render :partial => 'sidebar' %>
</div>
-<div class="clear"></div>
\ No newline at end of file
+<div class="clear"></div>
Index: plugins/substruct/app/views/customers/_address.rhtml
===================================================================
--- plugins/substruct/app/views/customers/_address.rhtml (revision 0)
+++ plugins/substruct/app/views/customers/_address.rhtml (revision 0)
@@ -0,0 +1,67 @@
+<div class="padLeft">
+
+ <div class="floatHalf">
+ <%= make_label('First Name') %>
+ <div class="padLeft">
+ <%= instance_variable_get("@#{address_type}_address").first_name %>
+ </div>
+ </div>
+
+ <div class="floatHalf">
+ <%= make_label('Last Name') %>
+ <div class="padLeft">
+ <%= instance_variable_get("@#{address_type}_address").last_name %>
+ </div>
+ </div>
+
+ <div class="clear"> </div>
+
+ <div class="floatHalf">
+ <%= make_label('Address') %>
+ <div class="padLeft">
+ <%= instance_variable_get("@#{address_type}_address").address %>
+ </div>
+ </div>
+
+ <div class="floatHalf">
+ <%= make_label('City') %>
+ <div class="padLeft">
+ <%= instance_variable_get("@#{address_type}_address").city %>
+ </div>
+ </div>
+
+ <div class="clear"> </div>
+
+ <div class="floatHalf">
+ <%= make_label('State/Prov') %>
+ <div class="padLeft">
+ <%= instance_variable_get("@#{address_type}_address").state %>
+ </div>
+ </div>
+
+ <div class="floatHalf">
+ <%= make_label('Country') %>
+ <div class="padLeft">
+ <%= Country.find(instance_variable_get("@#{address_type}_address").country).name %>
+ </div>
+ </div>
+
+ <div class="clear"> </div>
+
+ <div class="floatHalf">
+ <%= make_label('Postal Code') %>
+ <div class="padLeft">
+ <%= instance_variable_get("@#{address_type}_address").zip %>
+ </div>
+ </div>
+
+ <div class="clear"> </div>
+
+ <div class="floatHalf">
+ <%= make_label('Phone') %>
+ <div class="padLeft">
+ <%= instance_variable_get("@#{address_type}_address").telephone %>
+ </div>
+ </div>
+
+</div>
Powered by
Google Project Hosting