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,3 +1,3 @@
1
- <p><%= t('plugin.ecommerce.mail.order_received.welcome') %><%= @extra_data[:admin][:fullname] %></p>
2
- <p><%= t('plugin.ecommerce.mail.order_received.boght_by', user: @extra_data[:fullname], default: '%{user} has bought') %></p>
3
- <p><%= t('plugin.ecommerce.mail.order_received.reference') %> <a href="<%= @extra_data[:order_url] %>"><%= @extra_data[:order_slug] %></a>
1
+ <p><%= t('plugins.ecommerce.mail.order_received.welcome') %><%= @extra_data[:admin][:fullname] %></p>
2
+ <p><%= t('plugins.ecommerce.mail.order_received.boght_by', user: @extra_data[:fullname], default: '%{user} has bought') %></p>
3
+ <p><%= t('plugins.ecommerce.mail.order_received.reference') %> <a href="<%= @extra_data[:order_url] %>"><%= @extra_data[:order_slug] %></a>
@@ -1,2 +1,2 @@
1
- <p><%= t('plugin.ecommerce.mail.dear', default: 'Dear %{name}: ', name: @extra_data[:order].user.fullname) %></p>
2
- <p><%= t('plugin.ecommerce.mail.order_shipped.message', default: 'Your order %{order} has been sent.', order: @extra_data[:order].slug) %></p>
1
+ <p><%= t('plugins.ecommerce.mail.dear', default: 'Dear %{name}: ', name: @extra_data[:order].user.fullname) %></p>
2
+ <p><%= t('plugins.ecommerce.mail.order_shipped.message', default: 'Your order %{order} has been sent.', order: @extra_data[:order].slug) %></p>
@@ -1,4 +1,4 @@
1
1
  <% order_slug = @extra_data[:order].slug %>
2
- <p><%= t('plugin.ecommerce.mail.order_received.welcome') %><%= @extra_data[:fullname] %></p>
3
- <p><%= t('plugin.ecommerce.mail.recovery_cart.body') %></p>
4
- <p><%= t('plugin.ecommerce.mail.recovery_cart.reference') %> <a href="<%= plugins_ecommerce_order_show_url(order: order_slug) %>"><%= order_slug %></a>
2
+ <p><%= t('plugins.ecommerce.mail.order_received.welcome') %><%= @extra_data[:fullname] %></p>
3
+ <p><%= t('plugins.ecommerce.mail.recovery_cart.body') %></p>
4
+ <p><%= t('plugins.ecommerce.mail.recovery_cart.reference') %> <a href="<%= plugins_ecommerce_order_show_url(order: order_slug) %>"><%= order_slug %></a>
@@ -1,5 +1,5 @@
1
1
  <div class="page-title">
2
- <h2><span class="fa fa-tag"></span> <%= @coupon.new_record? ? "#{t('plugin.ecommerce.new_coupon')}" : "#{t('plugin.ecommerce.edit_coupon')}: #{@coupon.name}" %></h2>
2
+ <h2><span class="fa fa-tag"></span> <%= @coupon.new_record? ? "#{t('plugins.ecommerce.new_coupon')}" : "#{t('plugins.ecommerce.edit_coupon')}: #{@coupon.name}" %></h2>
3
3
  </div>
4
4
 
5
5
  <!-- PAGE CONTENT WRAPPER -->
@@ -8,37 +8,37 @@
8
8
  <div class="col-md-8 col-md-offset-2">
9
9
  <div class="panel panel-default">
10
10
  <div class="panel-heading ui-draggable-handle">
11
- <h3 class="panel-title"><%= t('plugin.ecommerce.form_coupon') %></h3>
11
+ <h3 class="panel-title"><%= t('plugins.ecommerce.form_coupon') %></h3>
12
12
  </div>
13
13
  <%= form_for @coupon, url:{action: @coupon.new_record? ? :create : :update}, html: {class: 'validate-coupon', id: 'form-coupon'} do |f| %>
14
14
  <div class="panel-body">
15
15
  <%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @coupon} %>
16
16
  <div class="form-group">
17
- <%= f.label t('plugin.ecommerce.table.name') %><br>
17
+ <%= f.label t('plugins.ecommerce.table.name') %><br>
18
18
  <%= f.text_field :name, :class => "form-control required" %>
19
19
  </div>
20
20
  <div class="form-group">
21
- <label for=""><%= t('plugin.ecommerce.table.code') %></label><br>
21
+ <label for=""><%= t('plugins.ecommerce.table.code') %></label><br>
22
22
  <%= f.text_field :slug, :class => "form-control required" %>
23
23
  </div>
24
24
  <% options = params[:options].present? ? params[:options] : @coupon.options rescue {} %>
