camaleon_ecommerce 1.2 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/plugins/ecommerce/admin_product.js.coffee +17 -1
  3. data/app/controllers/plugins/ecommerce/admin/coupons_controller.rb +1 -1
  4. data/app/controllers/plugins/ecommerce/admin/orders_controller.rb +24 -21
  5. data/app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb +2 -34
  6. data/app/controllers/plugins/ecommerce/admin/prices_controller.rb +3 -6
  7. data/app/controllers/plugins/ecommerce/admin/settings_controller.rb +2 -1
  8. data/app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb +2 -2
  9. data/app/controllers/plugins/ecommerce/admin/tax_rates_controller.rb +1 -1
  10. data/app/controllers/plugins/ecommerce/admin_controller.rb +2 -2
  11. data/app/controllers/plugins/ecommerce/front/checkout_controller.rb +34 -18
  12. data/app/controllers/plugins/ecommerce/front/orders_controller.rb +3 -4
  13. data/app/controllers/plugins/ecommerce/front_controller.rb +26 -11
  14. data/app/decorators/plugins/ecommerce/cart_decorator.rb +5 -5
  15. data/app/decorators/plugins/ecommerce/coupon_decorator.rb +8 -27
  16. data/app/decorators/plugins/ecommerce/order_decorator.rb +1 -1
  17. data/app/decorators/plugins/ecommerce/product_decorator.rb +33 -20
  18. data/app/decorators/plugins/ecommerce/product_item_decorator.rb +8 -2
  19. data/app/decorators/plugins/ecommerce/product_variation_decorator.rb +1 -1
  20. data/app/helpers/plugins/ecommerce/ecommerce_email_helper.rb +7 -6
  21. data/app/helpers/plugins/ecommerce/ecommerce_functions_helper.rb +276 -33
  22. data/app/helpers/plugins/ecommerce/ecommerce_helper.rb +59 -56
  23. data/app/models/plugins/ecommerce/attribute.rb +3 -0
  24. data/app/models/plugins/ecommerce/cart.rb +31 -7
  25. data/app/models/plugins/ecommerce/legacy_order.rb +1 -30
  26. data/app/models/plugins/ecommerce/order.rb +11 -5
  27. data/app/models/plugins/ecommerce/order_detail.rb +1 -0
  28. data/app/models/plugins/ecommerce/payment_method.rb +9 -5
  29. data/app/models/plugins/ecommerce/product_variation.rb +6 -0
  30. data/app/services/plugins/ecommerce/cart_service.rb +4 -17
  31. data/app/views/camaleon_cms/html_mailer/order_canceled.html.erb +2 -2
  32. data/app/views/camaleon_cms/html_mailer/order_confirmed.html.erb +2 -2
  33. data/app/views/camaleon_cms/html_mailer/order_received.html.erb +5 -3
  34. data/app/views/camaleon_cms/html_mailer/order_received_admin.html.erb +3 -3
  35. data/app/views/camaleon_cms/html_mailer/order_shipped.html.erb +2 -2
  36. data/app/views/camaleon_cms/html_mailer/recovery_cart.html.erb +3 -3
  37. data/app/views/plugins/ecommerce/admin/coupons/form.html.erb +11 -11
  38. data/app/views/plugins/ecommerce/admin/coupons/index.html.erb +11 -11
  39. data/app/views/plugins/ecommerce/admin/orders/form.html.erb +2 -2
  40. data/app/views/plugins/ecommerce/admin/orders/index.html.erb +53 -63
  41. data/app/views/plugins/ecommerce/admin/payment_methods/form.html.erb +30 -24
  42. data/app/views/plugins/ecommerce/admin/payment_methods/index.html.erb +8 -8
  43. data/app/views/plugins/ecommerce/admin/payment_methods/show.html.erb +22 -22
  44. data/app/views/plugins/ecommerce/admin/prices/form.html.erb +6 -6
  45. data/app/views/plugins/ecommerce/admin/prices/index.html.erb +8 -8
  46. data/app/views/plugins/ecommerce/admin/product_attributes.html.erb +1 -1
  47. data/app/views/plugins/ecommerce/admin/products/_variations.html.erb +4 -4
  48. data/app/views/plugins/ecommerce/admin/products/index.html.erb +5 -5
  49. data/app/views/plugins/ecommerce/admin/settings/index.html.erb +20 -8
  50. data/app/views/plugins/ecommerce/admin/shipping_methods/form.html.erb +5 -5
  51. data/app/views/plugins/ecommerce/admin/shipping_methods/index.html.erb +8 -9
  52. data/app/views/plugins/ecommerce/admin/shipping_methods/show.html.erb +4 -4
  53. data/app/views/plugins/ecommerce/admin/tax_rates/form.html.erb +3 -3
  54. data/app/views/plugins/ecommerce/admin/tax_rates/index.html.erb +7 -7
  55. data/app/views/plugins/ecommerce/front/checkout/index.html.erb +4 -4
  56. data/app/views/plugins/ecommerce/front/login.html.erb +3 -6
  57. data/app/views/plugins/ecommerce/front/orders/show.html.erb +7 -1
  58. data/app/views/plugins/ecommerce/partials/_cart_widget.html.erb +14 -29
  59. data/app/views/plugins/ecommerce/partials/checkout/_details.html.erb +1 -1
  60. data/app/views/plugins/ecommerce/partials/checkout/_payments.html.erb +100 -99
  61. data/app/views/plugins/ecommerce/partials/checkout/_user_info.html.erb +2 -2
  62. data/app/views/post_types/commerce/{_product_widget.html.erb → _post_list_item.html.erb} +0 -0
  63. data/app/views/post_types/commerce/_product_info.html.erb +45 -0
  64. data/app/views/post_types/commerce/single.html.erb +63 -85
  65. data/config/camaleon_plugin.json +3 -8
  66. data/config/custom_models.rb +28 -4
  67. data/config/locales/en.yml +27 -12
  68. data/config/locales/es.yml +70 -57
  69. data/config/routes.rb +1 -0
  70. data/db/migrate/20161202182552_add_cookie_key_to_cart.rb +5 -0
  71. data/lib/ecommerce/version.rb +1 -1
  72. metadata +7 -14
  73. data/app/helpers/plugins/ecommerce/ecommerce_payment_helper.rb +0 -6
  74. data/app/models/plugins/ecommerce/legacy_cart.rb +0 -50
  75. data/app/services/plugins/ecommerce/product_item_service.rb +0 -29
  76. data/app/services/plugins/ecommerce/product_service.rb +0 -17
  77. data/app/services/plugins/ecommerce/site_service.rb +0 -21
  78. data/app/services/plugins/ecommerce/user_cart_service.rb +0 -12
  79. data/app/services/plugins/ecommerce/user_product_service.rb +0 -29
  80. data/app/views/post_types/commerce.html.erb +0 -22
  81. data/app/views/post_types/commerce/category.html.erb +0 -23
