camaleon_ecommerce 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/javascripts/plugins/ecommerce/admin.js +33 -0
  6. data/app/assets/javascripts/plugins/ecommerce/cart.js +207 -0
  7. data/app/assets/javascripts/plugins/ecommerce/fix_form.js +10 -0
  8. data/app/assets/javascripts/plugins/ecommerce/jquery.creditCardValidator.js +208 -0
  9. data/app/assets/stylesheets/plugins/ecommerce/admin.scss +122 -0
  10. data/app/assets/stylesheets/plugins/ecommerce/front.scss +36 -0
  11. data/app/controllers/plugins/ecommerce/admin/coupons_controller.rb +61 -0
  12. data/app/controllers/plugins/ecommerce/admin/orders_controller.rb +96 -0
  13. data/app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb +90 -0
  14. data/app/controllers/plugins/ecommerce/admin/prices_controller.rb +70 -0
  15. data/app/controllers/plugins/ecommerce/admin/settings_controller.rb +22 -0
  16. data/app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb +62 -0
  17. data/app/controllers/plugins/ecommerce/admin/tax_rates_controller.rb +61 -0
  18. data/app/controllers/plugins/ecommerce/admin_controller.rb +20 -0
  19. data/app/controllers/plugins/ecommerce/front/checkout_controller.rb +166 -0
  20. data/app/controllers/plugins/ecommerce/front/orders_controller.rb +255 -0
  21. data/app/controllers/plugins/ecommerce/front_controller.rb +18 -0
  22. data/app/helpers/plugins/ecommerce/ecommerce_email_helper.rb +46 -0
  23. data/app/helpers/plugins/ecommerce/ecommerce_functions_helper.rb +49 -0
  24. data/app/helpers/plugins/ecommerce/ecommerce_helper.rb +240 -0
  25. data/app/helpers/plugins/ecommerce/ecommerce_payment_helper.rb +67 -0
  26. data/app/models/plugins/ecommerce/cart.rb +40 -0
  27. data/app/models/plugins/ecommerce/coupon.rb +25 -0
  28. data/app/models/plugins/ecommerce/coupon_decorator.rb +60 -0
  29. data/app/models/plugins/ecommerce/order.rb +65 -0
  30. data/app/models/plugins/ecommerce/order_decorator.rb +54 -0
  31. data/app/models/plugins/ecommerce/order_detail.rb +13 -0
  32. data/app/models/plugins/ecommerce/payment_method.rb +29 -0
  33. data/app/models/plugins/ecommerce/product.rb +14 -0
  34. data/app/models/plugins/ecommerce/shipping_method.rb +26 -0
  35. data/app/models/plugins/ecommerce/tax_rate.rb +18 -0
  36. data/app/views/camaleon_cms/html_mailer/order_received.html.erb +3 -0
  37. data/app/views/camaleon_cms/html_mailer/order_received_admin.html.erb +3 -0
  38. data/app/views/camaleon_cms/html_mailer/recovery_cart.html.erb +4 -0
  39. data/app/views/layouts/plugins/ecommerce/mailer.html.erb +22 -0
  40. data/app/views/plugins/ecommerce/admin/coupons/form.html.erb +73 -0
  41. data/app/views/plugins/ecommerce/admin/coupons/index.html.erb +50 -0
  42. data/app/views/plugins/ecommerce/admin/index.html.erb +2 -0
  43. data/app/views/plugins/ecommerce/admin/orders/form.html.erb +64 -0
  44. data/app/views/plugins/ecommerce/admin/orders/index.html.erb +90 -0
  45. data/app/views/plugins/ecommerce/admin/orders/show.html.erb +173 -0
  46. data/app/views/plugins/ecommerce/admin/payment_methods/form.html.erb +115 -0
  47. data/app/views/plugins/ecommerce/admin/payment_methods/index.html.erb +43 -0
  48. data/app/views/plugins/ecommerce/admin/payment_methods/show.html.erb +70 -0
  49. data/app/views/plugins/ecommerce/admin/prices/form.html.erb +49 -0
  50. data/app/views/plugins/ecommerce/admin/prices/index.html.erb +39 -0
  51. data/app/views/plugins/ecommerce/admin/prices/show.html.erb +19 -0
  52. data/app/views/plugins/ecommerce/admin/products/index.html.erb +114 -0
  53. data/app/views/plugins/ecommerce/admin/settings/index.html.erb +25 -0
  54. data/app/views/plugins/ecommerce/admin/shipping_methods/form.html.erb +39 -0
  55. data/app/views/plugins/ecommerce/admin/shipping_methods/index.html.erb +41 -0
  56. data/app/views/plugins/ecommerce/admin/shipping_methods/show.html.erb +22 -0
  57. data/app/views/plugins/ecommerce/admin/tax_rates/form.html.erb +36 -0
  58. data/app/views/plugins/ecommerce/admin/tax_rates/index.html.erb +41 -0
  59. data/app/views/plugins/ecommerce/front/_post_list_item.html.erb +18 -0
  60. data/app/views/plugins/ecommerce/front/checkout/cart_index.html.erb +59 -0
  61. data/app/views/plugins/ecommerce/front/checkout/index.html.erb +166 -0
  62. data/app/views/plugins/ecommerce/front/index.html.erb +2 -0
  63. data/app/views/plugins/ecommerce/front/list_products.html.erb +34 -0
  64. data/app/views/plugins/ecommerce/front/orders/index.html.erb +46 -0
  65. data/app/views/plugins/ecommerce/front/orders/pay_by_bank_transfer.html.erb +67 -0
  66. data/app/views/plugins/ecommerce/front/orders/pay_by_credit_card.html.erb +131 -0
  67. data/app/views/plugins/ecommerce/front/orders/pay_by_credit_card_authorize_net.erb +150 -0
  68. data/app/views/plugins/ecommerce/front/orders/select_payment.html.erb +70 -0
  69. data/app/views/plugins/ecommerce/front/orders/show.html.erb +76 -0
  70. data/app/views/plugins/ecommerce/front/product.html.erb +105 -0
  71. data/app/views/plugins/ecommerce/layouts/_ecommerce.html.erb +41 -0
  72. data/app/views/plugins/ecommerce/partials/_form_address.html.erb +84 -0
  73. data/app/views/plugins/ecommerce/partials/_table_order_products.html.erb +85 -0
  74. data/config/camaleon_plugin.json +48 -0
  75. data/config/currency.json +154 -0
  76. data/config/currency_en.json +154 -0
  77. data/config/currency_es.json +154 -0
  78. data/config/custom_models.rb +64 -0
  79. data/config/locales/readme.txt +1 -0
  80. data/config/locales/translation.yml +371 -0
  81. data/config/routes.rb +57 -0
  82. data/lib/camaleon_ecommerce.rb +4 -0
  83. data/lib/ecommerce.rb +4 -0
  84. data/lib/ecommerce/engine.rb +6 -0
  85. data/lib/ecommerce/version.rb +3 -0
  86. data/lib/tasks/ecommerce_tasks.rake +4 -0
  87. metadata +185 -0