25
25
  <div class="form-group">
26
- <label for=""><%= t('plugin.ecommerce.table.amount') %></label><br>
26
+ <label for=""><%= t('plugins.ecommerce.table.amount') %></label><br>
27
27
  <%= number_field_tag "options[amount]", options[:amount] || '', :class => "form-control required" %>
28
28
  </div>
29
29
 
30
30
  <div class="form-group">
31
- <label for=""><%= t('plugin.ecommerce.table.discount_type') %></label><br>
32
- <%= select_tag "options[discount_type]", options_for_select([[t('plugin.ecommerce.table.percent'),"percent"],[t('plugin.ecommerce.table.money'),"money"],[t('plugin.ecommerce.table.free_shipping'),"free_ship"]], options[:discount_type] || ''), :class => "form-control required" %>
31
+ <label for=""><%= t('plugins.ecommerce.table.discount_type') %></label><br>
32
+ <%= select_tag "options[discount_type]", options_for_select([[t('plugins.ecommerce.table.percent'),"percent"],[t('plugins.ecommerce.table.money'),"money"],[t('plugins.ecommerce.table.free_shipping'),"free_ship"]], options[:discount_type] || ''), :class => "form-control required" %>
33
33
  </div>
34
34
 
35
35
  <div class="form-group">
36
- <label for=""><%= t('plugin.ecommerce.table.min_cart_total') %></label><br>
36
+ <label for=""><%= t('plugins.ecommerce.table.min_cart_total') %></label><br>
37
37
  <%= text_field_tag "options[min_cart_total]",options[:min_cart_total] || '', :class => "form-control required" %>
38
38
  </div>
39
39
 
40
40
  <div class="form-group">
41
- <label for=""><%= t('plugin.ecommerce.table.expiration_date') %></label><br>
41
+ <label for=""><%= t('plugins.ecommerce.table.expiration_date') %></label><br>
42
42
  <div class="input-group date date-input-box">
43
43
  <%= text_field_tag "options[expirate_date]",options[:expirate_date] || '', :class => "form-control required", "data-locale" => current_locale %>
44
44
  <span class="add-on input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
@@ -46,13 +46,13 @@
46
46
  </div>
47
47
 
48
48
  <div class="form-group">
49
- <label for=""><%= t('plugin.ecommerce.table.allowed_applications') %></label><br>
49
+ <label for=""><%= t('plugins.ecommerce.table.allowed_applications') %></label><br>
50
50
  <%= number_field_tag "options[allowed_applications]", options[:allowed_applications] || '1', :class => "form-control required" %>
51
51
  </div>
52
52
 
53
53
 
54
54
  <div class="form-group">
55
- <label><%= f.check_box :status %> &nbsp; <%= t('plugin.ecommerce.active') %></label>
55
+ <label><%= f.check_box :status %> &nbsp; <%= t('plugins.ecommerce.active') %></label>
56
56
  </div>
57
57
  </div>
58
58
  <div class="panel-footer">
@@ -1,22 +1,22 @@
1
1
  <div class="panel panel-default">
2
2
  <div class="panel-heading">
3
- <h4><span class="fa fa-tag"></span> <%= t('plugin.ecommerce.coupons') %></h4>
4
- <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugin.ecommerce.add_coupons')}"), {action: :new}, class: "btn btn-primary pull-right" %>
3
+ <h4><span class="fa fa-tag"></span> <%= t('plugins.ecommerce.coupons') %></h4>
4
+ <%= link_to raw("<i class='fa fa-plus'></i> #{t('plugins.ecommerce.add_coupons')}"), {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.code') %></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.amount') %></th>
15
- <th id=""><%= t('plugin.ecommerce.table.min_cart_total') %></th>
16
- <th id=""><%= t('plugin.ecommerce.table.expiration_date') %></th>
17
- <th id=""><%= t('plugin.ecommerce.table.allowed_applications') %></th>
18
- <th id=""><%= t('plugin.ecommerce.table.used_applications') %></th>
19
- <th><%= t('plugin.ecommerce.table.actions') %></th>
11
+ <th id=""><%= t('plugins.ecommerce.table.code') %></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.amount') %></th>
15
+ <th id=""><%= t('plugins.ecommerce.table.min_cart_total') %></th>
16
+ <th id=""><%= t('plugins.ecommerce.table.expiration_date') %></th>
17
+ <th id=""><%= t('plugins.ecommerce.table.allowed_applications') %></th>
18
+ <th id=""><%= t('plugins.ecommerce.table.used_applications') %></th>
19
+ <th><%= t('plugins.ecommerce.table.actions') %></th>
20
20
  </tr>
21
21
  </thead>
22
22
  <tbody>
