app/views/plugins/ecommerce/front/orders/index.html.erb in camaleon_ecommerce-0.0.4 vs app/views/plugins/ecommerce/front/orders/index.html.erb in camaleon_ecommerce-1.1

- old
+ new

@@ -1,46 +1,38 @@ -<%= render layout: 'plugins/ecommerce/layouts/ecommerce', locals: {} do %> -<h2>Orders</h2> - <table id="table-shopping-cart" class="table"> - <thead> +<%= render plugin_view('partials/cart_widget') %> +<h2><%= t('.title', default: 'My Orders') %></h2> +<table id="table-shopping-cart" class="table"> + <thead> + <tr> + <th><%= t('.id', default: 'ID') %></th> + <th><%= t('.status', default: 'Status') %></th> + <th><%= t('.products', default: 'Products') %></th> + <th><%= t('.total_amount', default: 'Total Amount') %></th> + <th><%= t('.coupon', default: 'Coupon') %></th> + <th><%= t('.paid_amount', default: 'Paid Amount') %></th> + <th><%= t('.order_date', default: 'Order Date') %></th> + <th><%= t('.method', default: 'Payment Method') %></th> + <th style="width: 90px"></th> + </tr> + </thead> + <tbody> + <% @orders.each do |order| %> <tr> - <th id="">ID</th> - <th id="">Status</th> - <th id="">Products</th> - <th id="">Total Amount</th> - <th id="">Coupon</th> - <th id="">Pay Amount</th> - <th id="">Order Time</th> - <th>Payment Method</th> - <th style="width: 90px"></th> + <td><%= order.slug %></td> + <td><%= raw order.the_status %></td> + <td> + <% order.product_items.each do |item| %> + <%= item.qty %> x <%= item.cache_the_title %> (<%= item.cache_the_price %>) <br> + <% end %> + </td> + <td><%= order.cache_the_sub_total %></td> + <td><%= order.cache_the_discounts %></td> + <td><%= order.cache_the_total %></td> + <td><%= order.paid_at %></td> + <td><%= order.payment_method.name rescue '' %></td> + <td> + <a href="<%= plugins_ecommerce_order_show_path(order: order.slug) %>" class="btn btn-default btn-xs"><%= t('.view', default: 'View') %></a> + </td> </tr> - </thead> - <tbody> - <% - @orders.each do |order| - order = order.decorate - payment = order.get_meta("payment") - %> - <tr> - <td><%= order.slug %></td> - <td><%= raw order.the_status %></td> - <td> - <% order.get_meta("products").each do |key, product| %> - <%= product[:qty] %> x <%= product[:product_title] %> (<%= current_site.current_unit %> <%= product[:price] %>) <br> - <% end %> - </td> - <td><%= current_site.current_unit %> <%= payment[:total] %></td> - <td><%= payment[:coupon] %></td> - <td><%= current_site.current_unit %> <%= payment[:amount].to_f.round(2) %></td> - <td><%= order.details.received_at %></td> - <td><%= order.payment_method.name rescue '' %></td> - <td> - <a href="<%= plugins_ecommerce_order_show_path(order: order.slug) %>" class="btn btn-info btn-xs">View</a> - <% if payment[:amount].to_f > 0 && order.unpaid? %> - <a href="<%= plugins_ecommerce_order_select_payment_path(order: order.slug) %>" class="btn btn-warning btn-xs">Pay</a> - <% end %> - </td> - </tr> - <% end %> - </tbody> - </table> -<% end %> + <% end %> + </tbody> +</table>