@@ -1,19 +1,19 @@
1
1
  <div class="panel panel-default">
2
2
  <div class="panel-heading">
3
- <h4><span class="fa fa-credit-card"></span> <%= t('plugin.ecommerce.payment_methods') %></h4>
4
- <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugin.ecommerce.add_payment_method')}"), {action: :new}, class: "btn btn-primary pull-right" %>
3
+ <h4><span class="fa fa-credit-card"></span> <%= t('plugins.ecommerce.payment_methods') %></h4>
4
+ <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugins.ecommerce.add_payment_method')}"), {action: :new}, class: "btn btn-primary pull-right" %>
5
5
  </div>
6
6
  <div class="panel-body">
7
7
 
8
8
  <table class="table">
9
9
  <thead>
10
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.method_type') %></th>
14
- <th id=""><%= t('plugin.ecommerce.table.status') %></th>
15
- <th id=""><%= t('plugin.ecommerce.table.description') %></th>
16
- <th><%= t('plugin.ecommerce.table.actions') %></th>
11
+ <th id=""><%= t('plugins.ecommerce.table.id') %></th>
12
+ <th id=""><%= t('plugins.ecommerce.table.name') %></th>
13
+ <th id=""><%= t('plugins.ecommerce.table.method_type') %></th>
14
+ <th id=""><%= t('plugins.ecommerce.table.status') %></th>
15
+ <th id=""><%= t('plugins.ecommerce.table.description') %></th>
16
+ <th><%= t('plugins.ecommerce.table.actions') %></th>
17
17
  </tr>
18
18
  </thead>
19
19
  <tbody>
@@ -1,61 +1,61 @@
1
1
  <div class="panel panel-default">
2
2
  <div class="panel-heading">
3
3
  <h4><span class="fa fa-credit-card"></span> <%= @payment_method.name %></h4>
4
- <%= link_to raw("<i class='fa fa-edit'></i> #{t('plugin.ecommerce.edit_payment_methods')}"), {action: :edit, id: @payment_method.id}, class: "btn btn-primary pull-right" %>
4
+ <%= link_to raw("<i class='fa fa-edit'></i> #{t('plugins.ecommerce.edit_payment_methods')}"), {action: :edit, id: @payment_method.id}, class: "btn btn-primary pull-right" %>
5
5
  </div>
6
6
  <div class="panel-body">
7
7
  <div class="row">
8
8
  <div class="col-md-6">
9
- <h3><%= t('plugin.ecommerce.info') %></h3>
9
+ <h3><%= t('plugins.ecommerce.info') %></h3>
10
10
  <ul class="ec-list-orders-address">
