camaleon_ecommerce 0.0.4 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/plugins/ecommerce/admin.js +0 -33
  3. data/app/assets/javascripts/plugins/ecommerce/cart.js +83 -200
  4. data/app/assets/javascripts/plugins/ecommerce/fix_form.js +1 -4
  5. data/app/assets/stylesheets/plugins/ecommerce/checkout.css.scss +46 -0
  6. data/app/assets/stylesheets/plugins/ecommerce/front.scss +2 -30
  7. data/app/controllers/plugins/ecommerce/admin/coupons_controller.rb +2 -2
  8. data/app/controllers/plugins/ecommerce/admin/orders_controller.rb +45 -34
  9. data/app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb +4 -3
  10. data/app/controllers/plugins/ecommerce/admin/prices_controller.rb +5 -5
  11. data/app/controllers/plugins/ecommerce/admin/settings_controller.rb +0 -2
  12. data/app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb +3 -3
  13. data/app/controllers/plugins/ecommerce/admin/tax_rates_controller.rb +2 -2
  14. data/app/controllers/plugins/ecommerce/admin_controller.rb +1 -1
  15. data/app/controllers/plugins/ecommerce/front/checkout_controller.rb +162 -110
  16. data/app/controllers/plugins/ecommerce/front/orders_controller.rb +7 -234
  17. data/app/controllers/plugins/ecommerce/front_controller.rb +42 -3
  18. data/app/decorators/plugins/ecommerce/cart_decorator.rb +27 -0
  19. data/app/{models → decorators}/plugins/ecommerce/coupon_decorator.rb +1 -1
  20. data/app/decorators/plugins/ecommerce/order_decorator.rb +22 -0
  21. data/app/decorators/plugins/ecommerce/product_decorator.rb +88 -0
  22. data/app/decorators/plugins/ecommerce/product_item_decorator.rb +18 -0
  23. data/app/helpers/plugins/ecommerce/ecommerce_email_helper.rb +91 -28
  24. data/app/helpers/plugins/ecommerce/ecommerce_helper.rb +30 -136
  25. data/app/helpers/plugins/ecommerce/ecommerce_payment_helper.rb +14 -20
  26. data/app/models/plugins/ecommerce/cart.rb +139 -15
  27. data/app/models/plugins/ecommerce/coupon.rb +33 -7
  28. data/app/models/plugins/ecommerce/order.rb +47 -31
  29. data/app/models/plugins/ecommerce/{product.rb → product_item.rb} +11 -5
  30. data/app/views/camaleon_cms/html_mailer/order_canceled.html.erb +2 -0
  31. data/app/views/camaleon_cms/html_mailer/order_confirmed.html.erb +2 -0
  32. data/app/views/camaleon_cms/html_mailer/order_received_admin.html.erb +1 -1
  33. data/app/views/camaleon_cms/html_mailer/order_shipped.html.erb +2 -0
  34. data/app/views/plugins/ecommerce/admin/coupons/form.html.erb +10 -10
  35. data/app/views/plugins/ecommerce/admin/coupons/index.html.erb +1 -1
  36. data/app/views/plugins/ecommerce/admin/orders/form.html.erb +5 -49
  37. data/app/views/plugins/ecommerce/admin/orders/index.html.erb +140 -80
  38. data/app/views/plugins/ecommerce/admin/orders/show.html.erb +7 -169
  39. data/app/views/plugins/ecommerce/admin/payment_methods/form.html.erb +30 -3
  40. data/app/views/plugins/ecommerce/admin/payment_methods/index.html.erb +1 -3
  41. data/app/views/plugins/ecommerce/admin/prices/index.html.erb +0 -2
  42. data/app/views/plugins/ecommerce/admin/prices/show.html.erb +0 -2
  43. data/app/views/plugins/ecommerce/admin/products/index.html.erb +1 -1
  44. data/app/views/plugins/ecommerce/admin/settings/index.html.erb +0 -1
  45. data/app/views/plugins/ecommerce/admin/tax_rates/form.html.erb +1 -1
  46. data/app/views/plugins/ecommerce/front/checkout/cart_index.html.erb +46 -57
  47. data/app/views/plugins/ecommerce/front/checkout/index.html.erb +34 -158
  48. data/app/views/plugins/ecommerce/front/login.html.erb +67 -0
  49. data/app/views/plugins/ecommerce/front/orders/index.html.erb +36 -44
  50. data/app/views/plugins/ecommerce/front/orders/show.html.erb +121 -67
  51. data/app/views/plugins/ecommerce/partials/_cart_widget.html.erb +38 -0
  52. data/app/views/plugins/ecommerce/partials/checkout/_details.html.erb +35 -0
  53. data/app/views/plugins/ecommerce/partials/checkout/_payments.html.erb +123 -0
  54. data/app/views/plugins/ecommerce/partials/checkout/_products_detail.html.erb +49 -0
  55. data/app/views/plugins/ecommerce/partials/checkout/_user_info.html.erb +93 -0
  56. data/app/views/post_types/commerce.html.erb +22 -0
  57. data/app/views/post_types/commerce/_product_widget.html.erb +13 -0
  58. data/app/views/post_types/commerce/category.html.erb +23 -0
  59. data/app/views/post_types/commerce/single.html.erb +91 -0
  60. data/config/custom_models.rb +24 -57
  61. data/config/locales/en.yml +192 -0
  62. data/config/locales/es.yml +405 -0
  63. data/config/routes.rb +26 -16
  64. data/db/migrate/20160502221327_add_cama_ecommerce_structure_plugin.rb +12 -0
  65. data/db/migrate/20160504162311_move_featured_attribute_of_products.rb +15 -0
  66. data/db/migrate/20160527184747_add_new_cart_structure.rb +21 -0
  67. data/lib/ecommerce/version.rb +1 -1
  68. metadata +42 -19
  69. data/app/models/plugins/ecommerce/order_decorator.rb +0 -54
  70. data/app/views/layouts/plugins/ecommerce/mailer.html.erb +0 -22
  71. data/app/views/plugins/ecommerce/admin/index.html.erb +0 -2
  72. data/app/views/plugins/ecommerce/front/_post_list_item.html.erb +0 -18
  73. data/app/views/plugins/ecommerce/front/index.html.erb +0 -2
  74. data/app/views/plugins/ecommerce/front/list_products.html.erb +0 -34
  75. data/app/views/plugins/ecommerce/front/orders/pay_by_bank_transfer.html.erb +0 -67
  76. data/app/views/plugins/ecommerce/front/orders/pay_by_credit_card.html.erb +0 -131
  77. data/app/views/plugins/ecommerce/front/orders/pay_by_credit_card_authorize_net.erb +0 -150
  78. data/app/views/plugins/ecommerce/front/orders/select_payment.html.erb +0 -70
  79. data/app/views/plugins/ecommerce/front/product.html.erb +0 -105
  80. data/app/views/plugins/ecommerce/layouts/_ecommerce.html.erb +0 -41
  81. data/app/views/plugins/ecommerce/partials/_form_address.html.erb +0 -84
  82. data/app/views/plugins/ecommerce/partials/_table_order_products.html.erb +0 -85
  83. data/config/locales/translation.yml +0 -371