@@ -1,13 +1,13 @@
1
1
  <div class="panel panel-default">
2
2
  <div class="panel-heading">
3
- <h4><span class="fa fa-cog"></span> <%= t('plugin.ecommerce.edit_order') %>: <%= @order.slug %></h4>
3
+ <h4><span class="fa fa-cog"></span> <%= t('plugins.ecommerce.edit_order') %>: <%= @order.slug %></h4>
4
4
  </div>
5
5
  <%= form_for @order, url: {action: @order.new_record? ? :create : :update}, html: {class: 'form-order', id: 'form-order'} do |f| %>
6
6
  <div class="panel-body">
7
7
  <%= render plugin_view('partials/checkout/user_info'), cart: @order, as_partial: true %>
8
8
  <hr>
9
9
  <div class="form-group">
10
- <%= f.label nil, t('plugin.ecommerce.show_order.consignment_number', default: 'Consignment Number') %>
10
+ <%= f.label nil, t('plugins.ecommerce.show_order.consignment_number', default: 'Consignment Number') %>
11
11
  <%= text_field_tag 'metas[consignment_number]', @order.get_meta('consignment_number'), class: 'form-control' %>
12
12
  </div>
13
13
  <div class="form-group">
@@ -1,56 +1,47 @@
1
1
  <div class="panel panel-default" id="commerce-orders-list">
2
2
  <div class="panel-heading">
3
- <h4><span class="fa fa-cog"></span> <%= t('plugin.ecommerce.orders') %></h4>
3
+ <h4><span class="fa fa-cog"></span> <%= t('plugins.ecommerce.orders') %></h4>
4
4
  </div>
5
5
 
6
6
  <div class="panel-body">
7
- <div class="box-adv-search pull-right" id="orders-box-adv-search">
7
+ <%= form_tag(url_for(action: :index), class: 'pull-right', method: 'get') do %>
8
8
  <div class="input-group" id="adv-search">
9
- <input type="text" class="form-control" placeholder="<%= t('plugin.ecommerce.search_order_number') %>" name="q" value="<%= params[:q] %>"/>
10
-
9
+ <input type="text" class="form-control" placeholder="<%= t('plugins.ecommerce.search_order_number') %>" name="q" value="<%= params[:q] %>"/>
11
10
  <div class="input-group-btn">
12
- <div class="btn-group" role="group">
13
- <div class="dropdown dropdown-lg">
14
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
15
- <span class="caret"></span></button>
16
- <div class="dropdown-menu dropdown-menu-right" role="menu">
17
- <form action="<%= url_for(action: :index) %>" method="get" class="form-horizontal" role="form">
18
- <div class="form-group">
19
- <label for="contain"><%= t('plugin.ecommerce.table.customer') %> </label>
20
- <input class="form-control" type="text" name="c" value="<%= params[:c] %>"/>
21
- </div>
22
- <div class="form-group">
23
- <label for="contain"><%= t('plugin.ecommerce.e_mail_address') %></label>
24
- <input class="form-control" type="email" name="e" value="<%= params[:e] %>"/>
25
- </div>
26
- <div class="form-group">
27
- <label for="contain"><%= t('plugin.ecommerce.phone_number') %></label>
28
- <input class="form-control" type="text" name="p" value="<%= params[:p] %>"/>
29
- </div>
30
- <div class="form-group">
31
- <label for="contain"><%= t('plugin.ecommerce.table.status') %></label>
32
- <%= select_tag "s", options_for_select([[""], [t('plugin.ecommerce.select.received'), "received"], [t('plugin.ecommerce.select.unpaid'), "unpaid"], [t('plugin.ecommerce.select.accepted'), "accepted"], [t('plugin.ecommerce.select.shipped'), "shipped"], [t('plugin.ecommerce.select.closed'), "closed"], [t('plugin.ecommerce.select.canceled'), "canceled"]], params[:s]), class: 'form-control' %>
33
- </div>
34
-
35
- <button type="submit" class="btn btn-primary">
36
- <span class="fa fa-search" aria-hidden="true"></span></button>
37
- </form>
38
- </div>
39
- </div>
40
- <button type="button" class="btn btn-primary">
41
- <span class="fa fa-search" aria-hidden="true"></span></button>
42
- </div>
11
+ <button type="button" title="<%= t('plugins.ecommerce.advanced_search', default: 'Advanced Search') %>" class="btn btn-default" id="ecommerce_adv_search_btn"><span class="caret"></span></button>
12
+ <button type="submit" class="btn btn-primary"><span class="fa fa-search"></span></button>
43
13
  </div>
44
14
  </div>