11
- <li><strong><%= t('plugin.ecommerce.table.name') %>:</strong> <span> <%= @payment_method.name %></span></li>
12
- <li><strong><%= t('plugin.ecommerce.table.description') %>:</strong> <span> <%= @payment_method.description %></span></li>
13
- <li><strong><%= t('plugin.ecommerce.status') %>:</strong> <span> <%= raw @payment_method.the_status %></span></li>
11
+ <li><strong><%= t('plugins.ecommerce.table.name') %>:</strong> <span> <%= @payment_method.name %></span></li>
12
+ <li><strong><%= t('plugins.ecommerce.table.description') %>:</strong> <span> <%= @payment_method.description %></span></li>
13
+ <li><strong><%= t('plugins.ecommerce.status') %>:</strong> <span> <%= raw @payment_method.the_status %></span></li>
14
14
  </ul>
15
15
  </div>
16
16
 
17
17
  <div class="col-md-6">
18
18
  <% if @payment_method.options[:type] == 'paypal' %>
19
- <h3><%= t('plugin.ecommerce.method_paypal') %></h3>
19
+ <h3><%= t('plugins.ecommerce.method_paypal') %></h3>
20
20
  <ul class="ec-list-orders-address">
21
- <li><strong><%= t('plugin.ecommerce.table.login') %>:</strong> <span> <%= @payment_method.options[:paypal_login] %></span></li>
22
- <li><strong><%= t('plugin.ecommerce.table.password') %>:</strong> <span> <%= @payment_method.options[:paypal_password] %></span></li>
23
- <li><strong><%= t('plugin.ecommerce.table.signature') %>:</strong> <span> <%= @payment_method.options[:paypal_signature] %></span></li>
24
- <li><strong><%= t('plugin.ecommerce.table.sandbox') %>:</strong> <span> <%= @payment_method.options[:paypal_sandbox].to_s.to_bool ? 'Yes' : 'No' %></span></li>
21
+ <li><strong><%= t('plugins.ecommerce.table.login') %>:</strong> <span> <%= @payment_method.options[:paypal_login] %></span></li>
22
+ <li><strong><%= t('plugins.ecommerce.table.password') %>:</strong> <span> <%= @payment_method.options[:paypal_password] %></span></li>
23
+ <li><strong><%= t('plugins.ecommerce.table.signature') %>:</strong> <span> <%= @payment_method.options[:paypal_signature] %></span></li>
24
+ <li><strong><%= t('plugins.ecommerce.table.sandbox') %>:</strong> <span> <%= @payment_method.options[:paypal_sandbox].to_s.to_bool ? 'Yes' : 'No' %></span></li>
25
25
  </ul>
26
26
  <% end %>
27
27
 
28
28
  <% if @payment_method.options[:type] == 'credit_card' %>
29
- <h3><%= t('plugin.ecommerce.method_credit_card') %></h3>
29
+ <h3><%= t('plugins.ecommerce.method_credit_card') %></h3>
30
30
  <ul class="ec-list-orders-address">
31
- <li><strong><%= t('plugin.ecommerce.table.login') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_login] %></span></li>
32
- <li><strong><%= t('plugin.ecommerce.table.password') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_password] %></span></li>
33
- <li><strong><%= t('plugin.ecommerce.table.signature') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_signature] %></span></li>
34
- <li><strong><%= t('plugin.ecommerce.table.sandbox') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_sandbox].to_s.to_bool ? 'Yes' : 'No' %></span></li>
31
+ <li><strong><%= t('plugins.ecommerce.table.login') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_login] %></span></li>
32
+ <li><strong><%= t('plugins.ecommerce.table.password') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_password] %></span></li>
33
+ <li><strong><%= t('plugins.ecommerce.table.signature') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_signature] %></span></li>
34
+ <li><strong><%= t('plugins.ecommerce.table.sandbox') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_sandbox].to_s.to_bool ? 'Yes' : 'No' %></span></li>
35
35
  </ul>
36
36
  <% end %>
37
37
 
38
38
  <% if @payment_method.options[:type] == 'bank_transfer' %>
39
- <h3><%= t('plugin.ecommerce.method_bank_transfer') %></h3>
39
+ <h3><%= t('plugins.ecommerce.method_bank_transfer') %></h3>
40
40
  <ul class="ec-list-orders-address">
41
- <li><strong><%= t('plugin.ecommerce.table.number_account_bank') %>:</strong> <span> <%= @payment_method.options[:bank_transfer_number_account] %></span></li>
42
- <li><strong><%= t('plugin.ecommerce.table.details') %>:</strong> <span> <%= @payment_method.options[:bank_transfer_detail] %></span></li>
41
+ <li><strong><%= t('plugins.ecommerce.table.number_account_bank') %>:</strong> <span> <%= @payment_method.options[:bank_transfer_number_account] %></span></li>
42
+ <li><strong><%= t('plugins.ecommerce.table.details') %>:</strong> <span> <%= @payment_method.options[:bank_transfer_detail] %></span></li>
43
43
  </ul>