@@ -1,76 +1,130 @@
1
- <%= render layout: 'plugins/ecommerce/layouts/ecommerce', locals: {} do %>
2
- <div class="row">
3
- <div class="col-md-4">
4
- <h4>Order: <%= @order.slug %></h4>
5
- <h4>Customer Info</h4>
6
- <ul class="ec-list-orders-address">
7
- <li><strong>Name:</strong> <span> <%= @order.details.customer %></span></li>
8
- <li><strong>Email:</strong> <span> <%= @order.details.email %></span></li>
9
- <li><strong>Phone:</strong> <span> <%= @order.details.phone %></span></li>
10
- </ul>
1
+ <% order ||= @order %>
2
+ <div class="order_details">
3
+ <% unless defined?(as_partial) %>
4
+ <h1><%= t('.title', default: 'Order Details') %>: <%= order.slug %></h1>
5
+ <% end %>
6
+ <div class="row">
7
+ <div class="col-md-6">
8
+ <h4><%= t('.customer_info', default: 'Customer Info') %></h4>
9
+ <ul class="ec-list-orders-address">
10
+ <li><strong><%= t('.name', default: 'Name') %>:</strong> <span> <%= order.user.fullname %></span></li>
11
+ <li><strong><%= t('.email', default: 'Email') %>:</strong> <span> <%= order.user.email %></span></li>
12
+ <li><strong><%= t('.phone', default: 'Phone') %>:</strong> <span> <%= order.user.get_option('phone') %></span></li>
13
+ </ul>
11
14
 