15
+ <% end %>
16
+ <div class="hidden" id="commerce_adv_search_modal">
17
+ <%= form_tag(url_for(action: :index), method: :get) do %>
18
+ <div class="form-group">
19
+ <label for="contain"><%= t('plugins.ecommerce.table.customer') %> </label>
20
+ <input class="form-control" type="text" name="c" value="<%= params[:c] %>"/>
21
+ </div>
22
+ <div class="form-group">
23
+ <label for="contain"><%= t('plugins.ecommerce.e_mail_address') %></label>
24
+ <input class="form-control" type="email" name="e" value="<%= params[:e] %>"/>
25
+ </div>
26
+ <!--<div class="form-group">-->
27
+ <!--<label for="contain"><%= t('plugins.ecommerce.phone_number') %></label>-->
28
+ <!--<input class="form-control" type="text" name="p" value="<%= params[:p] %>"/>-->
29
+ <!--</div>-->
30
+ <div class="form-group">
31
+ <label for="contain"><%= t('plugins.ecommerce.table.status') %></label>
32
+ <%= select_tag "s", options_for_select([[""], [t('plugins.ecommerce.select.accepted'), "accepted"], [cama_t('plugins.ecommerce.select.shipped'), "shipped"], [cama_t('plugins.ecommerce.select.canceled'), "canceled"], [cama_t('plugins.ecommerce.select.paid'), "paid"], [cama_t('plugins.ecommerce.select.pending'), "on_delivery|bank_pending"]], params[:s]), class: 'form-control' %>
33
+ </div>
34
+ <button type="submit" class="btn btn-primary"><span class="fa fa-search" aria-hidden="true"></span> <%= t("camaleon_cms.admin.button.search") %></button>
35
+ <% end %>
45
36
  </div>
46
37
  <div class="hidden" id="commerce_cancel_modal">
47
38
  <%= form_tag '#' do %>
48
39
  <div class="form-group">
49
- <%= label_tag nil, t('plugin.ecommerce.table.description', default: 'Description') %>
40
+ <%= label_tag nil, t('plugins.ecommerce.table.description', default: 'Description') %>
50
41
  <%= text_area_tag 'description', '', class: 'form-control required' %>
51
42
  </div>
52
43
  <div class="">
53
- <span class="input-group-btn"><button class="btn btn-default" type="submit"><%= t('plugin.ecommerce.table.make_canceled', default: 'Mark as Canceled') %></button></span>
44
+ <span class="input-group-btn"><button class="btn btn-default" type="submit"><%= t('plugins.ecommerce.table.make_canceled', default: 'Mark as Canceled') %></button></span>
54
45
  </div>
55
46
  <% end %>
56
47
  </div>
@@ -58,11 +49,11 @@
58
49
  <div class="hidden" id="commerce_shipped_modal">
59
50
  <%= form_tag '#' do %>
60
51
  <div>
61
- <%= label_tag nil, t('plugin.ecommerce.show_order.consignment_number', default: 'Consignment Number') %>
52
+ <%= label_tag nil, t('plugins.ecommerce.show_order.consignment_number', default: 'Consignment Number') %>
62
53
  </div>
63
54
  <div class="input-group">
64
55
  <%= text_field_tag 'consignment_number', '', class: 'form-control' %>
65
- <span class="input-group-btn"><button class="btn btn-default" type="submit"><%= t('plugin.ecommerce.table.make_shipped', default: 'Mark as Shipped') %></button></span>
56
+ <span class="input-group-btn"><button class="btn btn-default" type="submit"><%= t('plugins.ecommerce.table.make_shipped', default: 'Mark as Shipped') %></button></span>
66
57
  </div>
67
58
  <% end %>
68
59
  </div>
@@ -70,15 +61,15 @@
70
61
  <table class="table">
71
62
  <thead>
72
63
  <tr>
73
- <th id=""><%= t('plugin.ecommerce.table.id') %></th>
74
- <th id=""><%= t('plugin.ecommerce.table.customer') %></th>
75
- <th id=""><%= t('plugin.ecommerce.table.status') %></th>
76
- <th id=""><%= t('plugin.ecommerce.table.paid') %></th>
77
- <th id=""><%= t('plugin.ecommerce.table.products') %></th>
78
- <th id=""><%= t('plugin.ecommerce.table.amount') %></th>
79
- <th id=""><%= t('plugin.ecommerce.table.received_time') %></th>
80
- <th id=""><%= t('plugin.ecommerce.table.payment_method') %></th>
81
- <th><%= t('camaleon_cms.admin.table.actions') %></th>
64
+ <th><%= cama_t('plugins.ecommerce.table.id') %></th>
65
+ <th><%= cama_t('plugins.ecommerce.table.customer') %></th>
66
+ <th><%= cama_t('plugins.ecommerce.table.status') %></th>
67
+ <th><%= cama_t('plugins.ecommerce.table.paid') %></th>
68
+ <th><%= cama_t('plugins.ecommerce.table.products') %></th>
69
+ <th><%= cama_t('plugins.ecommerce.table.amount') %></th>
70
+ <th><%= cama_t('plugins.ecommerce.table.created_at') %></th>
71
+ <th><%= cama_t('plugins.ecommerce.table.payment_method') %></th>
72
+ <th><%= cama_t('camaleon_cms.admin.table.actions') %></th>
82
73
  </tr>