44
44
  <% end %>
45
45
 
46
46
  <% if @payment_method.options[:type] == 'authorize_net' %>
47
- <h3><%= t('plugin.ecommerce.method_authorize_net') %></h3>
47
+ <h3><%= t('plugins.ecommerce.method_authorize_net') %></h3>
48
48
  <ul class="ec-list-orders-address">
49
49
  <li>
50
- <strong><%= t('plugin.ecommerce.table.login_id') %>:</strong>
50
+ <strong><%= t('plugins.ecommerce.table.login_id') %>:</strong>
51
51
  <span> <%= @payment_method.options[:authorize_net_login_id] %></span>
52
52
  </li>
53
53
  <li>
54
- <strong><%= t('plugin.ecommerce.table.transaction_key') %>:</strong>
54
+ <strong><%= t('plugins.ecommerce.table.transaction_key') %>:</strong>
55
55
  <span> <%= @payment_method.options[:authorize_net_transaction_key] %></span>
56
56
  </li>
57
57
  <li>
58
- <strong><%= t('plugin.ecommerce.table.sandbox') %>:</strong>
58
+ <strong><%= t('plugins.ecommerce.table.sandbox') %>:</strong>
59
59
  <span> <%= @payment_method.options[:authorize_net_sandbox].to_s.to_bool ? 'Yes' : 'No' %></span>
60
60
  </li>
61
61
  </ul>
@@ -1,5 +1,5 @@
1
1
  <div class="page-title">
2
- <h2><span class="fa fa-usd"></span> <%= !@price[:id].present? ? t('plugin.ecommerce.add_price') : "#{t('plugin.ecommerce.edit_price')}: #{@price[:code]}" %></h2>
2
+ <h2><span class="fa fa-usd"></span> <%= !@price[:id].present? ? t('plugins.ecommerce.add_price') : "#{t('plugins.ecommerce.edit_price')}: #{@price[:code]}" %></h2>
3
3
  </div>
4
4
 
5
5
  <!-- PAGE CONTENT WRAPPER -->
@@ -9,7 +9,7 @@
9
9
  <div class="col-md-8 col-md-offset-2">
10
10
  <div class="panel panel-default">
11
11
  <div class="panel-heading ui-draggable-handle">
12
- <h3 class="panel-title"><%= t('plugin.ecommerce.form_price') %></h3>
12
+ <h3 class="panel-title"><%= t('plugins.ecommerce.form_price') %></h3>
13
13
  </div>
14
14
  <%#= form_tag ({url:{action: @price.blank? ? :create : :update}}, :method => "post", :class => "form" ) do %>
15
15
  <%= form_tag(@price[:id].present? ? {action: :update, id: @price[:id]} : {action: :create}, :method => @price[:id].present? ? "patch" :"post", :class => "validate-price") do %>
@@ -17,19 +17,19 @@
17
17
  <div class="row">
18
18
 
19
19
  <div class="form-group col-md-6">
20
- <label><%= t('plugin.ecommerce.table.code') %></label><br>
20
+ <label><%= t('plugins.ecommerce.table.code') %></label><br>
21
21
  <%= text_field_tag( "price[code]", @price[:code], class: "form-control required") %>
22
22
  </div>
23
23
  <div class="form-group col-md-6">
24
- <label><%= t('plugin.ecommerce.product.price') %> </label> (<%= current_site.current_unit %>)<br>
24
+ <label><%= t('plugins.ecommerce.product.price') %> </label> (<%= e_system_currency %>)<br>
25
25
  <%= number_field_tag( "price[price]", @price[:price], class: "form-control required") %>
26
26
  </div>
27
27
  <div class="form-group col-md-6">
28
- <label><%= t('plugin.ecommerce.table.min_weight') %> </label> (<%= current_site.current_weight %>)<br>
28
+ <label><%= t('plugins.ecommerce.table.min_weight') %> </label> (<%= current_site.current_weight %>)<br>
29
29
  <%= number_field_tag( "price[min_weight]", @price[:min_weight], class: "form-control required") %>
30
30
  </div>
31
31
  <div class="form-group col-md-6">
32
- <label><%= t('plugin.ecommerce.table.max_weight') %> </label> (<%= current_site.current_weight %>)<br>
32
+ <label><%= t('plugins.ecommerce.table.max_weight') %> </label> (<%= current_site.current_weight %>)<br>
33
33
  <%= number_field_tag( "price[max_weight]", @price[:max_weight], class: "form-control required") %>
34
34
  </div>
35
35
  </div>
@@ -1,18 +1,18 @@
1
1
  <div class="panel panel-default">
2
2
  <div class="panel-heading">