12
- <h4>billing address</h4>
13
- <% detail = @order.get_meta("billing_address") %>
14
- <ul class="ec-list-orders-address">
15
- <li><strong>Name:</strong> <span><%= detail[:first_name] %> <%= detail[:last_name] %></span></li>
16
- <li><strong>Address:</strong> <span><%= detail[:address1] %> <br/> <%= detail[:address2] %> <br/> <%= detail[:city] %> <br/> <%= detail[:state] %> <br/> <%= detail[:zip] %> <br/> <%= detail[:country] %></span></li>
17
- </ul>
18
-
19
- <h4>shipping address</h4>
20
- <% detail = @order.get_meta("shipping_address") %>
21
- <ul class="ec-list-orders-address">
22
- <li><strong>Name:</strong> <span><%= detail[:first_name] %> <%= detail[:last_name] %></span></li>
23
- <li><strong>Address:</strong> <span><%= detail[:address1] %> <br/> <%= detail[:address2] %> <br/> <%= detail[:city] %> <br/> <%= detail[:state] %> <br/> <%= detail[:zip] %> <br/> <%= detail[:country] %></span></li>
24
- </ul>
15
+ <h4><%= t('.billing_address', default: 'Billing Address') %></h4>
16
+ <% detail = order.get_meta("billing_address", {}) %>
17
+ <ul class="ec-list-orders-address">
18
+ <li><strong><%= t('.address', default: 'Address1') %>:</strong> <%= detail[:address1] %></li>
19
+ <li><strong><%= t('.address', default: 'Address') %>2:</strong> <%= detail[:address2] %></li>
20
+ <li><strong><%= t('.city', default: 'City') %>:</strong> <%= detail[:city] %></li>
21
+ <li><strong><%= t('.state', default: 'State') %>:</strong> <%= detail[:state] %></li>
22
+ <li><strong><%= t('.zip_code', default: 'Zip code') %>:</strong> <%= detail[:zip] %></li>
23
+ <li><strong><%= t('.country', default: 'Country') %>:</strong> <%= detail[:country] %></li>
24
+ </ul>
25
+ </div>
26
+ <div class="col-md-6">
27
+ <h4><%= t('.shipping_address', default: 'Shipping Address') %></h4>
28
+ <% detail = order.get_meta("shipping_address", {}) %>
29
+ <ul class="ec-list-orders-address">
30
+ <li><strong><%= t('.address', default: 'Address1') %>:</strong> <%= detail[:address1] %></li>
31
+ <li><strong><%= t('.address', default: 'Address') %>2:</strong> <%= detail[:address2] %></li>
32
+ <li><strong><%= t('.city', default: 'City') %>:</strong> <%= detail[:city] %></li>
33
+ <li><strong><%= t('.state', default: 'State') %>:</strong> <%= detail[:state] %></li>
34
+ <li><strong><%= t('.zip_code', default: 'Zip code') %>:</strong> <%= detail[:zip] %></li>
35
+ <li><strong><%= t('.country', default: 'Country') %>:</strong> <%= detail[:country] %></li>
36
+ </ul>
37
+ </div>
25
38
  </div>
26
- <div class="col-md-8">
27
- <h4>Products and Payments</h4>
28
- <%= render partial: 'plugins/ecommerce/partials/table_order_products', locals: {order: @order} %>
29
-
30
-
31
- <table class="table table-bordered">
32
- <tbody>
33
- <tr>
34
- <th id="">Type Payment</th>
35
- <th id=""></th>
36
- </tr>
37
-
38
- <tr>
39
- <td><%= @order.payment_method.name rescue 'Not Payment' %></td>
40
- <td><% if @order.get_meta("payment")[:amount].to_f > 0 && @order.unpaid? %>
41
- <a href="<%= plugins_ecommerce_order_select_payment_path(order: @order.slug) %>" class="btn btn-warning">Pay Now</a> or
42
- <a href="<%= plugins_ecommerce_order_select_payment_path(order: @order.slug, cancel: true) %>" class="btn btn-default btn-sm">Cancel Order</a>
43
- <% else %>
44
- <%= raw @order.the_pay_status %>
45
- <% end %>
46
- </td>
47
- </tr>
48
39
 
49
- </tbody>
50
- </table>
40
+ <div class="row">
41
+ <div class="col-md-12">
42
+ <h4><%= t('.title_products', default: 'Products and Payments') %></h4>
43
+ <div id="totals_section">
44
+ <table class="table table-bordered">
45
+ <tbody>
46
+ <tr>
47
+ <th id="quantity_col"><%= t('.qty', default: 'Quantity') %></th>
48
+ <th id="item_col"><%= t('.item', default: 'Item') %></th>
49
+ <th id="price_col"><%= t('.price', default: 'Price') %></th>
51
50
 