83
74
  </thead>
84
75
  <tbody>
@@ -103,19 +94,19 @@
103
94
  <% end %>
104
95
  </td>
105
96
  <td><%= order.cache_the_total %></td>
106
- <td><%= order.received_at %></td>
97
+ <td><%= order.created_at %></td>
107
98
  <td><%= order.payment_method.name rescue "" %></td>
108
99
  <td>
109
100
  <%= link_to raw('<i class="fa fa-eye"></i>'), {action: :show, id: order.slug}, class: "btn btn-info btn-xs", title: "#{t('camaleon_cms.admin.button.preview')}" %>
110
101
  <%= link_to raw('<i class="fa fa-edit"></i>'), {action: :edit, id: order.slug}, class: "btn btn-default btn-xs", title: "#{t('camaleon_cms.admin.button.edit')}" %>
111
- <%= link_to raw('<i class="fa fa-trash"></i>'), {action: :destroy, id: order.slug}, class: "btn btn-danger btn-xs", title: "#{t('camaleon_cms.admin.button.delete', default: 'Delete Order')}", method: :delete, 'data-confirm'=> t('plugin.ecommerce.table.confirm_delete', default: 'Are you sure to delete this order?') %>
102
+ <%= link_to raw('<i class="fa fa-trash"></i>'), {action: :destroy, id: order.slug}, class: "btn btn-danger btn-xs", title: "#{t('camaleon_cms.admin.button.delete', default: 'Delete Order')}", method: :delete, 'data-confirm'=> t('plugins.ecommerce.table.confirm_delete', default: 'Are you sure to delete this order?') %>
112
103
  <div class="btn-group">
113
104
  <button class="btn btn-info btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false" title="<%= t('camaleon_cms.admin.button.settings') %>"><i class="fa fa-cog"></i></button>
114
105
  <ul class="dropdown-menu pull-right" style="min-width: 50px;">
115
- <%= content_tag :li, link_to(t('plugin.ecommerce.table.make_accepted', default: 'Mark as Accepted'), url_for(action: :mark_accepted, order_id: order.slug), class: 'btn btn-xs') if order.paid? %>
116
- <%= content_tag :li, link_to(t('plugin.ecommerce.table.make_shipped', default: 'Mark as Shipped'), url_for(action: :mark_shipped, order_id: order.slug), class: 'btn btn-xs mark_shipped_btn') if order.accepted? || order.paid? %>
117
- <%= content_tag :li, link_to(t('plugin.ecommerce.table.make_canceled', default: 'Mark as Canceled'), url_for(action: :mark_canceled, order_id: order.slug), class: 'btn btn-xs mark_canceled_btn', 'data-confirm_msg'=> t('plugin.ecommerce.table.confirm_mark_as_cancel', default: 'Are you sure to mark as Canceled?')) if order.bank_pending? || order.paid? %>
118
- <%= content_tag :li, link_to(t('plugin.ecommerce.table.make_bank_confirmed', default: 'Mark as Paid'), url_for(action: :mark_bank_confirmed, order_id: order.slug), class: 'btn btn-xs', 'data-confirm'=> t('plugin.ecommerce.table.confirm_mark_as_paid', default: 'Are you sure to mark as Paid?')) if order.bank_pending? %>
106
+ <%= content_tag :li, link_to(t('plugins.ecommerce.table.make_accepted', default: 'Mark as Accepted'), url_for(action: :mark_accepted, order_id: order.slug), class: 'btn btn-xs') if order.paid? %>
107
+ <%= content_tag :li, link_to(t('plugins.ecommerce.table.make_shipped', default: 'Mark as Shipped'), url_for(action: :mark_shipped, order_id: order.slug), class: 'btn btn-xs mark_shipped_btn') if order.accepted? || order.paid? %>
108
+ <%= content_tag :li, link_to(t('plugins.ecommerce.table.make_canceled', default: 'Mark as Canceled'), url_for(action: :mark_canceled, order_id: order.slug), class: 'btn btn-xs mark_canceled_btn', 'data-confirm_msg'=> t('plugins.ecommerce.table.confirm_mark_as_cancel', default: 'Are you sure to mark as Canceled?')) if order.bank_pending? || order.on_delivery_pending? || order.paid? %>
109
+ <%= content_tag :li, link_to(t('plugins.ecommerce.table.make_bank_confirmed', default: 'Mark as Paid'), url_for(action: :mark_bank_confirmed, order_id: order.slug), class: 'btn btn-xs', 'data-confirm'=> t('plugins.ecommerce.table.confirm_mark_as_paid', default: 'Are you sure to mark as Paid?')) if order.bank_pending? || order.on_delivery_pending? %>
119
110
  </ul>