3
- <h4><span class="fa fa-usd"></span> <%= t('plugin.ecommerce.product.price') %></h4>
4
- <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugin.ecommerce.add_price')}"), {action: :new}, class: "btn btn-primary pull-right" %>
3
+ <h4><span class="fa fa-usd"></span> <%= t('plugins.ecommerce.shipping_prices') %></h4>
4
+ <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugins.ecommerce.add_price')}"), {action: :new}, class: "btn btn-primary pull-right" %>
5
5
  </div>
6
6
  <div class="panel-body">
7
7
 
8
8
  <table class="table">
9
9
  <thead>
10
10
  <tr>
11
- <th><%= t('plugin.ecommerce.table.code')%></th>
12
- <th><%= t('plugin.ecommerce.product.price')%></th>
13
- <th><%= t('plugin.ecommerce.table.min_weight') %></th>
14
- <th><%= t('plugin.ecommerce.table.max_weight') %></th>
15
- <th><%= t('plugin.ecommerce.table.actions') %></th>
11
+ <th><%= t('plugins.ecommerce.table.code')%></th>
12
+ <th><%= t('plugins.ecommerce.product.price')%></th>
13
+ <th><%= t('plugins.ecommerce.table.min_weight') %></th>
14
+ <th><%= t('plugins.ecommerce.table.max_weight') %></th>
15
+ <th><%= t('plugins.ecommerce.table.actions') %></th>
16
16
  </tr>
17
17
  </thead>
18
18
  <tbody>
@@ -21,7 +21,7 @@
21
21
  %>
22
22
  <tr>
23
23
  <td><%= row[:code] %></td>
24
- <td><%= current_site.current_unit %> <%= row[:price] %></td>
24
+ <td><%= e_parse_price(row[:price]) %></td>
25
25
  <td><%= row[:min_weight] %> <%= current_site.current_weight %></td>
26
26
  <td><%= row[:max_weight] %> <%= current_site.current_weight %></td>
27
27
  <td>
@@ -31,7 +31,7 @@
31
31
  </div>
32
32
  </div>
33
33
  </div>
34
- <ul class="values_sortable">
34
+ <ul class="values_sortable" style="padding: 0; list-style: none;">
35
35
  <% (attr.values.to_a + (attr.id.present? ? [] : [Plugins::Ecommerce::Attribute.new])).each do |value| %>
36
36
  <li class="item-custom-field product_attribute_value_<%= value.id %>">
37
37
  <%= hidden_field_tag "attribute[#{attr.id}][][position]", value.position, class: 'value_position' %>
@@ -18,7 +18,7 @@
18
18
  <%= hidden_field_tag "product_variation[#{variation.id}][position]", variation.position, class: 'product_variation_position' %>
19
19
  <div class="variation_attributes form-group">
20
20
  <label><%= t('.attributes', default: 'Attributes') %></label>
21
- <ul class="item-custom-field sortable_values">
21
+ <ul class="item-custom-field sortable_values" style="padding: 0; list-style: none;">
22
22
  <% (variation.id.present? ? variation.attribute_values : [variation.attribute_values.rewhere(id: nil).new]).each do |val| %>
23
23
  <li>
24
24
  <div class="actions">
@@ -27,10 +27,10 @@
27
27
  </div>
28
28
  <div class="row group-input-fields-content">
29
29
  <div class="col-md-4">
30
- <%= select_tag "product_variation[#{variation.id}][attributes][][id]", options_from_collection_for_select(current_site.product_attributes, :id, :label, val.parent_id), class: 'form-control required product_attribute_select' %>
30
+ <%= select_tag "product_variation[#{variation.id}][attributes][][id]", options_from_collection_for_select(current_site.product_attributes, :id, lambda{|i| i.label.to_s.translate }, val.parent_id), class: 'form-control required product_attribute_select' %>
31
31
  </div>
32
32
  <div class="col-md-8">
33
- <%= select_tag "product_variation[#{variation.id}][attributes][][value]", val.id.present? ? options_from_collection_for_select(val.product_attribute.values, :id, :label, val.id) : [], class: 'form-control required product_attribute_vals_select' %>
33
+ <%= select_tag "product_variation[#{variation.id}][attributes][][value]", val.id.present? ? options_from_collection_for_select(val.product_attribute.values, :id, lambda{|i| i.label.to_s.translate }, val.id) : [], class: 'form-control required product_attribute_vals_select' %>
34
34
  </div>
35
35
  </div>
36
36
  </li>
@@ -69,4 +69,4 @@
69
69
  <a class="btn btn-warning add_new_variation btn-xs" href="#"><i class="fa fa-plus"></i> <%= t('.add_new_variation', default: 'Add new variation') %></a>
70
70
  </div>
71
71
  </div>
72
- <script>var PRODUCT_ATTRIBUTES = <%= raw current_site.product_attributes.to_json(include: :values) %></script>
72
+ <script>var PRODUCT_ATTRIBUTES = <%= raw current_site.product_attributes.map{|item| item.label = item.label.to_s.translate; item }.to_json(include: :translated_values) %></script>
@@ -23,13 +23,13 @@
23
23
  <table class="table table-hover ecomerce" id="posts-table-list">