52
- <table class="table table-bordered">
53
- <tbody>
54
- <tr>
55
- <th id="">Order Shipped</th>
56
- <th id="">Shipped Date</th>
57
- <th id="">URL Tracking</th>
58
- </tr>
59
-
60
- <tr>
61
- <td><%= @order.shipping_method.name rescue 'Not Shipped Assigned' %></td>
62
- <td> <%= @order.details.shipped_at || 'Not Shipped' %> </td>
63
- <td> <%= @order.the_url_tracking %> </td>
64
- </tr>
65
- </tbody>
66
- </table>
67
-
68
- <div class="text-center">
51
+ <th id="tax_col"><%= t('.tax', default: 'Tax') %></th>
52
+ <th id="subtotal_col"><%= t('.subtotal', default: 'Sub Total') %></th>
53
+ </tr>
54
+ <% order.product_items.each do |item| %>
55
+ <tr>
56
+ <td><%= item.qty %></td>
57
+ <td><%= item.cache_the_title %></td>
58
+ <td><%= item.cache_the_price %></td>
59
+ <td><%= item.cache_the_tax %></td>
60
+ <td><%= item.cache_the_sub_total %></td>
61
+ </tr>
62
+ <% end %>
63
+ <tr>
64
+ <td colspan="2"></td>
65
+ <td colspan="2" class="text-right"><%= t('.total_excl', default: 'Total (excluding Tax)') %> </td>
66
+ <td><%= order.cache_the_sub_total %></td>
67
+ </tr>
68
+ <tr>
69
+ <td colspan="2"></td>
70
+ <td colspan="2" class="text-right"><%= t('.tax', default: 'Tax') %></td>
71
+ <td id="tax_total"><%= order.cache_the_tax %></td>
72
+ </tr>
73
+ <tr>
74
+ <td colspan="2"></td>
75
+ <td colspan="2" class="text-right"><%= t('.discount', default: 'Discount') %></td>
76
+ <td><%= order.cache_the_discounts %></td>
77
+ </tr>
78
+ <tr>
79
+ <td colspan="2"></td>
80
+ <td colspan="2" class="text-right"><%= t('.total_shipping', default: 'Total shipping') %></td>
81
+ <td><%= order.cache_the_shipping %></td>
82
+ </tr>
83
+ <tr>
84
+ <td colspan="2"></td>
85
+ <td colspan="2" class="text-right"><%= t('.total_price', default: 'Total Price') %></td>
86
+ <td><%= order.cache_the_total %></td>
87
+ </tr>
88
+ </tbody>
89
+ </table>
90
+ </div>
69
91
 
92
+ <table class="table table-bordered">
93
+ <tbody>
94
+ <tr>
95
+ <th><%= t('.payment_type', default: 'Type Payment') %></th>
96
+ <th></th>
97
+ </tr>
98
+ <tr>
99
+ <td><%= order.payment_method.name rescue 'Not Payment' %></td>
100
+ <td><%= raw order.the_status %></td>
101
+ </tr>
102
+ <% if defined?(as_partial) %>
103
+ <tr>
104
+ <td>
105
+ <%= raw order.get_meta('payment_data', {}).map{|k, v| "<b>#{k.to_s.titleize}</b>: #{v}" }.join('<br>') %>
106
+ </td>
107
+ </tr>
108
+ <% end %>
109
+ </tbody>
110
+ </table>
70
111
 
112
+ <table class="table table-bordered">
113
+ <tbody>
114
+ <tr>
115
+ <th><%= t('.shipping_method', default: 'Shipping Method') %></th>
116
+ <th><%= t('.date_shipped', default: 'Shipped Date') %></th>
117
+ <th><%= t('.track_url', default: 'URL Tracking') %></th>
118
+ </tr>
119
+ <tr>
120
+ <td><%= order.shipping_method.name rescue t('.no_shipping', default: 'Not Shipped Assigned') %></td>
121
+ <td><%= order.shipped_at.presence || t('.no_shipped', default: 'Not Shipped') %></td>
122
+ <td><%= order.the_url_tracking %></td>
123
+ </tr>
124
+ </tbody>
125
+ </table>
126
+ <div class="text-center">
127
+ </div>
71
128
  </div>
72
129
  </div>
73
130
  </div>