120
111
  </div>
121
112
  </td>
@@ -136,6 +127,14 @@
136
127
  open_modal({title: link.text(), content: panel.find('#commerce_shipped_modal').html(), callback: function(modal){ modal.find('form').attr('action', link.attr('href')).validate(); }});
137
128
  });
138
129
 
130
+ panel.find('#ecommerce_adv_search_btn').click(function(e){
131
+ var link = $(this);
132
+ e.preventDefault();
133
+ open_modal({title: link.attr('title'), content: panel.find('#commerce_adv_search_modal').html(), callback: function(modal){
134
+ modal.find('form').validate();
135
+ }});
136
+ });
137
+
139
138
  panel.find('.mark_canceled_btn').click(function(e){
140
139
  var link = $(this);
141
140
  e.preventDefault();
@@ -143,14 +142,5 @@
143
142
  modal.find('form').attr('action', link.attr('href')).validate({submitHandler: function(){ return confirm(link.attr('data-confirm_msg')); }});
144
143
  }});
145
144
  });
146
-
147
- var cont = $('#orders-box-adv-search');
148
- var rnd = "input_" + Math.floor((Math.random() * 1000000) + 1);
149
- cont.find('#adv-search > input').change(function () {
150
- cont.find('form .' + rnd).val($(this).val());
151
- }).clone().attr('type', 'hidden').addClass(rnd).appendTo(cont.find('form'));
152
- cont.find('#adv-search .btn-group > button').click(function () {
153
- cont.find('form').submit();
154
- });
155
145
  });
156
146
  </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> <%= @payment_method.new_record? ? "#{t('plugin.ecommerce.new_payment_methods')}" : "#{t('plugin.ecommerce.edit_payment_methods')}: #{@payment_method.name}" %></h4>
3
+ <h4><span class="fa fa-credit-card"></span> <%= @payment_method.new_record? ? "#{t('plugins.ecommerce.new_payment_methods')}" : "#{t('plugins.ecommerce.edit_payment_methods')}: #{@payment_method.name}" %></h4>
4
4
  </div>
5
5
  <%= form_for @payment_method, url:{action: @payment_method.new_record? ? :create : :update}, html: {class: 'validate-payment_method', id: 'form-payment_method'} do |f| %>
6
6
  <div class="panel-body">
7
7
  <%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @payment_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 hidden">
@@ -14,24 +14,25 @@
14
14
  <%= f.text_field :slug, :class => "form-control slug", "data-parent" => 'plugins_ecommerce_payment_method_name' %>
15
15
  </div>
16
16
  <div class="form-group">
17
- <%= f.label t('plugin.ecommerce.table.description') %><br>
17
+ <%= f.label t('plugins.ecommerce.table.description') %><br>
18
18
  <%= f.text_area :description, :class => "form-control translatable", :rows => 4 %>
19
19
  </div>
20
20
  <div class="form-group">
21
- <label><%= f.check_box :status %> &nbsp; <%= t('plugin.ecommerce.active') %> </label>
21
+ <label><%= f.check_box :status %> &nbsp; <%= t('plugins.ecommerce.active') %> </label>
22
22
  </div>
23
23
 
24
24
  <% options = @payment_method.options rescue {type: 'bank_transfer'}
25
25
  options = params[:options] if params[:options].present?
26
26
  %>
27
- <h4><%= t('plugin.ecommerce.options_payment_methods') %></h4>
27
+ <h4><%= t('plugins.ecommerce.options_payment_methods') %></h4>
28
28
  <hr/>
29
29
  <div id="tab-select-payment-method" class="panel panel-default tabs">
30
30
  <ul class="nav nav-tabs nav-justified">