24
24
  <thead>
25
25
  <tr>
26
- <th><%= t('plugin.ecommerce.product.sku') %></th>
26
+ <th><%= t('plugins.ecommerce.product.sku') %></th>
27
27
  <th><%= t('camaleon_cms.admin.table.title') %></th>
28
28
  <th><%= t('camaleon_cms.admin.table.status') %></th>
29
- <th><%= t('plugin.ecommerce.product.price') %></th>
30
- <th><%= t('plugin.ecommerce.product.weight') %></th>
31
- <th><%= t('plugin.ecommerce.product.stock') %></th>
32
- <th><%= t('plugin.ecommerce.product.qty') %></th>
29
+ <th><%= t('plugins.ecommerce.product.price') %></th>
30
+ <th><%= t('plugins.ecommerce.product.weight') %></th>
31
+ <th><%= t('plugins.ecommerce.product.stock') %></th>
32
+ <th><%= t('plugins.ecommerce.product.qty') %></th>
33
33
  <th><%= t('camaleon_cms.admin.table.author')%></th>
34
34
  <% if @post_type.manage_categories? %>
35
35
  <th><%= t('camaleon_cms.admin.table.categories')%></th>
@@ -1,20 +1,28 @@
1
1
  <div class="panel panel-default">
2
2
  <div class="panel-heading ui-draggable-handle">
3
- <h4><span class="fa fa-cogs"></span> <%= t('plugin.ecommerce.e_commerce_settings') %></h4>
3
+ <h4><span class="fa fa-cogs"></span> <%= cama_t('plugins.ecommerce.e_commerce_settings') %></h4>
4
4
  </div>
5
- <%= form_tag(action: :saved, :method => "post", :class => "validate-settings") do %>
5
+ <%= form_tag(url_for(action: :saved, :method => "post"), :class => "validate-settings", id: 'ecommerce_settings_form') do %>
6
6
  <div class="panel-body">
7
+ <div class="form-group col-md-4">
8
+ <label><%= cama_t('plugins.ecommerce.table.system_currency_unit') %></label><br>
9
+ <%= select_tag( "setting[current_unit]", options_for_select(e_get_all_currencies.collect{|k, x| ["#{x[:label]} (#{x[:symbol]})", k]}, e_system_currency), class: "form-control required masked_select", 'data-live-search' => true) %>
10
+ </div>
7
11
 
8
- <div class="form-group col-md-6">
9
- <label><%= t('plugin.ecommerce.table.currency_unit') %></label><br>
10
- <%= select_tag( "setting[current_unit]", options_for_select(e_get_currency_units.collect{|k, x| ["#{x['name']} (#{x['symbol']})", x['code']]}, @setting[:current_unit] || 'USD'), class: "form-control required") %>
12
+ <div class="form-group col-md-4">
13
+ <label><%= cama_t('plugins.ecommerce.table.available_currencies_unit') %></label><br>
14
+ <%= select_tag( "setting[visitor_unit_currencies]", options_for_select(e_get_all_currencies.collect{|k, x| ["#{x[:label]} (#{x[:symbol]})", k]}, e_visitor_unit_currencies), class: "form-control required", multiple: true, 'data-live-search' => true) %>
11
15
  </div>
12
16
 
13
- <div class="form-group col-md-6">
14
- <label><%= t('plugin.ecommerce.table.currency_weight') %></label><br>
15
- <%= select_tag( "setting[current_weight]", options_for_select(e_get_currency_weight.collect{|k,x| ["#{x['name']} (#{x['code']})", x['code']]}, @setting[:current_weight] || 'kg'), class: "form-control required") %>
17
+ <div class="form-group col-md-4">
18
+ <label><%= cama_t('plugins.ecommerce.table.currency_weight') %></label><br>
19
+ <%= select_tag( "setting[current_weight]", options_for_select(e_get_currency_weights.collect{|k,x| ["#{x} (#{k})", k]}, @setting[:current_weight] || 'kg'), class: "form-control required") %>
16
20
  </div>
17
21
 
22
+ <div class="form-group col-md-4">
23
+ <label><%= cama_t('plugins.ecommerce.table.shipping_countries') %></label><br>
24
+ <%= country_select :setting, :shipping_countries, {locale: I18n.locale.to_s, iso_codes: true, selected: e_shipping_countries}, { :name => 'setting[shipping_countries][]', class: 'form-control', multiple: true, 'data-live-search' => true, 'data-actions-box' => true } %>
25
+ </div>
18
26
  </div>
19
27
  <div class="panel-footer">
20
28
  <a class="btn btn-default" href="<%= url_for action: :index %>" role="back"><%= t('camaleon_cms.admin.button.back')%></a>