74
-
75
- <%#= debug @order.meta %>
76
- <% end %>
@@ -0,0 +1,38 @@
1
+ <div class="row" style="min-height: 64px">
2
+ <div class="col-md-9">
3
+ <ol class="breadcrumb" style="margin: 0;">
4
+ <% @ecommerce_bredcrumb.each_with_index do |m, index| %>
5
+ <% if m[1].present? %>
6
+ <li class="<%= "active" if @ecommerce_bredcrumb.size == index+1 %>">
7
+ <a href="<%= m[1] %>"><%= m[0] %></a></li>
8
+ <% else %>
9
+ <li class="<%= "active" if @ecommerce_bredcrumb.size == index+1 %>"><span><%= m[0] %></span></li>
10
+ <% end %>
11
+ <% end %>
12
+ </ol>
13
+ </div>
14
+
15
+ <div class="col-md-3">
16
+ <% if signin? %>
17
+ <div class="well shopping_cart_box">
18
+ <% @cart ||= current_site.carts.set_user(current_user).first_or_create(name: "Cart by #{current_user.id}").decorate %>
19
+ <h4><%= t('.shopping_cart', default: 'Shopping Cart') %></h4>
20
+ <p><%= t('.total_items', default: '(%{qty}) items', qty: @cart.items_total) %>, <%= t('.total', default: 'Total') %>: <%= @cart.the_total_amount %></p>
21
+ <span>
22
+ <a href="<%= @ecommerce_post_type.the_url %>" class="btn btn-default btn-xs"><%= t('.products_list', default: 'Products list') %></a>
23
+ <% if (@cart.items_total > 0) %>
24
+ <a href="<%= plugins_ecommerce_checkout_cart_path %>" class="btn btn-warning btn-xs"><%= t('.purchase', default: 'Purchase') %></a>
25
+ <% end %>
26
+ <a href="<%= plugins_ecommerce_orders_path %>" class="btn btn-success btn-xs"><%= t('.my_orders', default: 'My Orders') %></a>
27
+ </span>
28
+ </div>
29
+ <% else %>
30
+ <div class=" text-right">
31
+ <a href="<%= @ecommerce_post_type.the_url %>" class="btn btn-default"><%= t('.products_list', default: 'Products list') %></a>
32
+ </div>
33
+ <% end %>
34
+ </div>
35
+ </div>
36
+ <div class="clearfix">
37
+ <%= render partial: "/camaleon_cms/flash_messages.html.erb" %>
38
+ </div>
@@ -0,0 +1,35 @@
1
+ <div id="add_details" class="row">
2
+ <div id="coupon" class="col-md-6">
3
+ <% unless @cart.coupon.present? %>
4
+ <h3><%= t('.coupon', default: 'Discount Coupon') %></h3>
5
+ <div id="e_coupon_apply_box" data-href="<%= plugins_ecommerce_res_coupon_path %>" data-token="<%= form_authenticity_token %>">
6
+ <div class="input-group">
7
+ <input type="text" class="form-control coupon-text" autocomplete="off" placeholder="<%= t('.coupon_msg', default: 'Enter your code here') %>" >
8
+ <span class="input-group-btn"><button class="btn btn-default" type="button"><%= t('.apply', default: 'Apply') %></button></span>
9
+ <span class="input-group-addon hidden"><i class='glyphicon glyphicon-ok'></i></span>
10
+ </div><!-- /input-group -->
11
+ <input type="hidden" name="order[payment][coupon_code]" id="coupon_code" value="">
12
+ </div>
13
+ <% end %>
14
+ </div>
15
+ <div class="col-md-6">
16
+ <% if current_site.shipping_methods.any? %>
17
+ <div id="shipping" data-no-turbolink="">
18
+ <h3><%= t('.shipping_options', default: 'Shipping Options') %></h3>
19
+ <div class="form-group">
20
+ <select class="form-control required" name="shipping_method" id="shipping_methods" >
21
+ <% current_site.shipping_methods.each do |m| price = m.get_price_from_weight(@cart.weight_total); the_price = "#{current_site.current_unit}#{price}" %>
22
+ <option value="<%= m.id %>" <%= 'selected' if @cart.shipping_method_id == m.id %> data-price="<%= price %>"><%= m.name %> (<%= the_price %>)</option>
23
+ <% end %>
24
+ </select>
25
+ </div>
26
+ </div>
27
+ <% end %>
28
+ </div>
29
+ </div>
30
+ <div id="product_details">
31
+ <%= render plugin_view('partials/checkout/products_detail') %>
32
+ </div>
33
+ <div class="text-right">
34
+ <button type="submit" class="btn btn-primary">Next</button>
35
+ </div>
@@ -0,0 +1,123 @@
1
+ <% if @cart.free_cart? %>
2
+ <div class="free_order text-center col-md-12">
3
+ <%= link_to('Complete Order', plugins_ecommerce_checkout_complete_free_order_url, class: 'btn btn-primary col-md-4 col-md-offset-4') %>
4
+ </div>
5
+ <% else %>
6
+ <div id="e-payments-types" role="tabpanel">
7
+ <ul class="nav nav-tabs nav-justified" role="tablist">
8
+ <% (payment_methods = current_site.payment_methods.actives.all).each_with_index do |payment, index| %>
9
+ <li role="presentation" class="<%= "active" if index == 0 %>">
10
+ <a href="#<%= payment.slug %>" aria-controls="<%= payment.slug %>" role="tab" data-toggle="tab"><%= t(".#{payment.options[:type]}", default: payment.options[:type].titleize) %></a>
11
+ </li>
12
+ <% end %>
13
+ </ul>
14
+
15
+ <!-- Tab panes -->
16
+ <div class="tab-content">
17
+ <% payment_methods.each_with_index do |payment, index| %>
18
+ <% inputs = content_tag :div do %>
19
+ <input type="hidden" name="payment[payment_id]" value="<%= payment.id %>">
20
+ <input type="hidden" name="payment[type]" value="<%= payment.options[:type] %>">
21
+ <div class="form-group text-center">
22
+ <button class="btn btn-primary col-md-4" type="submit"><i class="fa fa-money"></i> <%= t('.order_now', default: 'Buy') %></button>
23
+ </div>
24
+ <% end %>
25
+
26
+ <div role="tabpanel" class="tab-pane <%= "active" if index == 0 %>" id="<%= payment.slug %>">
27
+ <p><%= payment.description.translate %></p>
28
+ <% if payment.options[:type] == 'paypal' %>
29
+ <div class="type-paypal">
30
+ <img src="https://www.paypalobjects.com/webstatic/mktg/logo/bdg_payments_by_pp_2line.png" alt="Buy now with PayPal"/>
31
+ <%= form_tag(plugins_ecommerce_checkout_pay_by_paypal_path(order: @cart.slug), :method => "post") do %>
32
+ <%= inputs %>
33
+ <% end %>
34
+ </div>
35
+ <% end %>
36
+
37
+ <% if payment.options[:type] == 'bank_transfer' %>
38
+ <%= form_tag(plugins_ecommerce_checkout_pay_by_bank_transfer_path(order: @cart.slug), :method => "post") do %>
39
+ <ul class="ec-list-orders-address">
40
+ <li><strong><%= t('.account_number', default: 'Account Number') %>: </strong><span> <%= payment.options[:bank_transfer_number_account] %></span></li>
41
+ <li><strong><%= t('.details_transfer', default: 'Details') %>: </strong><span> <%= payment.options[:bank_transfer_detail] %></span></li>
42
+ </ul>
43
+ <div class="form-group">
44
+ <label><%= t('.bank_name', default: 'Bank name') %></label>
45
+ <input class="form-control required" type="text" name="details[bank_name]">
46
+ </div>
47
+ <div class="form-group">
48
+ <label><%= t('.bank_owner', default: 'Owner name of bank account') %></label>
49
+ <input class="form-control required" type="text" name="details[owner_name]">
50
+ </div>
51
+ <div class="form-group">
52
+ <label><%= t('.cod_key', default: 'CODE / ID / KEY / TICKET') %></label>
53
+ <input class="form-control required" type="text" name="details[code]">
54
+ </div>
55
+ <div class="form-group">
56
+ <label><%= t('.descr', default: 'Description') %></label>
57
+ <textarea name="details[description]" rows="4" class="form-control required" ></textarea>
58
+ </div>
59
+ <%= inputs %>
60
+ <% end %>
61
+ <% end %>
62
+
63
+ <% if payment.options[:type] == 'credit_card' %>
64
+ <img src="http://i76.imgup.net/accepted_c22e0.png" alt="Buy now with Credit Card"/>
65
+ <% end %>
66
+
67
+ <% if payment.options[:type] == 'authorize_net' %>
68
+ <img src="http://i76.imgup.net/accepted_c22e0.png" alt="Buy now with Authorize.net"/>
69
+ <%= form_tag(plugins_ecommerce_checkout_pay_by_authorize_net_path(order: @cart.slug), :method => "post") do %>
70
+ <div class="form-group">
71
+ <label for="firstName"><%= t('.first_name', default: 'First Name') %></label>
72
+ <input type="text" class="form-control required" name="firstName" value="<%= @cart.user.first_name %>" required autocomplete="off"/>
73
+ </div>
74
+ <div class="form-group">
75
+ <label for="lastName"><%= t('.last_name', default: 'Last Name') %></label>
76
+ <input type="text" class="form-control required" name="lastName" value="<%= @cart.user.last_name %>" autocomplete="off"/>
77
+ </div>
78
+ <div class="form-group">
79
+ <label><%= t('.card_number', default: 'Card Number') %></label>
80
+ <div class="input-group">
81
+ <input type="text" class="form-control required" name="cardNumber" autocomplete="off"/>
82
+ <span class="input-group-addon"><i class="fa fa-credit-card"></i></span>
83
+ </div>
84
+ </div>
85
+ <div class="form-group">
86
+ <label for="expMonth"><%= t('.exp_date', default: 'EXPIRATION DATE') %></label>
87
+ <div class="row">
88
+ <div class="col-xs-6 col-lg-6">
89
+ <input type="text" class="form-control required" name="expMonth" placeholder="MM" autocomplete="off"/>
90
+ </div>
91
+ <div class="col-xs-6 col-lg-6">
92
+ <input type="text" class="form-control required" name="expYear" placeholder="YY" autocomplete="off"/>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ <div class="form-group">
97
+ <label for="cvCode"><%= t('.cvv', default: 'Cvv CODE') %></label>
98
+ <input type="text" class="form-control required" name="cvCode" placeholder="cvv" autocomplete="off"/>
99
+ </div>
100
+ <%= inputs %>
101
+ <% end %>
102
+ <% end %>
103
+
104
+ <% if payment.options[:type] == 'stripe' %>
105
+ <%= form_tag(plugins_ecommerce_checkout_pay_by_stripe_path(order: @cart.slug), :method => "post") do %>
106
+ <input type="hidden" name="payment[payment_id]" value="<%= payment.id %>">
107
+ <input type="hidden" name="payment[type]" value="<%= payment.options[:type] %>">
108
+ <img src="http://i76.imgup.net/accepted_c22e0.png" alt="Buy now with Authorize.net"/><br>
109
+ <hr>
110
+ <script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
111
+ data-key="<%= payment.options[:stripe_key] %>"
112
+ data-description="Payment Products: <%= @cart.products_title %>"
113
+ data-amount="<%= commerce_to_cents(@cart.total_amount) %>"
114
+ data-locale="<%= I18n.locale %>"></script>
115
+ <% end %>
116
+ <% end %>
117
+ </div>
118
+ <% end %>
119
+ <%= content_tag(:div, 'No Payment Methods Defined', class: 'alert alert-danger') unless payment_methods.any? %>
120
+ </div>
121
+ </div>
122
+ <script>jQuery(function(){ cama_ecommerce_payments(); })</script>
123
+ <% end %>
@@ -0,0 +1,49 @@
1
+ <div id="totals_section">
2
+ <h3><%= t('.total', default: 'Total') %></h3>
3
+ <table class="table table-bordered">
4
+ <tbody>
5
+ <tr>
6
+ <th id="quantity_col"><%= t('.qty', default: 'Quantity') %></th>
7
+ <th id="item_col"><%= t('.item', default: 'Item') %></th>
8
+ <th id="price_col"><%= t('.price', default: 'Price') %></th>
9
+
10
+ <th id="tax_col"><%= t('.tax', default: 'Tax') %></th>
11
+ <th id="subtotal_col"><%= t('.subtotal', default: 'Sub Total') %></th>
12
+ </tr>
13
+ <% @cart.product_items.decorate.each do |item| product = item.product.decorate %>
14
+ <tr>
15
+ <td><%= item.qty %></td>
16
+ <td><%= product.the_title %></td>
17
+ <td><%= item.the_price %></td>
18
+ <td><%= item.the_tax %></td>
19
+ <td><%= item.the_sub_total %></td>
20
+ </tr>
21
+ <% end %>
22
+ <tr>
23
+ <td colspan="2"></td>
24
+ <td colspan="2" class="text-right"><%= t('.total_excl', default: 'Total (excluding Tax)') %> </td>
25
+ <td><%= @cart.the_sub_total %></td>
26
+ </tr>
27
+ <tr>
28
+ <td colspan="2"></td>
29
+ <td colspan="2" class="text-right"><%= t('.tax', default: 'Tax') %></td>
30
+ <td id="tax_total"><%= @cart.the_tax_total %></td>
31
+ </tr>
32
+ <tr id="coupon_application_row">
33
+ <td colspan="2"></td>
34
+ <td colspan="2" class="text-right"><%= t('.discount', default: 'Discount') %></td>
35
+ <td><%= @cart.the_total_discounts %></td>
36
+ </tr>
37
+ <tr>
38
+ <td colspan="2"></td>
39
+ <td colspan="2" class="text-right"><%= t('.total_shipping', default: 'Total shipping') %></td>
40
+ <td id="shipping_total"><%= @cart.the_total_shipping %></td>
41
+ </tr>
42
+ <tr>
43
+ <td colspan="2"></td>
44
+ <td colspan="2" class="text-right"><%= t('.total_price', default: 'Total Price') %></td>
45
+ <td><%= @cart.the_price %></td>
46
+ </tr>
47
+ </tbody>
48
+ </table>
49
+ </div>
@@ -0,0 +1,93 @@
1
+ <%
2
+ cart ||= @cart
3
+ billing_address = cart.get_meta("billing_address", {})
4
+ shipping_address = cart.get_meta("shipping_address", {})
5
+ %>
6
+ <div class="row">
7
+ <div id="billing_address" class="col-md-6">
8
+ <h3><%= t('plugin.ecommerce.billing_address') %></h3>
9
+
10
+ <div class="form-group">
11
+ <label for=""><%= t('.firstname', default: 'First Name') %></label>
12
+ <%= text_field_tag 'order[billing_address][first_name]', billing_address[:first_name], class: 'form-control required' %>
13
+
14
+ </div>
15
+ <div class="form-group">
16
+ <label for=""><%= t('.lastname', default: 'Last Name') %></label>
17
+ <%= text_field_tag 'order[billing_address][last_name]',billing_address[:last_name], class: 'form-control required' %>
18
+ </div>
19
+ <div class="form-group">
20
+ <label for=""><%= t('.address', default: 'Address') %></label>
21
+ <%= text_field_tag 'order[billing_address][address1]',billing_address[:address1], class: 'form-control required' %>
22
+ </div>
23
+ <div class="form-group">
24
+ <label for=""><%= t('.address', default: 'Address') %> 2</label>
25
+ <%= text_field_tag 'order[billing_address][address2]',billing_address[:address2], class: 'form-control' %>
26
+ </div>
27
+ <div class="form-group">
28
+ <label for=""><%= t('.city', default: 'City') %></label>
29
+ <%= text_field_tag 'order[billing_address][city]',billing_address[:city], class: 'form-control required' %>
30
+ </div>
31
+ <div class="form-group">
32
+ <label for=""><%= t('.country', default: 'Country') %></label>
33
+ <%= country_select :billing_address, :country, {locale: I18n.locale.to_s, iso_codes: true, selected: billing_address[:country]}, { :name => 'order[billing_address][country]', class: 'form-control' } %>
34
+ </div>
35
+ <div class="form-group">
36
+ <label for=""><%= t('.state', default: 'State') %></label>
37
+ <%= text_field_tag 'order[billing_address][state]',billing_address[:state], class: 'form-control' %>
38
+ </div>
39
+ <div class="form-group">
40
+ <label for=""><%= t('.code_zip', default: 'Zip code') %></label>
41
+ <%= text_field_tag 'order[billing_address][zip]',billing_address[:zip], class: 'form-control' %>
42
+ </div>
43
+
44
+ </div>
45
+
46
+ <div id="shipping_address" class="col-md-6">
47
+ <h3>
48
+ <%= t('.shipping_address') %>
49
+ <small><a href="#" id="ec_copy">(<%= t('.copy_address', default: 'copy from billing') %>)</a></small>
50
+ </h3>
51
+
52
+ <div class="form-group">
53
+ <label for=""><%= t('.firstname') %></label>
54
+ <%= text_field_tag 'order[shipping_address][first_name]', shipping_address[:first_name], class: 'form-control required' %>
55
+
56
+ </div>
57
+ <div class="form-group">
58
+ <label for=""><%= t('.lastname') %></label>
59
+ <%= text_field_tag 'order[shipping_address][last_name]', shipping_address[:last_name], class: 'form-control required' %>
60
+ </div>
61
+ <div class="form-group">
62
+ <label for=""><%= t('.address') %></label>
63
+ <%= text_field_tag 'order[shipping_address][address1]', shipping_address[:address1], class: 'form-control required' %>
64
+ </div>
65
+ <div class="form-group">
66
+ <label for=""><%= t('.address') %> 2</label>
67
+ <%= text_field_tag 'order[shipping_address][address2]', shipping_address[:address2], class: 'form-control' %>
68
+ </div>
69
+ <div class="form-group">
70
+ <label for=""><%= t('.city') %></label>
71
+ <%= text_field_tag 'order[shipping_address][city]', shipping_address[:city], class: 'form-control required' %>
72
+ </div>
73
+ <div class="form-group">
74
+ <label for=""><%= t('.country') %></label>
75
+ <%= country_select :shipping_address, :country, {locale: I18n.locale.to_s, iso_codes: true, selected: billing_address[:country]}, { :name => 'order[shipping_address][country]', class: 'form-control' } %>
76
+ </div>
77
+ <div class="form-group">
78
+ <label for=""><%= t('.state') %></label>
79
+ <%= text_field_tag 'order[shipping_address][state]', shipping_address[:state], class: 'form-control' %>
80
+ </div>
81
+ <div class="form-group">
82
+ <label for=""><%= t('.code_zip') %></label>
83
+ <%= text_field_tag 'order[shipping_address][zip]', shipping_address[:zip], class: 'form-control' %>
84
+ </div>
85
+ </div>
86
+ <div class="clearfix"></div>
87
+ <% unless defined?(as_partial) %>
88
+ <div class="text-right col-md-12">
89
+ <button type="submit" class="btn btn-primary">Next</button>
90
+ </div>
91
+ <% end %>
92
+ </div>
93
+