31
- <li class="<%= 'active' if options[:type] == 'bank_transfer' %>"><a href="#tab8" data-toggle="tab"><%= t('plugin.ecommerce.by_bank_transfer') %></a></li>
32
- <li class="<%= 'active' if options[:type] == 'paypal' %>"><a href="#tab9" data-toggle="tab"><%= t('plugin.ecommerce.by_paypal') %></a></li>
33
- <li class="<%= 'active' if options[:type] == 'authorize_net' %>"><a href="#tab10" data-toggle="tab"><%= t('plugin.ecommerce.by_authorize_net') %></a></li>
34
- <li class="<%= 'active' if options[:type] == 'stripe' %>"><a href="#tab11" data-toggle="tab"><%= t('plugin.ecommerce.by_stripe', default: 'Stripe') %></a></li>
31
+ <li class="<%= 'active' if options[:type] == 'bank_transfer' %>"><a href="#tab8" data-toggle="tab"><%= t('plugins.ecommerce.by_bank_transfer') %></a></li>
32
+ <li class="<%= 'active' if options[:type] == 'on_delivery' %>"><a href="#tab_on_delivery" data-toggle="tab"><%= t('plugins.ecommerce.by_on_delivery', default: 'Payment on delivery') %></a></li>
33
+ <li class="<%= 'active' if options[:type] == 'paypal' %>"><a href="#tab9" data-toggle="tab"><%= t('plugins.ecommerce.by_paypal') %></a></li>
34
+ <li class="<%= 'active' if options[:type] == 'authorize_net' %>"><a href="#tab10" data-toggle="tab"><%= t('plugins.ecommerce.by_authorize_net') %></a></li>
35
+ <li class="<%= 'active' if options[:type] == 'stripe' %>"><a href="#tab11" data-toggle="tab"><%= t('plugins.ecommerce.by_stripe', default: 'Stripe') %></a></li>
35
36
  <% ecommerce_custom_payment_methods.each do |k, obj| %>
36
37
  <li class="<%= 'active' if options[:type] == k %>"><a href="#tab_<%= k %>" data-toggle="tab"><%= obj[:title] %></a></li>
37
38
  <% end %>
@@ -41,79 +42,84 @@
41
42
  <div class="tab-pane <%= 'active' if options[:type] == 'bank_transfer' %>" id="tab8">
42
43
  <%= hidden_field_tag( "options[type]", 'bank_transfer') %>
43
44
  <div class="form-group">
44
- <label><%= t('plugin.ecommerce.table.number_account_bank') %></label><br>
45
+ <label><%= t('plugins.ecommerce.table.number_account_bank') %></label><br>
45
46
  <%= text_field_tag( "options[bank_transfer_number_account]", options[:bank_transfer_number_account], class: "form-control required") %>
46
47
  </div>
47
48
  <div class="form-group">
48
- <label><%= t('plugin.ecommerce.table.details') %></label><br>
49
+ <label><%= t('plugins.ecommerce.table.details') %></label><br>
49
50
  <%= text_area_tag( "options[bank_transfer_detail]", options[:bank_transfer_detail], class: "form-control required") %>
50
51
  </div>
51
52
  </div>
52
53
 
53
54
  <div class="tab-pane <%= 'active' if options[:type] == 'paypal' %>" id="tab9">
55
+ <a href="http://support.berta.me/kb/online-shop/how-to-get-paypal-api-username-password-and-signature-information">Steps here: http://support.berta.me/kb/online-shop/how-to-get-paypal-api-username-password-and-signature-information</a>
54
56
  <%= hidden_field_tag( "options[type]", 'paypal') %>
55
57
  <div class="form-group">
56
- <label><%= t('plugin.ecommerce.table.username_login') %></label><br>
58
+ <label><%= t('plugins.ecommerce.table.username_login') %></label><br>
57
59
  <%= text_field_tag( "options[paypal_login]", options[:paypal_login], class: "form-control required") %>
58
60
  </div>
59
61
  <div class="form-group">
60
- <label><%= t('plugin.ecommerce.table.password') %></label><br>
62
+ <label><%= t('plugins.ecommerce.table.password') %></label><br>
61
63
  <%= text_field_tag( "options[paypal_password]", options[:paypal_password], class: "form-control required") %>
62
64
  </div>
63
65
  <div class="form-group">
64
- <label><%= t('plugin.ecommerce.table.signature') %></label><br>
66
+ <label><%= t('plugins.ecommerce.table.signature') %></label><br>
65
67
  <%= text_field_tag( "options[paypal_signature]", options[:paypal_signature], class: "form-control required") %>
66
68
  </div>
67
69
  <div class="form-group">
68
- <div class="checkbox"><label><input type="checkbox" name="options[paypal_sandbox]" value="1" <%= 'checked' if options[:paypal_sandbox] %>> <%= t('plugin.ecommerce.table.sandbox') %> </label></div>
70
+ <div class="checkbox"><label><input type="checkbox" name="options[paypal_sandbox]" value="1" <%= 'checked' if options[:paypal_sandbox] %>> <%= t('plugins.ecommerce.table.sandbox') %> </label></div>
69
71
  </div>
70
72
  </div>
71
73
 