@@ -0,0 +1,22 @@
1
+ <div class="panel panel-default">
2
+ <div class="panel-heading">
3
+ <h4><span class="fa fa-taxi"></span> <%= @shipping_method.name %></h4>
4
+ <%= link_to raw("<i class='fa fa-edit'></i> #{t('plugin.ecommerce.edit_shipping_methods')}"), {action: :edit, id: @shipping_method.id}, class: "btn btn-primary pull-right" %>
5
+ </div>
6
+ <div class="panel-body">
7
+ <div class="row">
8
+ <div class="col-md-6">
9
+ <h3><%= t('plugin.ecommerce.info') %></h3>
10
+ <ul class="ec-list-orders-address">
11
+ <li><strong><%= t('plugin.ecommerce.table.name') %>:</strong> <span> <%= @shipping_method.name %></span></li>
12
+ <li><strong><%= t('plugin.ecommerce.table.description') %>:</strong> <span> <%= @shipping_method.description %></span></li>
13
+ </ul>
14
+ </div>
15
+
16
+ </div>
17
+
18
+ </div>
19
+ <div class="panel-footer">
20
+ <a class="btn btn-default" role="back" href="<%= url_for action: :index %>"><%= t('camaleon_cms.admin.button.back')%></a>
21
+ </div>
22
+ </div>
@@ -0,0 +1,36 @@
1
+ <div class="panel panel-default">
2
+ <div class="panel-heading ui-draggable-handle">
3
+ <h4><span class="fa fa-money"></span> <%= @tax_rate.new_record? ? t('plugin.ecommerce.new_tax_rate') : "#{t('plugin.ecommerce.edit_tax_rate')}: #{@tax_rate.name}" %></h4>
4
+ </div>
5
+ <%= form_for @tax_rate, url:{action: @tax_rate.new_record? ? :create : :update}, html: {class: 'validate-tax_rate', id: 'form-tax_rate'} do |f| %>
6
+ <div class="panel-body">
7
+ <%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @tax_rate} %>
8
+ <div class="form-group">
9
+ <%= f.label t('camaleon_cms.admin.table.name') %><br>
10
+ <%= f.text_field :name, :class => "form-control required" %>
11
+ </div>
12
+ <% options = params[:options].present? ? params[:options] : @tax_rate.options rescue {} %>
13
+ <div class="form-group">
14
+ <label for=""><%= t('plugin.ecommerce.table.rate') %></label> (%)<br>
15
+ <%= number_field_tag "options[rate]", options[:rate] || '', :class => "form-control required" %>
16
+ </div>
17
+
18
+
19
+
20
+
21
+ <div class="form-group">
22
+ <label><%= f.check_box :status %> &nbsp; <%= t('plugin.ecommerce.active')%></label>
23
+ </div>
24
+ </div>
25
+ <div class="panel-footer">
26
+ <a class="btn btn-default" href="<%= url_for action: :index %>" role="back"><%= t('camaleon_cms.admin.button.back')%></a>
27
+ <button class="btn btn-primary pull-right" type="submit"><%= t('camaleon_cms.admin.button.submit')%></button>
28
+ </div>
29
+ <% end %>
30
+ </div>
31
+
32
+ <script>
33
+ run.push(function(){
34
+ jQuery( '#form-tax_rate' ).on( "change", '#options_rate', function() {setTimeout(function(){jQuery(this).val(Math.abs(jQuery(this).val()) || 0);}.bind(this), 60)});
35
+ })
36
+ </script>
@@ -0,0 +1,41 @@
1
+ <div class="panel panel-default">
2
+ <div class="panel-heading">
3
+ <h4><span class="fa fa-tag"></span> <%= t('plugin.ecommerce.tax_rates') %></h4>
4
+ <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugin.ecommerce.add_tax_rate')}"), {action: :new}, class: "btn btn-primary pull-right" %>
5
+ </div>
6
+ <div class="panel-body">
7
+
8
+ <table class="table">
9
+ <thead>
10
+ <tr>
11
+ <th id=""><%= t('plugin.ecommerce.table.id') %></th>
12
+ <th id=""><%= t('plugin.ecommerce.table.name') %></th>
13
+ <th id=""><%= t('plugin.ecommerce.table.rate') %></th>
14
+ <th id=""><%= t('plugin.ecommerce.table.status') %></th>
15
+ <th><%= t('plugin.ecommerce.table.actions') %></th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <%
20
+ @tax_rates.each do |row|
21
+ row = row.decorate
22
+ options = row.options
23
+ %>
24
+ <tr>
25
+ <td><%= row.id %></td>
26
+ <td><%= row.name %></td>
27
+ <td><%= options[:rate] %>%</td>
28
+ <td><%= raw row.the_status %></td>
29
+ <td>
30
+ <%= link_to raw('<i class="fa fa-edit"></i>'), {action: :edit, id: row.id }, class: "btn btn-default btn-xs", title: "#{t('camaleon_cms.admin.button.edit')}" %>
31
+ </td>
32
+ </tr>
33
+ <% end %>
34
+
35
+
36
+ </tbody>
37
+ </table>
38
+ <%= content_tag("div", raw(t('camaleon_cms.admin.message.data_found_list')), class: "alert alert-warning") if @tax_rates.empty? %>
39
+ <%= will_paginate @tax_rates, renderer: BootstrapPagination::Rails %>
40
+ </div>
41
+ </div>
@@ -0,0 +1,18 @@
1
+ <div class="col-sm-6 col-md-4 post-list-item">
2
+ <div class="thumbnail">
3
+ <span style="position: absolute; top: 5px; right: 22px"><%= raw post.the_featured_status %></span>
4
+ <%= raw post.the_link_thumb({}, {style: "height: 200px; width: 100%; display: block;"}) %>
5
+ <div class="caption">
6
+ <h4 id="thumbnail-label">
7
+ <a href="<%= post.the_url %>"><%= post.the_title %></a>
8
+ </h4>
9
+ <small>SKU: <%= post.the_sku %></small><br>
10
+ <strong><%= post.the_price %> <span class="pull-right"><%= raw post.the_stock_status %></span></strong><br>
11
+ <hr/>
12
+ <p><%= raw post.the_excerpt %></p>
13
+ </div>
14
+ </div>
15
+
16
+ <%#= debug post.get_field_values_hash %>
17
+ </div>
18
+
@@ -0,0 +1,59 @@
1
+ <%= render layout: 'plugins/ecommerce/layouts/ecommerce', locals: {} do %>
2
+ <h2>Shopping Cart</h2>
3
+ <%= form_tag(plugins_ecommerce_checkout_cart_update_path, :method => "post", :class => "form") do %>
4
+ <table id="table-shopping-cart" class="table">
5
+ <thead>
6
+ <tr>
7
+ <th id="item_col">Item</th>
8
+ <th id="price_col">Price</th>
9
+ <th id="price_col">Tax</th>
10
+ <th id="quantity_col">Quantity</th>
11
+ <th id="subtotal_col">Subtotal</th>
12
+ <th></th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <%
17
+ total = 0
18
+ @products.each do |product|
19
+ product = product.decorate
20
+ product_options = @cart.get_option("product_#{product.id}")
21
+ price = product_options[:price].to_f
22
+ tax = product_options[:tax].to_f
23
+ qty = product_options[:qty].to_f
24
+ sub_total = (price + tax) * qty
25
+ total += sub_total
26
+ %>
27
+ <tr>
28
+ <td><a href="<%= product.the_url %>"><%= product.the_title %></a></td>
29
+ <td data-price="<%= price %>"><%= current_site.current_unit %> <%= price %></td>
30
+ <td data-tax="<%= tax %>"><%= current_site.current_unit %> <%= tax %></td>
31
+ <td data-qty="<%= qty %>">
32
+ <input name="products[][product_id]" type="hidden" value="<%= product.id %>"/>
33
+ <input class="text-qty" type="number" name="products[][qty]" value="<%= qty %>">
34
+ </td>
35
+ <td data-subtotal="<%= sub_total %>"><%= current_site.current_unit %> <%= sub_total.to_f.round(2) %></td>
36
+ <td>
37
+ <a rel="nofollow" data-method="delete" href="<%= plugins_ecommerce_checkout_cart_remove_path(product_id: product.id) %>">Remove</a>
38
+ </td>
39
+ </tr>
40
+ <% end %>
41
+ </tbody>
42
+ <tfoot>
43
+ <tr>
44
+ <td colspan="4"></td>
45
+ <td>Subtotal</td>
46
+ <td id="total" ><%= current_site.current_unit %> <%= total.to_f.round(2) %></td>
47
+ </tr>
48
+ </tfoot>
49
+ </table>
50
+ <% if @products.size > 0 %>
51
+ <div class="text-right">
52
+ <button type="submit" class="btn btn-default"> Update </button>
53
+ <a class="btn btn-info" href="<%= plugins_ecommerce_checkout_path %>"><i class="fa fa-shopping-cart"></i> Proceed to Checkout</a>
54
+ </div>
55
+ <% end %>
56
+
57
+ <% end %>
58
+
59
+ <% end %>
@@ -0,0 +1,166 @@
1
+ <%= render layout: 'plugins/ecommerce/layouts/ecommerce', locals: {} do %>
2
+ <%
3
+ warning = []
4
+ warning << "Not Found Product" if @products.size == 0
5
+
6
+ %>
7
+ <div id="checkout" class="row">
8
+ <h1 class="col-md-12">Checkout</h1>
9
+
10
+ <%= form_tag(plugins_ecommerce_checkout_processing_path, :method => "post", :class => "form form-validate-ec") do %>
11
+
12
+ <div id="user_details" class="col-md-12">
13
+ <h3>User Details</h3>
14
+ <p><strong>Name: </strong> <%= current_user.fullname %></p>
15
+ <input class="form-control" type="hidden" name="order[details][customer]" value="<%= current_user.fullname %>">
16
+ <div class="form-group">
17
+ <label for="">Email</label>
18
+ <input class="form-control required" type="email" name="order[details][email]" id="">
19
+ </div>
20
+ <div class="form-group">
21
+ <label for="">Phone</label>
22
+ <input class="form-control required" type="text" name="order[details][phone]" id="">
23
+ </div>
24
+ </div>
25
+
26
+ <%= render partial: 'plugins/ecommerce/partials/form_address' %>
27
+
28
+ <div class="clearfix"></div>
29
+
30
+ <div id="add_details" class="col-md-6">
31
+ <div id="coupon">
32
+ <h3>Coupon</h3>
33
+ <div id="e_coupon_apply_box" data-href="<%= plugins_ecommerce_res_coupon_path %>" data-token="<%= form_authenticity_token %>">
34
+ <div class="input-group">
35
+ <input type="text" class="form-control coupon-text" >
36
+ <span class="input-group-btn">
37
+ <button class="btn btn-default" type="button">Apply</button>
38
+ </span>
39
+ </div><!-- /input-group -->
40
+ <input type="hidden" name="order[payment][coupon_code]" id="coupon_code" value="">
41
+
42
+ </div>
43
+
44
+
45
+ </div>
46
+ <div id="shipping" data-no-turbolink="">
47
+ <h3>Shipping Option</h3>
48
+
49
+ <div class="form-group">
50
+ <label for="">Shipping method</label>
51
+ <%
52
+ total_weight = 0
53
+ weight_price = 0
54
+ exist_shipping_method = false
55
+ @products.each do |product|
56
+ product_options = @cart.get_option("product_#{product.id}")
57
+ total_weight += product_options[:weight].to_f * product_options[:qty].to_f
58
+ end %>
59
+ <select class="form-control" name="order[payment][shipping_method]" id="shipping_methods" >
60
+ <% current_site.shipping_methods.each do |m|
61
+ price = m.get_price_from_weight(total_weight)
62
+ if price.to_i >= 0
63
+ exist_shipping_method = true
64
+ weight_price = price unless weight_price.to_i > 0
65
+ %>
66
+ <option value="<%= m.id %>" data-price="<%= price %>"><%= m.name %> <%= current_site.current_unit %> <%= price %></option>
67
+ <% end
68
+ end %>
69
+ </select>
70
+ <% warning << "Not Found Shipping Methods by Products" unless exist_shipping_method %>
71
+
72
+ </div>
73
+ </div>
74
+
75
+ <% if warning.present? %>
76
+ <div class="alert alert-danger"><%= raw warning.join("<br>") %></div>
77
+ <% else %>
78
+ <div id="submit" class="text-right">
79
+ <input type="submit" name="commit" value="Create Order" class="btn btn-default">
80
+ </div>
81
+ <% end %>
82
+ </div>
83
+ <div id="totals_section" class="col-md-6">
84
+ <h3>Total</h3>
85
+ <table class="table table-bordered">
86
+ <tbody>
87
+ <tr>
88
+ <th id="quantity_col">Quantity</th>
89
+ <th id="item_col">Item</th>
90
+ <th id="price_col">Price</th>
91
+
92
+ <th id="tax_col">Tax</th>
93
+ <th id="subtotal_col">Subtotal</th>
94
+ </tr>
95
+
96
+ <%
97
+ total = 0
98
+ tax_total = 0
99
+
100
+ @products.each do |product|
101
+ product = product.decorate
102
+ product_options = @cart.get_option("product_#{product.id}")
103
+ price = product_options[:price].to_f
104
+ qty = product_options[:qty].to_f
105
+ tax_product = product_options[:tax].to_f
106
+ tax_total_product = tax_product * qty
107
+ tax_total += tax_total_product
108
+ sub_total = price * qty
109
+ total += sub_total
110
+ %>
111
+ <tr>
112
+ <td><%= qty.to_i %></td>
113
+ <td><%= product.the_title %></td>
114
+ <td><%= current_site.current_unit %> <%= price %></td>
115
+
116
+ <td><%= current_site.current_unit %> <%= tax_product %></td>
117
+ <td><%= current_site.current_unit %> <%= sub_total + tax_total_product %></td>
118
+ </tr>
119
+ <% end
120
+
121
+ %>
122
+
123
+
124
+
125
+ <tr>
126
+ <td colspan="2"></td>
127
+ <td colspan="2" class="text-right">Total (excluding Tax)</td>
128
+ <td id="subtotal_total" data-subtotal="<%= total %>">
129
+ <%= current_site.current_unit %> <%= total %>
130
+ </td>
131
+ </tr>
132
+ <tr >
133
+ <td colspan="2"></td>
134
+ <td colspan="2" class="text-right">Tax</td>
135
+ <td id="tax_total">
136
+ <%= current_site.current_unit %> <%= tax_total %>
137
+ </td>
138
+ </tr>
139
+ <% total += tax_total %>
140
+
141
+ <tr id="coupon_application_row" style="display:none;">
142
+ <td colspan="2"></td>
143
+ <td colspan="2" class="text-right">Discount</td>
144
+ <td class="extra_totals reduce_tax_subtotal" id="coupon_application_total" data-amount="0">
145
+ <span></span>
146
+ </td>
147
+ </tr>
148
+ <tr>
149
+ <td colspan="2"></td>
150
+ <td colspan="2" class="text-right">Shipping</td>
151
+ <td id="shipping_total"><%= current_site.current_unit %> <span><%= weight_price %></span></td>
152
+ </tr>
153
+ <tr>
154
+ <td colspan="2"></td>
155
+ <td colspan="2" class="text-right">Total</td>
156
+ <td id="order_total" data-total="<%= total %>">
157
+ <% total += weight_price %>
158
+ <%= current_site.current_unit %> <span><%= total %></span></td>
159
+ </tr>
160
+ </tbody>
161
+ </table>
162
+
163
+ </div>
164
+ <% end %>
165
+ </div>
166
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <!--<script src="<%#= plugin_asset_path("my_plugin", "js/admin.js") %>"></script>-->
2
+ Plugin ready to use! in frontend.
@@ -0,0 +1,34 @@
1
+ <%= render layout: 'plugins/ecommerce/layouts/ecommerce', locals: {} do %>
2
+
3
+ <article id="post_type-view" class="post_type_<%= @post_type.slug %>" style="position: relative">
4
+ <h1><%= @post_type.the_title %></h1>
5
+
6
+ <div class="content">
7
+ <%= raw @post_type.the_content %>
8
+ </div><br><br>
9
+
10
+ <% if @categories.present? %>
11
+ <div class="panel panel-primary no-line">
12
+ <div class="panel-heading">Categories</div>
13
+ <div class="panel-body">
14
+ <%= render partial: "partials/categories_list", locals: {categories: @categories} %>
15
+ </div>
16
+ </div>
17
+ <% end %>
18
+
19
+ <div class="panel panel-primary post_list no-line">
20
+ <div class="panel-heading">Products</div>
21
+ <div class="panel-body">
22
+ <div class="row">
23
+ <% @posts.each_with_index do |post, index| %>
24
+ <%= raw "<div class='clearfix'></div>" if index%3 == 0 && index > 0 %>
25
+ <%= render partial: 'plugins/ecommerce/front/post_list_item', locals: {post: post.decorate} %>
26
+ <% end %>
27
+ </div>
28
+ <%= content_tag("div", raw(ct('no_contents_found')), class: "alert alert-warning") if @posts.empty? %>
29
+ <%= will_paginate @posts, renderer: BootstrapPagination::Rails if @posts.present? %>
30
+ </div>
31
+ </div>
32
+
33
+ </article>
34
+ <% end %>
@@ -0,0 +1,46 @@
1
+ <%= render layout: 'plugins/ecommerce/layouts/ecommerce', locals: {} do %>
2
+ <h2>Orders</h2>
3
+ <table id="table-shopping-cart" class="table">
4
+ <thead>
5
+ <tr>
6
+ <th id="">ID</th>
7
+ <th id="">Status</th>
8
+ <th id="">Products</th>
9
+ <th id="">Total Amount</th>
10
+ <th id="">Coupon</th>
11
+ <th id="">Pay Amount</th>
12
+ <th id="">Order Time</th>
13
+ <th>Payment Method</th>
14
+ <th style="width: 90px"></th>
15
+ </tr>
16
+ </thead>
17
+ <tbody>
18
+ <%
19
+ @orders.each do |order|
20
+ order = order.decorate
21
+ payment = order.get_meta("payment")
22
+ %>
23
+ <tr>
24
+ <td><%= order.slug %></td>
25
+ <td><%= raw order.the_status %></td>
26
+ <td>
27
+ <% order.get_meta("products").each do |key, product| %>
28
+ <%= product[:qty] %> x <%= product[:product_title] %> (<%= current_site.current_unit %> <%= product[:price] %>) <br>
29
+ <% end %>
30
+ </td>
31
+ <td><%= current_site.current_unit %> <%= payment[:total] %></td>
32
+ <td><%= payment[:coupon] %></td>
33
+ <td><%= current_site.current_unit %> <%= payment[:amount].to_f.round(2) %></td>
34
+ <td><%= order.details.received_at %></td>
35
+ <td><%= order.payment_method.name rescue '' %></td>
36
+ <td>
37
+ <a href="<%= plugins_ecommerce_order_show_path(order: order.slug) %>" class="btn btn-info btn-xs">View</a>
38
+ <% if payment[:amount].to_f > 0 && order.unpaid? %>
39
+ <a href="<%= plugins_ecommerce_order_select_payment_path(order: order.slug) %>" class="btn btn-warning btn-xs">Pay</a>
40
+ <% end %>
41
+ </td>
42
+ </tr>
43
+ <% end %>
44
+ </tbody>
45
+ </table>
46
+ <% end %>
@@ -0,0 +1,67 @@
1
+ <%= render layout: 'plugins/ecommerce/layouts/ecommerce', locals: {} do %>
2
+ <%= form_tag(plugins_ecommerce_order_pay_by_bank_transfer_path(order: @order.slug), :method => "post", :class => "form") do %>
3
+
4
+ <div class="row">
5
+ <h3 class="text-center">Details Ticket Bank Transfer (order: <%= @order.slug %>)</h3>
6
+ <div id="user_details" class="col-md-6 col-md-offset-1">
7
+
8
+
9
+
10
+ <div class="panel panel-default">
11
+ <div class="panel-heading">
12
+ <h3 class="panel-title">Payment Details</h3>
13
+ </div>
14
+ <div class="panel-body">
15
+
16
+ <div class="form-group">
17
+ <label for="">Bank name</label>
18
+ <input class="form-control" type="text" name="details[bank_name]" id="">
19
+ </div>
20
+ <div class="form-group">
21
+ <label for="">Owner name of bank account</label>
22
+ <input class="form-control" type="text" name="details[owner_name]" id="">
23
+ </div>
24
+ <div class="form-group">
25
+ <label for="">CODE / ID / KEY / TICKET</label>
26
+ <input class="form-control" type="text" name="details[code]" id="">
27
+ </div>
28
+ <div class="form-group">
29
+ <label for="">Description</label>
30
+ <textarea name="details[description]" rows="4" class="form-control" ></textarea>
31
+ </div>
32
+
33
+ <div class="row">
34
+ <div class="col-xs-12">
35
+ <button class="btn btn-success btn-lg btn-block" type="submit">Send Information</button>
36
+ </div>
37
+ </div>
38
+ <div class="row" style="display:none;">
39
+ <div class="col-xs-12">
40
+ <p class="payment-errors"></p>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+
46
+
47
+
48
+
49
+
50
+ </div>
51
+ <div class="col-md-4">
52
+ <label for="">Details Bank Transfer</label>
53
+ <div class="well">
54
+ <h4><%= @payment_methods.name %></h4>
55
+ <p><%= @payment_methods.description %></p>
56
+ <ul class="ec-list-orders-address">
57
+ <li><strong>Amount:</strong> <span><%= current_site.current_unit %> <%= @order.get_meta("payment")[:amount] %></span></li>
58
+ <li><strong>Number Account:</strong> <span> <%= @payment_methods.options[:bank_transfer_number_account] %></span></li>
59
+ <li><strong>Details:</strong> <span> <%= @payment_methods.options[:bank_transfer_detail] %></span></li>
60
+ </ul>
61
+ </div>
62
+ </div>
63
+ </div>
64
+
65
+ <% end %>
66
+
67
+ <% end %>