@@ -22,3 +30,7 @@
22
30
  </div>
23
31
  <% end %>
24
32
  </div>
33
+ <script type="application/javascript">jQuery(function(){
34
+ var form = $('#ecommerce_settings_form');
35
+ form.find('select[multiple], .masked_select').selectpicker();
36
+ })</script>
@@ -1,12 +1,12 @@
1
1
  <div class="panel panel-default">
2
2
  <div class="panel-heading ui-draggable-handle">
3
- <h4><span class="fa fa-credit-card"></span> <%= @shipping_method.new_record? ? t('plugin.ecommerce.new_shipping_methods') : "#{t('plugin.ecommerce.edit_shipping_methods')}: #{@shipping_method.name}" %></h4>
3
+ <h4><span class="fa fa-credit-card"></span> <%= @shipping_method.new_record? ? t('plugins.ecommerce.new_shipping_methods') : "#{t('plugins.ecommerce.edit_shipping_methods')}: #{@shipping_method.name}" %></h4>
4
4
  </div>
5
5
  <%= form_for @shipping_method, url:{action: @shipping_method.new_record? ? :create : :update}, html: {class: 'validate-shipping_method', id: 'form-shipping_method'} do |f| %>
6
6
  <div class="panel-body">
7
7
  <%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @shipping_method} %>
8
8
  <div class="form-group">
9
- <%= f.label t('plugin.ecommerce.table.name') %><br>
9
+ <%= f.label t('plugins.ecommerce.table.name') %><br>
10
10
  <%= f.text_field :name, :class => "form-control required" %>
11
11
  </div>
12
12
  <div class="form-group">
@@ -22,13 +22,13 @@
22
22
  options = params[:options] if params[:options].present?
23
23
  %>
24
24
  <div class="form-group">
25
- <label><%= t('plugin.ecommerce.table.url_tracking') %></label><br>
25
+ <label><%= t('plugins.ecommerce.table.url_tracking') %></label><br>
26
26
  <%= text_field_tag( "options[url_tracking]", options[:url_tracking], class: "form-control required") %>
27
- <small><%= t('plugin.ecommerce.message.consignment_number') %></small>
27
+ <small><%= t('plugins.ecommerce.message.consignment_number') %></small>
28
28
  </div>
29
29
 
30
30
  <div class="form-group">
31
- <label><%= f.check_box :status %> &nbsp; <%= t('plugin.ecommerce.active') %></label>
31
+ <label><%= f.check_box :status %> &nbsp; <%= t('plugins.ecommerce.active') %></label>
32
32
  </div>
33
33
  </div>
34
34
  <div class="panel-footer">
@@ -1,18 +1,18 @@
1
1
  <div class="panel panel-default">
2
2
  <div class="panel-heading">
3
- <h4><span class="fa fa-credit-card"></span> <%= t('plugin.ecommerce.shipping_methods') %> </h4>
4
- <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugin.ecommerce.add_shipping_methods')}"), {action: :new}, class: "btn btn-primary pull-right" %>
3
+ <h4><span class="fa fa-credit-card"></span> <%= t('plugins.ecommerce.shipping_methods') %> </h4>
4
+ <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugins.ecommerce.add_shipping_methods')}"), {action: :new}, class: "btn btn-primary pull-right" %>
5
5
  </div>
6
6
  <div class="panel-body">
7
7
 
8
8
  <table class="table">
9
9
  <thead>
10
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.status') %></th>
14
- <th id=""><%= t('plugin.ecommerce.table.description') %></th>
15
- <th><%= t('plugin.ecommerce.table.actions') %></th>
11
+ <th id=""><%= t('plugins.ecommerce.table.id') %></th>
12
+ <th id=""><%= t('plugins.ecommerce.table.name') %></th>
13
+ <th id=""><%= t('plugins.ecommerce.table.status') %></th>
14
+ <th id=""><%= t('plugins.ecommerce.table.description') %></th>
15
+ <th><%= t('plugins.ecommerce.table.actions') %></th>
16
16
  </tr>
17
17
  </thead>
18
18
  <tbody>
@@ -25,8 +25,7 @@
25
25
  <td><%= row.status %></td>
26
26
  <td><%= row.description %></td>
27
27
  <td>
28
- <%= link_to raw('<i class="fa fa-eye"></i>'), {action: :show, id: row.id }, class: "btn btn-info btn-xs", title: "#{t('camaleon_cms.admin.button.preview')}" %>
29
- <%= link_to raw('<i class="fa fa-usd"></i> ' + "#{t('plugin.ecommerce.product.price')}"), admin_plugins_ecommerce_shipping_method_prices_path(row.id), class: "btn btn-primary btn-xs" %>
28
+ <%= link_to raw('<i class="fa fa-usd"></i> ' + "#{t('plugins.ecommerce.shipping_prices', default: 'Prices')}"), admin_plugins_ecommerce_shipping_method_prices_path(row.id), class: "btn btn-primary btn-xs" %>
30
29
  <%= 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