72
74
  <div class="tab-pane <%= 'active' if options[:type] == 'credit_card' %>" id="tab7">
73
75
  <%= hidden_field_tag( "options[type]", 'credit_card') %>
74
76
  <div class="form-group">
75
- <label><%= t('plugin.ecommerce.table.username_login') %></label><br>
77
+ <label><%= t('plugins.ecommerce.table.username_login') %></label><br>
76
78
  <%= text_field_tag( "options[cc_paypal_login]", options[:cc_paypal_login], class: "form-control required") %>
77
79
  </div>
78
80
  <div class="form-group">
79
- <label><%= t('plugin.ecommerce.table.password') %></label><br>
81
+ <label><%= t('plugins.ecommerce.table.password') %></label><br>
80
82
  <%= text_field_tag( "options[cc_paypal_password]", options[:cc_paypal_password], class: "form-control required") %>
81
83
  </div>
82
84
  <div class="form-group">
83
- <label><%= t('plugin.ecommerce.table.signature') %></label><br>
85
+ <label><%= t('plugins.ecommerce.table.signature') %></label><br>
84
86
  <%= text_field_tag( "options[cc_paypal_signature]", options[:cc_paypal_signature], class: "form-control required") %>
85
87
  </div>
86
88
  <div class="form-group">
87
- <div class="checkbox"><label><input type="checkbox" name="options[cc_paypal_sandbox]" value="1" <%= 'checked' if options[:cc_paypal_sandbox] %>> <%= t('plugin.ecommerce.table.sandbox') %> </label></div>
89
+ <div class="checkbox"><label><input type="checkbox" name="options[cc_paypal_sandbox]" value="1" <%= 'checked' if options[:cc_paypal_sandbox] %>> <%= t('plugins.ecommerce.table.sandbox') %> </label></div>
88
90
  </div>
89
91
  </div>
90
92
 
91
93
  <div class="tab-pane <%= 'active' if options[:type] == 'authorize_net' %>" id="tab10">
92
94
  <%= hidden_field_tag('options[type]', 'authorize_net') %>
93
95
  <div class="form-group">
94
- <label><%= t('plugin.ecommerce.table.login_id') %></label><br>
96
+ <label><%= t('plugins.ecommerce.table.login_id') %></label><br>
95
97
  <%= text_field_tag('options[authorize_net_login_id]', options[:authorize_net_login_id], class: 'form-control required') %>
96
98
  </div>
97
99
  <div class="form-group">
98
- <label><%= t('plugin.ecommerce.table.transaction_key') %></label><br>
100
+ <label><%= t('plugins.ecommerce.table.transaction_key') %></label><br>
99
101
  <%= text_field_tag('options[authorize_net_transaction_key]', options[:authorize_net_transaction_key], class: 'form-control required') %>
100
102
  </div>
101
103
  <div class="form-group">
102
104
  <div class="checkbox">
103
105
  <label>
104
- <input type="checkbox" name="options[authorize_net_sandbox]" value="1" <%= 'checked' if options[:authorize_net_sandbox] %>> <%= t('plugin.ecommerce.table.sandbox') %>
106
+ <input type="checkbox" name="options[authorize_net_sandbox]" value="1" <%= 'checked' if options[:authorize_net_sandbox] %>> <%= t('plugins.ecommerce.table.sandbox') %>
105
107
  </label>
106
108
  </div>
107
109
  </div>
108
110
  </div>
111
+ <div class="tab-pane <%= 'active' if options[:type] == 'on_delivery' %>" id="tab_on_delivery">
112
+ <%= hidden_field_tag('options[type]', 'on_delivery') %>
113
+ <h3><i class="fa fa-check-circle"></i></h3>
114
+ </div>
109
115
  <div class="tab-pane <%= 'active' if options[:type] == 'stripe' %>" id="tab11">
110
116
  <%= hidden_field_tag('options[type]', 'stripe') %>
111
117
  <div class="form-group">
112
- <label><%= t('plugin.ecommerce.stripe_scret_key', default: 'Secret Key') %></label><br>
118
+ <label><%= t('plugins.ecommerce.stripe_scret_key', default: 'Secret Key') %></label><br>
113
119
  <%= text_field_tag('options[stripe_id]', options[:stripe_id], class: 'form-control required') %>
114
120
  </div>
115
121
  <div class="form-group">
116
- <label><%= t('plugin.ecommerce.stripe_publish_key', default: 'Publishable Key') %></label><br>
122
+ <label><%= t('plugins.ecommerce.stripe_publish_key', default: 'Publishable Key') %></label><br>
117
123
  <%= text_field_tag('options[stripe_key]', options[:stripe_key], class: 'form-control required') %>
118
124
  </div>
119
125
  </div>