30
  </td>
32
31
  </tr>
@@ -1,15 +1,15 @@
1
1
  <div class="panel panel-default">
2
2
  <div class="panel-heading">
3
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" %>
4
+ <%= link_to raw("<i class='fa fa-edit'></i> #{t('plugins.ecommerce.edit_shipping_methods')}"), {action: :edit, id: @shipping_method.id}, class: "btn btn-primary pull-right" %>
5
5
  </div>
6
6
  <div class="panel-body">
7
7
  <div class="row">
8
8
  <div class="col-md-6">
9
- <h3><%= t('plugin.ecommerce.info') %></h3>
9
+ <h3><%= t('plugins.ecommerce.info') %></h3>
10
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>
11
+ <li><strong><%= t('plugins.ecommerce.table.name') %>:</strong> <span> <%= @shipping_method.name %></span></li>
12
+ <li><strong><%= t('plugins.ecommerce.table.description') %>:</strong> <span> <%= @shipping_method.description %></span></li>
13
13
  </ul>
14
14
  </div>
15
15
 
@@ -1,6 +1,6 @@
1
1
  <div class="panel panel-default">
2
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>
3
+ <h4><span class="fa fa-money"></span> <%= @tax_rate.new_record? ? t('plugins.ecommerce.new_tax_rate') : "#{t('plugins.ecommerce.edit_tax_rate')}: #{@tax_rate.name}" %></h4>
4
4
  </div>
5
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
6
  <div class="panel-body">
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
  <% options = params[:options].present? ? params[:options] : @tax_rate.options rescue {} %>
13
13
  <div class="form-group">
14
- <label for=""><%= t('plugin.ecommerce.table.rate') %></label> (%)<br>
14
+ <label for=""><%= t('plugins.ecommerce.table.rate') %></label> (%)<br>
15
15
  <%= number_field_tag "options[rate]", options[:rate] || '', :class => "form-control required" %>
16
16
  </div>
17
17
 
@@ -19,7 +19,7 @@
19
19
 
20
20
 
21
21
  <div class="form-group">
22
- <label><%= f.check_box :status %> &nbsp; <%= t('plugin.ecommerce.active')%></label>
22
+ <label><%= f.check_box :status %> &nbsp; <%= t('plugins.ecommerce.active')%></label>
23
23
  </div>
24
24
  </div>
25
25
  <div class="panel-footer">
@@ -1,18 +1,18 @@
1
1
  <div class="panel panel-default">
2
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" %>
3
+ <h4><span class="fa fa-tag"></span> <%= t('plugins.ecommerce.tax_rates') %></h4>
4
+ <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugins.ecommerce.add_tax_rate')}"), {action: :new}, class: "btn btn-primary pull-right" %>
5
5
  </div>
6
6
  <div class="panel-body">
7
7
 
8
8
  <table class="table">
9
9
  <thead>
10
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>
11
+ <th id=""><%= t('plugins.ecommerce.table.id') %></th>
12
+ <th id=""><%= t('plugins.ecommerce.table.name') %></th>
13
+ <th id=""><%= t('plugins.ecommerce.table.rate') %></th>
14
+ <th id=""><%= t('plugins.ecommerce.table.status') %></th>
15
+ <th><%= t('plugins.ecommerce.table.actions') %></th>
16
16
  </tr>
17
17
  </thead>
18
18
  <tbody>
@@ -4,20 +4,20 @@
4
4
  <% end %>
5
5
  <div id="cama_checkout_view" class="row checkout_view">
6
6
  <%= render plugin_view('partials/cart_widget') %>
7
- <h1>Checkout Process</h1>
7
+ <h1><%= t('.check_out_process', default: 'Checkout Process') %></h1>
8
8
  <div class="stepwizard col-md-offset-3 col-sm-offset-3">
9
9
  <div class="stepwizard-row setup-panel">
10
10
  <div class="stepwizard-step">
11
11
  <a href="#step-1" type="button" class="btn btn-default btn-circle" disabled="disabled">1</a>
12
- <p>Step 1</p>
12
+ <p><%= t('.step', default: 'Step') %> 1</p>
13
13
  </div>
14
14
  <div class="stepwizard-step">
15
15
  <a href="#step-2" type="button" class="btn btn-default btn-circle" disabled="disabled">2</a>
16
- <p>Step 2</p>
16
+ <p><%= t('.step', default: 'Step') %> 2</p>
17
17
  </div>
18
18
  <div class="stepwizard-step">
19
19
  <a href="#step-3" type="button" class="btn btn-default btn-circle" disabled="disabled">3</a>
20
- <p>Step 3</p>
20
+ <p><%= t('.step', default: 'Step') %> 3</p>
21
21
  </div>
22
22
  </div>
23
23
  </div>